From 57354579aade5339a0aa80e3572c01cf7fd09c0e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 11 Aug 2019 00:00:55 -0500 Subject: [PATCH 1/7] Unify chat constants usage --- common/database.h | 2 + common/database_conversions.cpp | 2 +- common/eq_constants.h | 300 +++++--------- common/eqemu_logsys.cpp | 22 +- common/string_util.cpp | 11 + common/string_util.h | 1 + world/adventure.cpp | 2 +- world/net.cpp | 6 +- zone/aa.cpp | 14 +- zone/attack.cpp | 84 ++-- zone/aura.cpp | 16 +- zone/bot.cpp | 140 +++---- zone/bot_command.cpp | 20 +- zone/client.cpp | 188 ++++----- zone/client.h | 17 - zone/client_packet.cpp | 684 ++++++++++++++++---------------- zone/client_process.cpp | 58 +-- zone/corpse.cpp | 30 +- zone/doors.cpp | 22 +- zone/effects.cpp | 40 +- zone/embparser_api.cpp | 2 +- zone/entity.cpp | 25 +- zone/exp.cpp | 66 +-- zone/forage.cpp | 40 +- zone/guild_mgr.cpp | 2 +- zone/horse.cpp | 2 +- zone/inventory.cpp | 84 ++-- zone/lua_general.cpp | 172 ++++---- zone/lua_mob.cpp | 4 +- zone/merc.cpp | 8 +- zone/mob.cpp | 18 +- zone/mob_ai.cpp | 24 +- zone/mob_movement_manager.cpp | 10 +- zone/npc.cpp | 10 +- zone/oldcode.cpp | 2 +- zone/pathing.cpp | 6 +- zone/pets.cpp | 4 +- zone/questmgr.cpp | 36 +- zone/special_attacks.cpp | 30 +- zone/spell_effects.cpp | 96 ++--- zone/spells.cpp | 232 +++++------ zone/tasks.cpp | 34 +- zone/tradeskills.cpp | 64 +-- zone/trading.cpp | 80 ++-- zone/trap.cpp | 4 +- zone/tribute.cpp | 6 +- zone/tune.cpp | 10 +- zone/worldserver.cpp | 20 +- zone/zonedb.cpp | 8 +- zone/zoning.cpp | 26 +- 50 files changed, 1352 insertions(+), 1432 deletions(-) diff --git a/common/database.h b/common/database.h index 307390edf..71ebe3315 100644 --- a/common/database.h +++ b/common/database.h @@ -94,6 +94,8 @@ class PTimerList; # define _ISNAN_(a) std::isnan(a) #endif +#define SQL(...) #__VA_ARGS__ + class Database : public DBcore { public: Database(); diff --git a/common/database_conversions.cpp b/common/database_conversions.cpp index 9850dfac1..ec973d9af 100644 --- a/common/database_conversions.cpp +++ b/common/database_conversions.cpp @@ -476,7 +476,7 @@ bool Database::CheckDatabaseConversions() { CheckDatabaseConvertCorpseDeblob(); /* Run EQEmu Server script (Checks for database updates) */ - system("perl eqemu_server.pl ran_from_world"); + if(system("perl eqemu_server.pl ran_from_world")); return true; } diff --git a/common/eq_constants.h b/common/eq_constants.h index 657db450e..bf65f2bfb 100644 --- a/common/eq_constants.h +++ b/common/eq_constants.h @@ -87,200 +87,114 @@ typedef enum { _eaMaxAppearance } EmuAppearance; -#define MT_NPCQuestSay 10 -// msg_type's for custom usercolors -#define MT_Say 256 -#define MT_Tell 257 -#define MT_Group 258 -#define MT_Guild 259 -#define MT_OOC 260 -#define MT_Auction 261 -#define MT_Shout 262 -#define MT_Emote 263 -#define MT_Spells 264 -#define MT_YouHitOther 265 -#define MT_OtherHitsYou 266 -#define MT_YouMissOther 267 -#define MT_OtherMissesYou 268 -#define MT_Broadcasts 269 -#define MT_Skills 270 -#define MT_Disciplines 271 -#define MT_Unused1 272 -#define MT_DefaultText 273 -#define MT_Unused2 274 -#define MT_MerchantOffer 275 -#define MT_MerchantBuySell 276 -#define MT_YourDeath 277 -#define MT_OtherDeath 278 -#define MT_OtherHits 279 -#define MT_OtherMisses 280 -#define MT_Who 281 -#define MT_YellForHelp 282 -#define MT_NonMelee 283 -#define MT_WornOff 284 -#define MT_MoneySplit 285 -#define MT_LootMessages 286 -#define MT_DiceRoll 287 -#define MT_OtherSpells 288 -#define MT_SpellFailure 289 -#define MT_Chat 290 -#define MT_Channel1 291 -#define MT_Channel2 292 -#define MT_Channel3 293 -#define MT_Channel4 294 -#define MT_Channel5 295 -#define MT_Channel6 296 -#define MT_Channel7 297 -#define MT_Channel8 298 -#define MT_Channel9 299 -#define MT_Channel10 300 -#define MT_CritMelee 301 -#define MT_SpellCrits 302 -#define MT_TooFarAway 303 -#define MT_NPCRampage 304 -#define MT_NPCFlurry 305 -#define MT_NPCEnrage 306 -#define MT_SayEcho 307 -#define MT_TellEcho 308 -#define MT_GroupEcho 309 -#define MT_GuildEcho 310 -#define MT_OOCEcho 311 -#define MT_AuctionEcho 312 -#define MT_ShoutECho 313 -#define MT_EmoteEcho 314 -#define MT_Chat1Echo 315 -#define MT_Chat2Echo 316 -#define MT_Chat3Echo 317 -#define MT_Chat4Echo 318 -#define MT_Chat5Echo 319 -#define MT_Chat6Echo 320 -#define MT_Chat7Echo 321 -#define MT_Chat8Echo 322 -#define MT_Chat9Echo 323 -#define MT_Chat10Echo 324 -#define MT_DoTDamage 325 -#define MT_ItemLink 326 -#define MT_RaidSay 327 -#define MT_MyPet 328 -#define MT_DS 329 -#define MT_Leadership 330 -#define MT_PetFlurry 331 -#define MT_PetCrit 332 -#define MT_FocusEffect 333 -#define MT_Experience 334 -#define MT_System 335 -#define MT_PetSpell 336 -#define MT_PetResponse 337 -#define MT_ItemSpeech 338 -#define MT_StrikeThrough 339 -#define MT_Stun 340 +namespace Chat { + const uint16 White = 0; + const uint16 DimGray = 1; + const uint16 Default = 1; + const uint16 Green = 2; + const uint16 BrightBlue = 3; + const uint16 LightBlue = 4; + const uint16 Magenta = 5; + const uint16 Gray = 6; + const uint16 LightGray = 7; + const uint16 NPCQuestSay = 10; + const uint16 DarkGray = 12; + const uint16 Red = 13; + const uint16 Lime = 14; + const uint16 Yellow = 15; + const uint16 Blue = 16; + const uint16 LightNavy = 17; + const uint16 Cyan = 18; + const uint16 Black = 20; -// TODO: Really should combine above and below into one - -//from showeq -enum ChatColor -{ - /* - CC_Default = 0, - CC_DarkGrey = 1, - CC_DarkGreen = 2, - CC_DarkBlue = 3, - CC_Purple = 5, - CC_LightGrey = 6, - */ - - CC_WhiteSmoke = 0, // FF|F0F0F0 - CC_Green = 2, // FF|008000 - CC_BrightBlue = 3, // FF|0040FF - CC_Magenta = 5, // FF|F000F0 - CC_Gray = 6, // FF|808080 - CC_LightGray = 7, // FF|E0E0E0 - //CC_WhiteSmoke2 = 10, // FF|F0F0F0 - CC_DarkGray = 12, // FF|A0A0A0 - CC_Red = 13, // FF|F00000 - CC_Lime = 14, // FF|00F000 - CC_Yellow = 15, // FF|F0F000 - CC_Blue = 16, // FF|0000F0 - CC_LightNavy = 17, // FF|0000AF - CC_Cyan = 18, // FF|00F0F0 - CC_Black = 20, // FF|000000 - - // any index <= 255 that is not defined above - CC_DimGray = 1, // FF|606060 - CC_Default = 1, - - CC_User_Say = 256, - CC_User_Tell = 257, - CC_User_Group = 258, - CC_User_Guild = 259, - CC_User_OOC = 260, - CC_User_Auction = 261, - CC_User_Shout = 262, - CC_User_Emote = 263, - CC_User_Spells = 264, - CC_User_YouHitOther = 265, - CC_User_OtherHitYou = 266, - CC_User_YouMissOther = 267, - CC_User_OtherMissYou = 268, - CC_User_Duels = 269, - CC_User_Skills = 270, - CC_User_Disciplines = 271, - CC_User_Default = 273, - CC_User_MerchantOffer = 275, - CC_User_MerchantExchange = 276, - CC_User_YourDeath = 277, - CC_User_OtherDeath = 278, - CC_User_OtherHitOther = 279, - CC_User_OtherMissOther = 280, - CC_User_Who = 281, - CC_User_Yell = 282, - CC_User_NonMelee = 283, - CC_User_SpellWornOff = 284, - CC_User_MoneySplit = 285, - CC_User_Loot = 286, - CC_User_Random = 287, - CC_User_OtherSpells = 288, - CC_User_SpellFailure = 289, - CC_User_ChatChannel = 290, - CC_User_Chat1 = 291, - CC_User_Chat2 = 292, - CC_User_Chat3 = 293, - CC_User_Chat4 = 294, - CC_User_Chat5 = 295, - CC_User_Chat6 = 296, - CC_User_Chat7 = 297, - CC_User_Chat8 = 298, - CC_User_Chat9 = 299, - CC_User_Chat10 = 300, - CC_User_MeleeCrit = 301, - CC_User_SpellCrit = 302, - CC_User_TooFarAway = 303, - CC_User_NPCRampage = 304, - CC_User_NPCFurry = 305, - CC_User_NPCEnrage = 306, - CC_User_EchoSay = 307, - CC_User_EchoTell = 308, - CC_User_EchoGroup = 309, - CC_User_EchoGuild = 310, - CC_User_EchoOOC = 311, - CC_User_EchoAuction = 312, - CC_User_EchoShout = 313, - CC_User_EchoEmote = 314, - CC_User_EchoChat1 = 315, - CC_User_EchoChat2 = 316, - CC_User_EchoChat3 = 317, - CC_User_EchoChat4 = 318, - CC_User_EchoChat5 = 319, - CC_User_EchoChat6 = 320, - CC_User_EchoChat7 = 321, - CC_User_EchoChat8 = 322, - CC_User_EchoChat9 = 323, - CC_User_EchoChat10 = 324, - CC_User_UnusedAtThisTime = 325, - CC_User_ItemTags = 326, - CC_User_RaidSay = 327, - CC_User_MyPet = 328, - CC_User_DamageShield = 329, + /** + * User colors + */ + const uint16 Say = 256; + const uint16 Tell = 257; + const uint16 Group = 258; + const uint16 Guild = 259; + const uint16 OOC = 260; + const uint16 Auction = 261; + const uint16 Shout = 262; + const uint16 Emote = 263; + const uint16 Spells = 264; + const uint16 YouHitOther = 265; + const uint16 OtherHitYou = 266; + const uint16 YouMissOther = 267; + const uint16 OtherMissYou = 268; + const uint16 Broadcasts = 269; + const uint16 Skills = 270; + const uint16 Disciplines = 271; + const uint16 Unused1 = 272; + const uint16 DefaultText = 273; + const uint16 Unused2 = 274; + const uint16 MerchantOffer = 275; + const uint16 MerchantExchange = 276; + const uint16 YourDeath = 277; + const uint16 OtherDeath = 278; + const uint16 OtherHitOther = 279; + const uint16 OtherMissOther = 280; + const uint16 Who = 281; + const uint16 YellForHelp = 282; + const uint16 NonMelee = 283; + const uint16 SpellWornOff = 284; + const uint16 MoneySplit = 285; + const uint16 Loot = 286; + const uint16 DiceRoll = 287; + const uint16 OtherSpells = 288; + const uint16 SpellFailure = 289; + const uint16 ChatChannel = 290; + const uint16 Chat1 = 291; + const uint16 Chat2 = 292; + const uint16 Chat3 = 293; + const uint16 Chat4 = 294; + const uint16 Chat5 = 295; + const uint16 Chat6 = 296; + const uint16 Chat7 = 297; + const uint16 Chat8 = 298; + const uint16 Chat9 = 299; + const uint16 Chat10 = 300; + const uint16 MeleeCrit = 301; + const uint16 SpellCrit = 302; + const uint16 TooFarAway = 303; + const uint16 NPCRampage = 304; + const uint16 NPCFlurry = 305; + const uint16 NPCEnrage = 306; + const uint16 EchoSay = 307; + const uint16 EchoTell = 308; + const uint16 EchoGroup = 309; + const uint16 EchoGuild = 310; + const uint16 EchoOOC = 311; + const uint16 EchoAuction = 312; + const uint16 EchoShout = 313; + const uint16 EchoEmote = 314; + const uint16 EchoChat1 = 315; + const uint16 EchoChat2 = 316; + const uint16 EchoChat3 = 317; + const uint16 EchoChat4 = 318; + const uint16 EchoChat5 = 319; + const uint16 EchoChat6 = 320; + const uint16 EchoChat7 = 321; + const uint16 EchoChat8 = 322; + const uint16 EchoChat9 = 323; + const uint16 EchoChat10 = 324; + const uint16 DotDamage = 325; + const uint16 ItemLink = 326; + const uint16 RaidSay = 327; + const uint16 MyPet = 328; + const uint16 DamageShield = 329; + const uint16 LeaderShip = 330; + const uint16 PetFlurry = 331; + const uint16 PetCritical = 332; + const uint16 FocusEffect = 333; + const uint16 Experience = 334; + const uint16 System = 335; + const uint16 PetSpell = 336; + const uint16 PetResponse = 337; + const uint16 ItemSpeech = 338; + const uint16 StrikeThrough = 339; + const uint16 Stun = 340; }; //ZoneChange_Struct->success values diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index d614415ea..f84e0839c 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -81,14 +81,6 @@ namespace Console { }; } -enum GameChatColor { - yellow = 15, - red = 13, - light_green = 14, - light_cyan = 258, - light_purple = 5 -}; - /** * EQEmuLogSys Constructor */ @@ -306,22 +298,22 @@ uint16 EQEmuLogSys::GetGMSayColorFromCategory(uint16 log_category) switch (log_category) { case Logs::Status: case Logs::Normal: - return GameChatColor::yellow; + return Chat::Yellow; case Logs::MySQLError: case Logs::Error: - return GameChatColor::red; + return Chat::Red; case Logs::MySQLQuery: case Logs::Debug: - return GameChatColor::light_green; + return Chat::Lime; case Logs::Quests: - return GameChatColor::light_cyan; + return Chat::Group; case Logs::Commands: case Logs::Mercenaries: - return GameChatColor::light_purple; + return Chat::Magenta; case Logs::Crash: - return GameChatColor::red; + return Chat::Red; default: - return GameChatColor::yellow; + return Chat::Yellow; } } diff --git a/common/string_util.cpp b/common/string_util.cpp index 508304ce1..b12811159 100644 --- a/common/string_util.cpp +++ b/common/string_util.cpp @@ -123,6 +123,17 @@ std::vector SplitString(const std::string &str, char delim) { return ret; } +static std::string implode(char *sep, std::vector src) +{ + std::ostringstream output; + std::vector::iterator src_iter; + + for (src_iter = src.begin(); src_iter != src.end(); src_iter++) + output << *src_iter << sep; + + return output.str(); +} + std::string EscapeString(const std::string &s) { std::string ret; diff --git a/common/string_util.h b/common/string_util.h index 03848813c..cf1dbc761 100644 --- a/common/string_util.h +++ b/common/string_util.h @@ -30,6 +30,7 @@ const std::string ucfirst(std::string s); std::vector split(std::string str_to_split, char delimiter); const std::string StringFormat(const char* format, ...); const std::string vStringFormat(const char* format, va_list args); +static std::string implode(char *sep, std::vector src); std::vector SplitString(const std::string &s, char delim); std::string EscapeString(const char *src, size_t sz); std::string EscapeString(const std::string &s); diff --git a/world/adventure.cpp b/world/adventure.cpp index af3cfe0e2..3b784cd6e 100644 --- a/world/adventure.cpp +++ b/world/adventure.cpp @@ -122,7 +122,7 @@ bool Adventure::Process() else if(status == AS_WaitingForPrimaryEndTime) { //Do partial failure: send a message to the clients that they can only get a certain amount of points. - SendAdventureMessage(13, "You failed to complete your adventure in time. Complete your adventure goal within 30 minutes to " + SendAdventureMessage(Chat::Red, "You failed to complete your adventure in time. Complete your adventure goal within 30 minutes to " "receive a lesser reward. This adventure will end in 30 minutes and your party will be ejected from the dungeon."); SetStatus(AS_WaitingForSecondaryEndTime); } diff --git a/world/net.cpp b/world/net.cpp index ce5900d30..8278f9437 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -123,7 +123,7 @@ int main(int argc, char** argv) { if (!std::ifstream("eqemu_config.json")) { CheckForServerScript(true); /* Run EQEmu Server script (Checks for database updates) */ - system("perl eqemu_server.pl convert_xml"); + if(system("perl eqemu_server.pl convert_xml")); } else { /* Download EQEmu Server Maintenance Script if doesn't exist */ @@ -627,9 +627,9 @@ void CheckForServerScript(bool force_download) { std::cout << "Pulling down EQEmu Server Maintenance Script (eqemu_server.pl)..." << std::endl; #ifdef _WIN32 - system("perl -MLWP::UserAgent -e \"require LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->env_proxy; my $response = $ua->get('https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/eqemu_server.pl'); if ($response->is_success){ open(FILE, '> eqemu_server.pl'); print FILE $response->decoded_content; close(FILE); }\""); + if(system("perl -MLWP::UserAgent -e \"require LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->env_proxy; my $response = $ua->get('https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/eqemu_server.pl'); if ($response->is_success){ open(FILE, '> eqemu_server.pl'); print FILE $response->decoded_content; close(FILE); }\"")); #else - system("wget -N --no-check-certificate --quiet -O eqemu_server.pl https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/eqemu_server.pl"); + if(system("wget -N --no-check-certificate --quiet -O eqemu_server.pl https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/eqemu_server.pl")); #endif } } diff --git a/zone/aa.cpp b/zone/aa.cpp index 4d9854d86..5696bd445 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -58,7 +58,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u if (!database.GetPoweredPetEntry(spells[spell_id].teleport_zone, act_power, &record)) { Log(Logs::General, Logs::Error, "Unknown swarm pet spell id: %d, check pets table", spell_id); - Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone); + Message(Chat::Red, "Unable to find data for pet %s", spells[spell_id].teleport_zone); return; } @@ -1091,7 +1091,7 @@ void Client::FinishAlternateAdvancementPurchase(AA::Rank *rank, bool ignore_cost SendAlternateAdvancementStats(); if(rank->prev) { - Message_StringID(15, AA_IMPROVE, + Message_StringID(Chat::Yellow, AA_IMPROVE, std::to_string(rank->title_sid).c_str(), std::to_string(rank->prev->current_value).c_str(), std::to_string(cost).c_str(), @@ -1104,7 +1104,7 @@ void Client::FinishAlternateAdvancementPurchase(AA::Rank *rank, bool ignore_cost } } else { - Message_StringID(15, AA_GAIN_ABILITY, + Message_StringID(Chat::Yellow, AA_GAIN_ABILITY, std::to_string(rank->title_sid).c_str(), std::to_string(cost).c_str(), cost == 1 ? std::to_string(AA_POINT).c_str() : std::to_string(AA_POINTS).c_str()); @@ -1179,11 +1179,11 @@ void Client::ActivateAlternateAdvancementAbility(int rank_id, int target_id) { uint32 aaremain_sec = aaremain % 60; if(aaremain_hr >= 1) { - Message(13, "You can use this ability again in %u hour(s) %u minute(s) %u seconds", + Message(Chat::Red, "You can use this ability again in %u hour(s) %u minute(s) %u seconds", aaremain_hr, aaremain_min, aaremain_sec); } else { - Message(13, "You can use this ability again in %u minute(s) %u seconds", + Message(Chat::Red, "You can use this ability again in %u minute(s) %u seconds", aaremain_min, aaremain_sec); } @@ -1200,7 +1200,7 @@ void Client::ActivateAlternateAdvancementAbility(int rank_id, int target_id) { CommonBreakInvisible(); if (spells[rank->spell].sneak && (!hidden || (hidden && (Timer::GetCurrentTime() - tmHidden) < 4000))) { - Message_StringID(MT_SpellFailure, SNEAK_RESTRICT); + Message_StringID(Chat::SpellFailure, SNEAK_RESTRICT); return; } // @@ -1214,7 +1214,7 @@ void Client::ActivateAlternateAdvancementAbility(int rank_id, int target_id) { SetAppearance(eaStanding, false); if (GetAppearance() != eaStanding) { - Message_StringID(MT_SpellFailure, STAND_TO_CAST); + Message_StringID(Chat::SpellFailure, STAND_TO_CAST); return; } } diff --git a/zone/attack.cpp b/zone/attack.cpp index a51cd3163..d555e4458 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1319,7 +1319,7 @@ void Mob::DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts) if (other->AvoidDamage(this, hit)) { int strike_through = itembonuses.StrikeThrough + spellbonuses.StrikeThrough + aabonuses.StrikeThrough; if (strike_through && zone->random.Roll(strike_through)) { - Message_StringID(MT_StrikeThrough, + Message_StringID(Chat::StrikeThrough, STRIKETHROUGH_STRING); // You strike through your opponents defenses! hit.damage_done = 1; // set to one, we will check this to continue } @@ -1340,9 +1340,9 @@ void Mob::DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts) int stun_resist2 = other->spellbonuses.FrontalStunResist + other->itembonuses.FrontalStunResist + other->aabonuses.FrontalStunResist; int stun_resist = other->spellbonuses.StunResist + other->itembonuses.StunResist + other->aabonuses.StunResist; if (zone->random.Roll(stun_resist2)) { - other->Message_StringID(MT_Stun, AVOID_STUNNING_BLOW); + other->Message_StringID(Chat::Stun, AVOID_STUNNING_BLOW); } else if (zone->random.Roll(stun_resist)) { - other->Message_StringID(MT_Stun, SHAKE_OFF_STUN); + other->Message_StringID(Chat::Stun, SHAKE_OFF_STUN); } else { other->Stun(3000); // yuck -- 3 seconds } @@ -1392,7 +1392,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if (DivineAura() && !GetGM()) {//cant attack while invulnerable unless your a gm Log(Logs::Detail, Logs::Combat, "Attack canceled, Divine Aura is in effect."); - Message_StringID(MT_DefaultText, DIVINE_AURA_NO_ATK); //You can't attack while invulnerable! + Message_StringID(Chat::DefaultText, DIVINE_AURA_NO_ATK); //You can't attack while invulnerable! return false; } @@ -1619,7 +1619,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, EQEmu::skills::Sk this, /* Sender */ false, /* Skip Sender */ RuleI(Range, DamageMessages), - MT_NonMelee, /* 283 */ + Chat::NonMelee, /* 283 */ HIT_NON_MELEE, /* %1 hit %2 for %3 points of non-melee damage. */ killerMob->GetCleanName(), /* Message1 */ GetCleanName(), /* Message2 */ @@ -2129,7 +2129,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, EQEmu::skills::Skill { if (IsLDoNTrapped()) { - Message_StringID(13, LDON_ACCIDENT_SETOFF2); + Message_StringID(Chat::Red, LDON_ACCIDENT_SETOFF2); SpellFinished(GetLDoNTrapSpellID(), other, EQEmu::spells::CastingSlot::Item, 0, -1, spells[GetLDoNTrapSpellID()].ResistDiff, false); SetLDoNTrapSpellID(0); SetLDoNTrapped(false); @@ -2173,7 +2173,7 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQEmu::skills::Skil this, /* Sender */ false, /* Skip Sender */ RuleI(Range, DamageMessages), - MT_NonMelee, /* 283 */ + Chat::NonMelee, /* 283 */ HIT_NON_MELEE, /* %1 hit %2 for %3 points of non-melee damage. */ killer_mob->GetCleanName(), /* Message1 */ GetCleanName(), /* Message2 */ @@ -3425,7 +3425,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const //we used to do a message to the client, but its gone now. // emote goes with every one ... even npcs - entity_list.MessageClose(this, true, RuleI(Range, SpellMessages), MT_Emote, "%s beams a smile at %s", attacker->GetCleanName(), this->GetCleanName()); + entity_list.MessageClose(this, true, RuleI(Range, SpellMessages), Chat::Emote, "%s beams a smile at %s", attacker->GetCleanName(), this->GetCleanName()); } } //end `if there is some damage being done and theres anattacker person involved` @@ -3439,7 +3439,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const Log(Logs::Detail, Logs::Aggro, "Sending pet %s into battle due to attack.", pet->GetName()); pet->AddToHateList(attacker, 1, 0, true, false, false, spell_id); pet->SetTarget(attacker); - Message_StringID(10, PET_ATTACKING, pet->GetCleanName(), attacker->GetCleanName()); + Message_StringID(Chat::NPCQuestSay, PET_ATTACKING, pet->GetCleanName(), attacker->GetCleanName()); } } @@ -3459,7 +3459,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const damage = AffectMagicalDamage(damage, spell_id, iBuffTic, attacker); if (origdmg != damage && attacker && attacker->IsClient()) { if (attacker->CastToClient()->GetFilter(FilterDamageShields) != FilterHide) - attacker->Message(15, "The Spellshield absorbed %d of %d points of damage", origdmg - damage, origdmg); + attacker->Message(Chat::Yellow, "The Spellshield absorbed %d of %d points of damage", origdmg - damage, origdmg); } if (damage == 0 && attacker && origdmg != damage && IsClient()) { //Kayen: Probably need to add a filter for this - Not sure if this msg is correct but there should be a message for spell negate/runes. @@ -3511,7 +3511,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const this, /* Sender */ true, /* Skip Sender */ RuleI(Range, SpellMessages), - MT_WornOff, /* 284 */ + Chat::SpellWornOff, /* 284 */ HAS_BEEN_AWAKENED, // %1 has been awakened by %2. GetCleanName(), /* Message1 */ attacker->GetCleanName() /* Message2 */ @@ -3564,13 +3564,13 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const else { // stun resist passed! if (IsClient()) - Message_StringID(MT_Stun, SHAKE_OFF_STUN); + Message_StringID(Chat::Stun, SHAKE_OFF_STUN); } } else { // stun resist 2 passed! if (IsClient()) - Message_StringID(MT_Stun, AVOID_STUNNING_BLOW); + Message_StringID(Chat::Stun, AVOID_STUNNING_BLOW); } } else { @@ -3650,7 +3650,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const if (((spell_id != SPELL_UNKNOWN) || (FromDamageShield)) && damage>0) { //special crap for spell damage, looks hackish to me char val1[20] = { 0 }; - owner->Message_StringID(MT_NonMelee, OTHER_HIT_NONMELEE, GetCleanName(), ConvertArray(damage, val1)); + owner->Message_StringID(Chat::NonMelee, OTHER_HIT_NONMELEE, GetCleanName(), ConvertArray(damage, val1)); } else { if (damage > 0) { @@ -3680,14 +3680,14 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const char val1[20] = { 0 }; if (FromDamageShield) { if (attacker->CastToClient()->GetFilter(FilterDamageShields) != FilterHide) - attacker->Message_StringID(MT_DS, OTHER_HIT_NONMELEE, GetCleanName(), ConvertArray(damage, val1)); + attacker->Message_StringID(Chat::DamageShield, OTHER_HIT_NONMELEE, GetCleanName(), ConvertArray(damage, val1)); } else { entity_list.MessageClose_StringID( this, /* Sender */ true, /* Skip Sender */ RuleI(Range, SpellMessages), - MT_NonMelee, /* 283 */ + Chat::NonMelee, /* 283 */ HIT_NON_MELEE, /* %1 hit %2 for %3 points of non-melee damage. */ attacker->GetCleanName(), /* Message1 */ GetCleanName(), /* Message2 */ @@ -3754,7 +3754,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const // So we can see our dot dmg like live shows it. if (spell_id != SPELL_UNKNOWN && damage > 0 && attacker && attacker != this && attacker->IsClient()) { //might filter on (attack_skill>200 && attack_skill<250), but I dont think we need it - attacker->FilteredMessage_StringID(attacker, MT_DoTDamage, FilterDOT, + attacker->FilteredMessage_StringID(attacker, Chat::DotDamage, FilterDOT, YOUR_HIT_DOT, GetCleanName(), itoa(damage), spells[spell_id].name); /* older clients don't have the below String ID, but it will be filtered */ @@ -3762,14 +3762,14 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const attacker, /* Sender */ true, /* Skip Sender */ RuleI(Range, SpellMessages), - MT_DoTDamage, /* Type: 325 */ + Chat::DotDamage, /* Type: 325 */ FilterDOT, /* FilterType: 19 */ OTHER_HIT_DOT, /* MessageFormat: %1 has taken %2 damage from %3 by %4. */ GetCleanName(), /* Message1 */ itoa(damage), /* Message2 */ attacker->GetCleanName(), /* Message3 */ spells[spell_id].name /* Message4 */ - ); + ); } } //end packet sending @@ -3792,42 +3792,42 @@ void Mob::HealDamage(uint32 amount, Mob *caster, uint16 spell_id) // message to caster if (caster->IsClient() && caster == this) { if (caster->CastToClient()->ClientVersionBit() & EQEmu::versions::maskSoFAndLater) - FilteredMessage_StringID(caster, MT_NonMelee, FilterHealOverTime, + FilteredMessage_StringID(caster, Chat::NonMelee, FilterHealOverTime, HOT_HEAL_SELF, itoa(acthealed), spells[spell_id].name); else - FilteredMessage_StringID(caster, MT_NonMelee, FilterHealOverTime, + FilteredMessage_StringID(caster, Chat::NonMelee, FilterHealOverTime, YOU_HEALED, GetCleanName(), itoa(acthealed)); } else if (caster->IsClient() && caster != this) { if (caster->CastToClient()->ClientVersionBit() & EQEmu::versions::maskSoFAndLater) - caster->FilteredMessage_StringID(caster, MT_NonMelee, FilterHealOverTime, + caster->FilteredMessage_StringID(caster, Chat::NonMelee, FilterHealOverTime, HOT_HEAL_OTHER, GetCleanName(), itoa(acthealed), spells[spell_id].name); else - caster->FilteredMessage_StringID(caster, MT_NonMelee, FilterHealOverTime, + caster->FilteredMessage_StringID(caster, Chat::NonMelee, FilterHealOverTime, YOU_HEAL, GetCleanName(), itoa(acthealed)); } // message to target if (IsClient() && caster != this) { if (CastToClient()->ClientVersionBit() & EQEmu::versions::maskSoFAndLater) - FilteredMessage_StringID(this, MT_NonMelee, FilterHealOverTime, + FilteredMessage_StringID(this, Chat::NonMelee, FilterHealOverTime, HOT_HEALED_OTHER, caster->GetCleanName(), itoa(acthealed), spells[spell_id].name); else - FilteredMessage_StringID(this, MT_NonMelee, FilterHealOverTime, + FilteredMessage_StringID(this, Chat::NonMelee, FilterHealOverTime, YOU_HEALED, caster->GetCleanName(), itoa(acthealed)); } } else { // normal heals - FilteredMessage_StringID(caster, MT_NonMelee, FilterSpellDamage, + FilteredMessage_StringID(caster, Chat::NonMelee, FilterSpellDamage, YOU_HEALED, caster->GetCleanName(), itoa(acthealed)); if (caster != this) - caster->FilteredMessage_StringID(caster, MT_NonMelee, FilterSpellDamage, + caster->FilteredMessage_StringID(caster, Chat::NonMelee, FilterSpellDamage, YOU_HEAL, GetCleanName(), itoa(acthealed)); } } else { - Message(MT_NonMelee, "You have been healed for %d points of damage.", acthealed); + Message(Chat::NonMelee, "You have been healed for %d points of damage.", acthealed); } } @@ -3993,10 +3993,10 @@ void Mob::TryWeaponProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData * if (IsPet()) { Mob *own = GetOwner(); if (own) - own->Message_StringID(13, PROC_PETTOOLOW); + own->Message_StringID(Chat::Red, PROC_PETTOOLOW); } else { - Message_StringID(13, PROC_TOOLOW); + Message_StringID(Chat::Red, PROC_TOOLOW); } } else { @@ -4030,10 +4030,10 @@ void Mob::TryWeaponProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData * if (IsPet()) { Mob *own = GetOwner(); if (own) - own->Message_StringID(13, PROC_PETTOOLOW); + own->Message_StringID(Chat::Red, PROC_PETTOOLOW); } else { - Message_StringID(13, PROC_TOOLOW); + Message_StringID(Chat::Red, PROC_TOOLOW); } } else { @@ -4187,7 +4187,7 @@ void Mob::TryPetCriticalHit(Mob *defender, DamageHitInfo &hit) this, /* Sender */ false, /* Skip Sender */ RuleI(Range, CriticalDamage), - MT_CritMelee, /* Type: 301 */ + Chat::MeleeCrit, /* Type: 301 */ FilterMeleeCrits, /* FilterType: 12 */ CRITICAL_HIT, /* MessageFormat: %1 scores a critical hit! (%2) */ GetCleanName(), /* Message1 */ @@ -4247,7 +4247,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions * this, /* Sender */ false, /* Skip Sender */ RuleI(Range, CriticalDamage), - MT_CritMelee, /* Type: 301 */ + Chat::MeleeCrit, /* Type: 301 */ FilterMeleeCrits, /* FilterType: 12 */ FEMALE_SLAYUNDEAD, /* MessageFormat: %1's holy blade cleanses her target!(%2) */ GetCleanName(), /* Message1 */ @@ -4260,7 +4260,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions * this, /* Sender */ false, /* Skip Sender */ RuleI(Range, CriticalDamage), - MT_CritMelee, /* Type: 301 */ + Chat::MeleeCrit, /* Type: 301 */ FilterMeleeCrits, /* FilterType: 12 */ MALE_SLAYUNDEAD, /* MessageFormat: %1's holy blade cleanses his target!(%2) */ GetCleanName(), /* Message1 */ @@ -4344,7 +4344,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions * this, /* Sender */ false, /* Skip Sender */ RuleI(Range, CriticalDamage), - MT_CritMelee, /* Type: 301 */ + Chat::MeleeCrit, /* Type: 301 */ FilterMeleeCrits, /* FilterType: 12 */ DEADLY_STRIKE, /* MessageFormat: %1 scores a Deadly Strike!(%2) */ GetCleanName(), /* Message1 */ @@ -4372,7 +4372,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions * this, /* Sender */ false, /* Skip Sender */ RuleI(Range, CriticalDamage), - MT_CritMelee, /* Type: 301 */ + Chat::MeleeCrit, /* Type: 301 */ FilterMeleeCrits, /* FilterType: 12 */ CRIPPLING_BLOW, /* MessageFormat: %1 lands a Crippling Blow!(%2) */ GetCleanName(), /* Message1 */ @@ -4394,7 +4394,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions * this, /* Sender */ false, /* Skip Sender */ RuleI(Range, CriticalDamage), - MT_CritMelee, /* Type: 301 */ + Chat::MeleeCrit, /* Type: 301 */ FilterMeleeCrits, /* FilterType: 12 */ CRITICAL_HIT, /* MessageFormat: %1 scores a critical hit! (%2) */ GetCleanName(), /* Message1 */ @@ -4431,7 +4431,7 @@ bool Mob::TryFinishingBlow(Mob *defender, int &damage) this, /* Sender */ false, /* Skip Sender */ RuleI(Range, CriticalDamage), - MT_CritMelee, /* Type: 301 */ + Chat::MeleeCrit, /* Type: 301 */ FilterMeleeCrits, /* FilterType: 12 */ FINISHING_BLOW, /* MessageFormat: %1 scores a Finishing Blow!!) */ GetCleanName() /* Message1 */ @@ -4453,7 +4453,7 @@ void Mob::DoRiposte(Mob *defender) // so ahhh the angle you can riposte is larger than the angle you can hit :P if (!defender->IsFacingMob(this)) { - defender->Message_StringID(MT_TooFarAway, CANT_SEE_TARGET); + defender->Message_StringID(Chat::TooFarAway, CANT_SEE_TARGET); return; } @@ -5042,7 +5042,7 @@ void Mob::CommonOutgoingHitSuccess(Mob* defender, DamageHitInfo &hit, ExtraAttac else if (GetClass() == RANGER && GetLevel() > 50) { // no double dmg on headshot if ((defender->IsNPC() && !defender->IsMoving() && !defender->IsRooted()) || !RuleB(Combat, ArcheryBonusRequiresStationary)) { hit.damage_done *= 2; - Message_StringID(MT_CritMelee, BOW_DOUBLE_DAMAGE); + Message_StringID(Chat::MeleeCrit, BOW_DOUBLE_DAMAGE); } } } @@ -5347,7 +5347,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell) Attack(target, hand, false, false, IsFromSpell); if (zone->random.Roll(flurrychance)) Attack(target, hand, false, false, IsFromSpell); - Message_StringID(MT_NPCFlurry, YOU_FLURRY); + Message_StringID(Chat::NPCFlurry, YOU_FLURRY); } } } diff --git a/zone/aura.cpp b/zone/aura.cpp index d4aee01cb..223b5dcb4 100644 --- a/zone/aura.cpp +++ b/zone/aura.cpp @@ -710,13 +710,13 @@ void Mob::MakeAura(uint16 spell_id) AuraRecord record; if (!database.GetAuraEntry(spell_id, record)) { - Message(13, "Unable to find data for aura %s", spells[spell_id].name); + Message(Chat::Red, "Unable to find data for aura %s", spells[spell_id].name); Log(Logs::General, Logs::Error, "Unable to find data for aura %d, check auras table.", spell_id); return; } if (!IsValidSpell(record.spell_id)) { - Message(13, "Casted spell (%d) is not valid for aura %s", record.spell_id, spells[spell_id].name); + Message(Chat::Red, "Casted spell (%d) is not valid for aura %s", record.spell_id, spells[spell_id].name); Log(Logs::General, Logs::Error, "Casted spell (%d) is not valid for aura %d, check auras table.", record.spell_id, spell_id); return; @@ -744,7 +744,7 @@ void Mob::MakeAura(uint16 spell_id) const auto base = database.LoadNPCTypesData(record.npc_type); if (base == nullptr) { - Message(13, "Unable to load NPC data for aura %s", spells[spell_id].teleport_zone); + Message(Chat::Red, "Unable to load NPC data for aura %s", spells[spell_id].teleport_zone); Log(Logs::General, Logs::Error, "Unable to load NPC data for aura %s (NPC ID %d), check auras and npc_types tables.", spells[spell_id].teleport_zone, record.npc_type); @@ -841,10 +841,10 @@ void Mob::AddTrap(Aura *aura, AuraRecord &record) bool Mob::CanSpawnAura(bool trap) { if (trap && !HasFreeTrapSlots()) { - Message_StringID(MT_SpellFailure, NO_MORE_TRAPS); + Message_StringID(Chat::SpellFailure, NO_MORE_TRAPS); return false; } else if (!trap && !HasFreeAuraSlots()) { - Message_StringID(MT_SpellFailure, NO_MORE_AURAS); + Message_StringID(Chat::SpellFailure, NO_MORE_AURAS); return false; } @@ -878,8 +878,6 @@ void Mob::RemoveAllAuras() } trap_mgr.count = 0; - - return; } void Mob::RemoveAura(int spawn_id, bool skip_strip, bool expired) @@ -891,7 +889,7 @@ void Mob::RemoveAura(int spawn_id, bool skip_strip, bool expired) aura.aura->Depop(skip_strip); if (expired && IsClient()) { CastToClient()->SendColoredText( - CC_Yellow, StringFormat("%s has expired.", aura.name)); // TODO: verify color + Chat::Yellow, StringFormat("%s has expired.", aura.name)); // TODO: verify color // need to update client UI too auto app = new EQApplicationPacket(OP_UpdateAura, sizeof(AuraDestory_Struct)); auto ads = (AuraDestory_Struct *)app->pBuffer; @@ -920,7 +918,7 @@ void Mob::RemoveAura(int spawn_id, bool skip_strip, bool expired) aura.aura->Depop(skip_strip); if (expired && IsClient()) CastToClient()->SendColoredText( - CC_Yellow, StringFormat("%s has expired.", aura.name)); // TODO: verify color + Chat::Yellow, StringFormat("%s has expired.", aura.name)); // TODO: verify color while (trap_mgr.count - 1 > i) { i++; aura.spawn_id = trap_mgr.auras[i].spawn_id; diff --git a/zone/bot.cpp b/zone/bot.cpp index b47694103..7265492aa 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -159,9 +159,9 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to bool stance_flag = false; if (!database.botdb.LoadStance(this, stance_flag) && bot_owner) - bot_owner->Message(13, "%s for '%s'", BotDatabase::fail::LoadStance(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadStance(), GetCleanName()); if (!stance_flag && bot_owner) - bot_owner->Message(13, "Could not locate stance for '%s'", GetCleanName()); + bot_owner->Message(Chat::Red, "Could not locate stance for '%s'", GetCleanName()); SetTaunting((GetClass() == WARRIOR || GetClass() == PALADIN || GetClass() == SHADOWKNIGHT) && (GetBotStance() == EQEmu::constants::stanceAggressive)); SetPauseAI(false); @@ -178,17 +178,17 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to memset(&_botInspectMessage, 0, sizeof(InspectMessage_Struct)); if (!database.botdb.LoadInspectMessage(GetBotID(), _botInspectMessage) && bot_owner) - bot_owner->Message(13, "%s for '%s'", BotDatabase::fail::LoadInspectMessage(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadInspectMessage(), GetCleanName()); if (!database.botdb.LoadGuildMembership(GetBotID(), _guildId, _guildRank, _guildName) && bot_owner) - bot_owner->Message(13, "%s for '%s'", BotDatabase::fail::LoadGuildMembership(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadGuildMembership(), GetCleanName()); std::string error_message; EquipBot(&error_message); if(!error_message.empty()) { if(bot_owner) - bot_owner->Message(13, error_message.c_str()); + bot_owner->Message(Chat::Red, error_message.c_str()); error_message.clear(); } @@ -206,12 +206,12 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to GenerateBaseStats(); if (!database.botdb.LoadTimers(this) && bot_owner) - bot_owner->Message(13, "%s for '%s'", BotDatabase::fail::LoadTimers(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadTimers(), GetCleanName()); LoadAAs(); if (!database.botdb.LoadBuffs(this) && bot_owner) - bot_owner->Message(13, "&s for '%s'", BotDatabase::fail::LoadBuffs(), GetCleanName()); + bot_owner->Message(Chat::Red, "&s for '%s'", BotDatabase::fail::LoadBuffs(), GetCleanName()); CalcBotStats(false); hp_regen = CalcHPRegen(); @@ -1701,28 +1701,28 @@ bool Bot::Save() if(!GetBotID()) { // New bot record uint32 bot_id = 0; if (!database.botdb.SaveNewBot(this, bot_id) || !bot_id) { - bot_owner->Message(13, "%s '%s'", BotDatabase::fail::SaveNewBot(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s '%s'", BotDatabase::fail::SaveNewBot(), GetCleanName()); return false; } SetBotID(bot_id); } else { // Update existing bot record if (!database.botdb.SaveBot(this)) { - bot_owner->Message(13, "%s '%s'", BotDatabase::fail::SaveBot(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s '%s'", BotDatabase::fail::SaveBot(), GetCleanName()); return false; } } // All of these continue to process if any fail if (!database.botdb.SaveBuffs(this)) - bot_owner->Message(13, "%s for '%s'", BotDatabase::fail::SaveBuffs(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::SaveBuffs(), GetCleanName()); if (!database.botdb.SaveTimers(this)) - bot_owner->Message(13, "%s for '%s'", BotDatabase::fail::SaveTimers(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::SaveTimers(), GetCleanName()); if (!database.botdb.SaveStance(this)) - bot_owner->Message(13, "%s for '%s'", BotDatabase::fail::SaveStance(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::SaveStance(), GetCleanName()); if (!SavePet()) - bot_owner->Message(13, "Failed to save pet for '%s'", GetCleanName()); + bot_owner->Message(Chat::Red, "Failed to save pet for '%s'", GetCleanName()); return true; } @@ -1734,26 +1734,26 @@ bool Bot::DeleteBot() return false; if (!database.botdb.DeleteHealRotation(GetBotID())) { - bot_owner->Message(13, "%s", BotDatabase::fail::DeleteHealRotation()); + bot_owner->Message(Chat::Red, "%s", BotDatabase::fail::DeleteHealRotation()); return false; } std::string query = StringFormat("DELETE FROM `bot_heal_rotation_members` WHERE `bot_id` = '%u'", GetBotID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - bot_owner->Message(13, "Failed to delete heal rotation member '%s'", GetCleanName()); + bot_owner->Message(Chat::Red, "Failed to delete heal rotation member '%s'", GetCleanName()); return false; } query = StringFormat("DELETE FROM `bot_heal_rotation_targets` WHERE `target_name` LIKE '%s'", GetCleanName()); results = database.QueryDatabase(query); if (!results.Success()) { - bot_owner->Message(13, "Failed to delete heal rotation target '%s'", GetCleanName()); + bot_owner->Message(Chat::Red, "Failed to delete heal rotation target '%s'", GetCleanName()); return false; } if (!DeletePet()) { - bot_owner->Message(13, "Failed to delete pet for '%s'", GetCleanName()); + bot_owner->Message(Chat::Red, "Failed to delete pet for '%s'", GetCleanName()); return false; } @@ -1763,32 +1763,32 @@ bool Bot::DeleteBot() std::string error_message; if (!database.botdb.RemoveMemberFromBotGroup(GetBotID())) { - bot_owner->Message(13, "%s - '%s'", BotDatabase::fail::RemoveMemberFromBotGroup(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s - '%s'", BotDatabase::fail::RemoveMemberFromBotGroup(), GetCleanName()); return false; } if (!database.botdb.DeleteItems(GetBotID())) { - bot_owner->Message(13, "%s for '%s'", BotDatabase::fail::DeleteItems(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::DeleteItems(), GetCleanName()); return false; } if (!database.botdb.DeleteTimers(GetBotID())) { - bot_owner->Message(13, "%s for '%s'", BotDatabase::fail::DeleteTimers(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::DeleteTimers(), GetCleanName()); return false; } if (!database.botdb.DeleteBuffs(GetBotID())) { - bot_owner->Message(13, "%s for '%s'", BotDatabase::fail::DeleteBuffs(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::DeleteBuffs(), GetCleanName()); return false; } if (!database.botdb.DeleteStance(GetBotID())) { - bot_owner->Message(13, "%s for '%s'", BotDatabase::fail::DeleteStance(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::DeleteStance(), GetCleanName()); return false; } if (!database.botdb.DeleteBot(GetBotID())) { - bot_owner->Message(13, "%s '%s'", BotDatabase::fail::DeleteBot(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s '%s'", BotDatabase::fail::DeleteBot(), GetCleanName()); return false; } @@ -1832,7 +1832,7 @@ bool Bot::LoadPet() uint32 pet_index = 0; if (!database.botdb.LoadPetIndex(GetBotID(), pet_index)) { - bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::LoadPetIndex(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for %s's pet", BotDatabase::fail::LoadPetIndex(), GetCleanName()); return false; } if (!pet_index) @@ -1840,10 +1840,10 @@ bool Bot::LoadPet() uint32 saved_pet_spell_id = 0; if (!database.botdb.LoadPetSpellID(GetBotID(), saved_pet_spell_id)) { - bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::LoadPetSpellID(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for %s's pet", BotDatabase::fail::LoadPetSpellID(), GetCleanName()); } if (!IsValidSpell(saved_pet_spell_id)) { - bot_owner->Message(13, "Invalid spell id for %s's pet", GetCleanName()); + bot_owner->Message(Chat::Red, "Invalid spell id for %s's pet", GetCleanName()); DeletePet(); return false; } @@ -1854,7 +1854,7 @@ bool Bot::LoadPet() uint32 pet_spell_id = 0; if (!database.botdb.LoadPetStats(GetBotID(), pet_name, pet_mana, pet_hp, pet_spell_id)) { - bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::LoadPetStats(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for %s's pet", BotDatabase::fail::LoadPetStats(), GetCleanName()); return false; } @@ -1869,12 +1869,12 @@ bool Bot::LoadPet() SpellBuff_Struct pet_buffs[PET_BUFF_COUNT]; memset(pet_buffs, 0, (sizeof(SpellBuff_Struct) * PET_BUFF_COUNT)); if (!database.botdb.LoadPetBuffs(GetBotID(), pet_buffs)) - bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::LoadPetBuffs(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for %s's pet", BotDatabase::fail::LoadPetBuffs(), GetCleanName()); uint32 pet_items[EQEmu::invslot::EQUIPMENT_COUNT]; memset(pet_items, 0, (sizeof(uint32) * EQEmu::invslot::EQUIPMENT_COUNT)); if (!database.botdb.LoadPetItems(GetBotID(), pet_items)) - bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::LoadPetItems(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for %s's pet", BotDatabase::fail::LoadPetItems(), GetCleanName()); pet_inst->SetPetState(pet_buffs, pet_items); pet_inst->CalcBonuses(); @@ -1913,14 +1913,14 @@ bool Bot::SavePet() std::string error_message; if (!database.botdb.SavePetStats(GetBotID(), pet_name_str, pet_inst->GetMana(), pet_inst->GetHP(), pet_inst->GetPetSpellID())) { - bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::SavePetStats(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for %s's pet", BotDatabase::fail::SavePetStats(), GetCleanName()); return false; } if (!database.botdb.SavePetBuffs(GetBotID(), pet_buffs)) - bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::SavePetBuffs(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for %s's pet", BotDatabase::fail::SavePetBuffs(), GetCleanName()); if (!database.botdb.SavePetItems(GetBotID(), pet_items)) - bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::SavePetItems(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for %s's pet", BotDatabase::fail::SavePetItems(), GetCleanName()); return true; } @@ -1934,15 +1934,15 @@ bool Bot::DeletePet() std::string error_message; if (!database.botdb.DeletePetItems(GetBotID())) { - bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::DeletePetItems(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for %s's pet", BotDatabase::fail::DeletePetItems(), GetCleanName()); return false; } if (!database.botdb.DeletePetBuffs(GetBotID())) { - bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::DeletePetBuffs(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for %s's pet", BotDatabase::fail::DeletePetBuffs(), GetCleanName()); return false; } if (!database.botdb.DeletePetStats(GetBotID())) { - bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::DeletePetStats(), GetCleanName()); + bot_owner->Message(Chat::Red, "%s for %s's pet", BotDatabase::fail::DeletePetStats(), GetCleanName()); return false; } @@ -2808,7 +2808,7 @@ void Bot::AI_Process() { int32 flurrychance = (aabonuses.FlurryChance + spellbonuses.FlurryChance + itembonuses.FlurryChance); if (flurrychance) { if (zone->random.Int(0, 100) < flurrychance) { - Message_StringID(MT_NPCFlurry, YOU_FLURRY); + Message_StringID(Chat::NPCFlurry, YOU_FLURRY); Attack(tar, EQEmu::invslot::slotPrimary, false); TEST_TARGET(); @@ -3258,7 +3258,7 @@ bool Bot::Spawn(Client* botCharacterOwner) { if(this->Save()) this->GetBotOwner()->CastToClient()->Message(0, "%s saved.", this->GetCleanName()); else - this->GetBotOwner()->CastToClient()->Message(13, "%s save failed!", this->GetCleanName()); + this->GetBotOwner()->CastToClient()->Message(Chat::Red, "%s save failed!", this->GetCleanName()); // Spawn the bot at the bow owner's loc this->m_Position.x = botCharacterOwner->GetX(); @@ -3331,7 +3331,7 @@ uint32 Bot::GetBotItemBySlot(uint32 slotID) if (!database.botdb.LoadItemBySlot(GetBotID(), slotID, item_id)) { if (GetBotOwner() && GetBotOwner()->IsClient()) - GetBotOwner()->CastToClient()->Message(13, "%s", BotDatabase::fail::LoadItemBySlot()); + GetBotOwner()->CastToClient()->Message(Chat::Red, "%s", BotDatabase::fail::LoadItemBySlot()); } return item_id; @@ -3434,7 +3434,7 @@ void Bot::LoadAndSpawnAllZonedBots(Client* botOwner) { std::list ActiveBots; // Modified LoadGroupedBotsByGroupID to require a CharacterID if (!database.botdb.LoadGroupedBotsByGroupID(botOwner->CharacterID(), TempGroupId, ActiveBots)) { - botOwner->Message(13, "%s", BotDatabase::fail::LoadGroupedBotsByGroupID()); + botOwner->Message(Chat::Red, "%s", BotDatabase::fail::LoadGroupedBotsByGroupID()); return; } @@ -4165,17 +4165,17 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli // trade messages for (const auto& return_iterator : client_return) { if (return_iterator.failedItemName.size()) - client->Message(MT_Tell, "%s tells you, \"%s, I can't use this '%s.'\"", GetCleanName(), client->GetName(), return_iterator.failedItemName.c_str()); + client->Message(Chat::Tell, "%s tells you, \"%s, I can't use this '%s.'\"", GetCleanName(), client->GetName(), return_iterator.failedItemName.c_str()); } for (const auto& trade_iterator : client_trade) { if (trade_iterator.acceptedItemName.size()) - client->Message(MT_Tell, "%s tells you, \"Thank you for the '%s,' %s!\"", GetCleanName(), trade_iterator.acceptedItemName.c_str(), client->GetName()); + client->Message(Chat::Tell, "%s tells you, \"Thank you for the '%s,' %s!\"", GetCleanName(), trade_iterator.acceptedItemName.c_str(), client->GetName()); } size_t accepted_count = client_trade.size(); size_t returned_count = client_return.size(); - client->Message(CC_Lime, "Trade with '%s' resulted in %i accepted item%s, %i returned item%s.", GetCleanName(), accepted_count, ((accepted_count == 1) ? "" : "s"), returned_count, ((returned_count == 1) ? "" : "s")); + client->Message(Chat::Lime, "Trade with '%s' resulted in %i accepted item%s, %i returned item%s.", GetCleanName(), accepted_count, ((accepted_count == 1) ? "" : "s"), returned_count, ((returned_count == 1) ? "" : "s")); if (accepted_count) CalcBotStats(client->GetBotOptionStatsUpdate()); @@ -4281,7 +4281,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, EQEmu::skills::SkillT int healed = GetActSpellHealing(spell_id, damage); Log(Logs::Detail, Logs::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName()); HealDamage(healed); - entity_list.MessageClose(this, true, 300, MT_Spells, "%s beams a smile at %s", GetCleanName(), from->GetCleanName() ); + entity_list.MessageClose(this, true, 300, Chat::Spells, "%s beams a smile at %s", GetCleanName(), from->GetCleanName() ); } CommonDamage(from, damage, spell_id, attack_skill, avoidable, buffslot, iBuffTic, special); @@ -5364,7 +5364,7 @@ bool Bot::TryFinishingBlow(Mob *defender, int &damage) if (defender->GetLevel() <= levelreq && (chance >= zone->random.Int(1, 1000))) { Log(Logs::Detail, Logs::Combat, "Landed a finishing blow: levelreq at %d, other level %d", levelreq, defender->GetLevel()); - entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName()); + entity_list.MessageClose_StringID(this, false, 200, Chat::MeleeCrit, FINISHING_BLOW, GetName()); damage = fb_damage; return true; } else { @@ -5572,7 +5572,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) { if (bIsBehind || bCanFrontalBS) { int chance = (10 + (GetDEX() / 10) + (itembonuses.HeroicDEX / 10)); if(level >= 60 && other->GetLevel() <= 45 && !other->CastToNPC()->IsEngaged() && other->GetHP()<= 32000 && other->IsNPC() && zone->random.Real(0, 99) < chance) { - entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, ASSASSINATES, GetName()); + entity_list.MessageClose_StringID(this, false, 200, Chat::MeleeCrit, ASSASSINATES, GetName()); RogueAssassinate(other); } else { RogueBackstab(other); @@ -5940,12 +5940,12 @@ void Bot::ProcessGuildInvite(Client* guildOfficer, Bot* botToGuild) { if(guildOfficer && botToGuild) { if(!botToGuild->IsInAGuild()) { if (!guild_mgr.CheckPermission(guildOfficer->GuildID(), guildOfficer->GuildRank(), GUILD_INVITE)) { - guildOfficer->Message(13, "You dont have permission to invite."); + guildOfficer->Message(Chat::Red, "You dont have permission to invite."); return; } if (!database.botdb.SaveGuildMembership(botToGuild->GetBotID(), guildOfficer->GuildID(), GUILD_MEMBER)) { - guildOfficer->Message(13, "%s for '%s'", BotDatabase::fail::SaveGuildMembership(), botToGuild->GetCleanName()); + guildOfficer->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::SaveGuildMembership(), botToGuild->GetCleanName()); return; } @@ -5958,7 +5958,7 @@ void Bot::ProcessGuildInvite(Client* guildOfficer, Bot* botToGuild) { safe_delete(pack); } else { - guildOfficer->Message(13, "Bot is in a guild."); + guildOfficer->Message(Chat::Red, "Bot is in a guild."); return; } } @@ -5974,10 +5974,10 @@ bool Bot::ProcessGuildRemoval(Client* guildOfficer, std::string botName) { } else { uint32 ownerId = 0; if (!database.botdb.LoadOwnerID(botName, ownerId)) - guildOfficer->Message(13, "%s for '%s'", BotDatabase::fail::LoadOwnerID(), botName.c_str()); + guildOfficer->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadOwnerID(), botName.c_str()); uint32 botId = 0; if (!database.botdb.LoadBotID(ownerId, botName, botId)) - guildOfficer->Message(13, "%s for '%s'", BotDatabase::fail::LoadBotID(), botName.c_str()); + guildOfficer->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadBotID(), botName.c_str()); if (botId && database.botdb.SaveGuildMembership(botId, 0, 0)) Result = true; } @@ -6125,7 +6125,7 @@ int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) { if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5) value += (GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value) * ratio / 100); - entity_list.MessageClose(this, false, 100, MT_SpellCrits, "%s delivers a critical blast! (%d)", GetName(), -value); + entity_list.MessageClose(this, false, 100, Chat::SpellCrit, "%s delivers a critical blast! (%d)", GetName(), -value); return value; } @@ -6179,7 +6179,7 @@ int32 Bot::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { value += (value * target->GetHealRate(spell_id, this) / 100); if (Critical) - entity_list.MessageClose(this, false, 100, MT_SpellCrits, "%s performs an exceptional heal! (%d)", GetName(), value); + entity_list.MessageClose(this, false, 100, Chat::SpellCrit, "%s performs an exceptional heal! (%d)", GetName(), value); return value; } else { @@ -6444,11 +6444,11 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, EQEmu::spells::CastingSlo if(!IsValidSpell(spell_id) || casting_spell_id || delaytimer || spellend_timer.Enabled() || IsStunned() || IsFeared() || IsMezzed() || (IsSilenced() && !IsDiscipline(spell_id)) || (IsAmnesiad() && IsDiscipline(spell_id))) { Log(Logs::Detail, Logs::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d", IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced() ); if(IsSilenced() && !IsDiscipline(spell_id)) - Message_StringID(13, SILENCED_STRING); + Message_StringID(Chat::Red, SILENCED_STRING); if(IsAmnesiad() && IsDiscipline(spell_id)) - Message_StringID(13, MELEE_SILENCE); + Message_StringID(Chat::Red, MELEE_SILENCE); if(casting_spell_id) AI_Event_SpellCastFinished(false, static_cast(casting_spell_slot)); @@ -6458,7 +6458,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, EQEmu::spells::CastingSlo } if(IsDetrimentalSpell(spell_id) && !zone->CanDoCombat()){ - Message_StringID(13, SPELL_WOULDNT_HOLD); + Message_StringID(Chat::Red, SPELL_WOULDNT_HOLD); if(casting_spell_id) AI_Event_SpellCastFinished(false, static_cast(casting_spell_slot)); @@ -8155,13 +8155,13 @@ void Bot::CalcBotStats(bool showtext) { return; if(showtext) { - GetBotOwner()->Message(15, "Updating %s...", GetCleanName()); + GetBotOwner()->Message(Chat::Yellow, "Updating %s...", GetCleanName()); } if(!IsValidRaceClassCombo()) { - GetBotOwner()->Message(15, "A %s - %s bot was detected. Is this Race/Class combination allowed?.", GetRaceIDName(GetRace()), GetClassIDName(GetClass(), GetLevel())); - GetBotOwner()->Message(15, "Previous Bots Code releases did not check Race/Class combinations during create."); - GetBotOwner()->Message(15, "Unless you are experiencing heavy lag, you should delete and remake this bot."); + GetBotOwner()->Message(Chat::Yellow, "A %s - %s bot was detected. Is this Race/Class combination allowed?.", GetRaceIDName(GetRace()), GetClassIDName(GetClass(), GetLevel())); + GetBotOwner()->Message(Chat::Yellow, "Previous Bots Code releases did not check Race/Class combinations during create."); + GetBotOwner()->Message(Chat::Yellow, "Unless you are experiencing heavy lag, you should delete and remake this bot."); } if(GetBotOwner()->GetLevel() != GetLevel()) @@ -8170,37 +8170,37 @@ void Bot::CalcBotStats(bool showtext) { GenerateSpecialAttacks(); if(showtext) { - GetBotOwner()->Message(15, "Base stats:"); - GetBotOwner()->Message(15, "Level: %i HP: %i AC: %i Mana: %i STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetLevel(), base_hp, AC, max_mana, STR, STA, DEX, AGI, INT, WIS, CHA); - GetBotOwner()->Message(15, "Resists-- Magic: %i, Poison: %i, Fire: %i, Cold: %i, Disease: %i, Corruption: %i.",MR,PR,FR,CR,DR,Corrup); + GetBotOwner()->Message(Chat::Yellow, "Base stats:"); + GetBotOwner()->Message(Chat::Yellow, "Level: %i HP: %i AC: %i Mana: %i STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetLevel(), base_hp, AC, max_mana, STR, STA, DEX, AGI, INT, WIS, CHA); + GetBotOwner()->Message(Chat::Yellow, "Resists-- Magic: %i, Poison: %i, Fire: %i, Cold: %i, Disease: %i, Corruption: %i.",MR,PR,FR,CR,DR,Corrup); // Test Code if(GetClass() == BARD) - GetBotOwner()->Message(15, "Bard Skills-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i", + GetBotOwner()->Message(Chat::Yellow, "Bard Skills-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i", GetSkill(EQEmu::skills::SkillBrassInstruments), GetSkill(EQEmu::skills::SkillPercussionInstruments), GetSkill(EQEmu::skills::SkillSinging), GetSkill(EQEmu::skills::SkillStringedInstruments), GetSkill(EQEmu::skills::SkillWindInstruments)); } //if(this->Save()) // this->GetBotOwner()->CastToClient()->Message(0, "%s saved.", this->GetCleanName()); //else - // this->GetBotOwner()->CastToClient()->Message(13, "%s save failed!", this->GetCleanName()); + // this->GetBotOwner()->CastToClient()->Message(Chat::Red, "%s save failed!", this->GetCleanName()); CalcBonuses(); AI_AddNPCSpells(this->GetBotSpellID()); if(showtext) { - GetBotOwner()->Message(15, "%s has been updated.", GetCleanName()); - GetBotOwner()->Message(15, "Level: %i HP: %i AC: %i Mana: %i STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetLevel(), max_hp, GetAC(), max_mana, GetSTR(), GetSTA(), GetDEX(), GetAGI(), GetINT(), GetWIS(), GetCHA()); - GetBotOwner()->Message(15, "Resists-- Magic: %i, Poison: %i, Fire: %i, Cold: %i, Disease: %i, Corruption: %i.",GetMR(),GetPR(),GetFR(),GetCR(),GetDR(),GetCorrup()); + GetBotOwner()->Message(Chat::Yellow, "%s has been updated.", GetCleanName()); + GetBotOwner()->Message(Chat::Yellow, "Level: %i HP: %i AC: %i Mana: %i STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetLevel(), max_hp, GetAC(), max_mana, GetSTR(), GetSTA(), GetDEX(), GetAGI(), GetINT(), GetWIS(), GetCHA()); + GetBotOwner()->Message(Chat::Yellow, "Resists-- Magic: %i, Poison: %i, Fire: %i, Cold: %i, Disease: %i, Corruption: %i.",GetMR(),GetPR(),GetFR(),GetCR(),GetDR(),GetCorrup()); // Test Code if(GetClass() == BARD) { - GetBotOwner()->Message(15, "Bard Skills-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i", + GetBotOwner()->Message(Chat::Yellow, "Bard Skills-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i", GetSkill(EQEmu::skills::SkillBrassInstruments) + GetBrassMod(), GetSkill(EQEmu::skills::SkillPercussionInstruments) + GetPercMod(), GetSkill(EQEmu::skills::SkillSinging) + GetSingMod(), GetSkill(EQEmu::skills::SkillStringedInstruments) + GetStringMod(), GetSkill(EQEmu::skills::SkillWindInstruments) + GetWindMod()); - GetBotOwner()->Message(15, "Bard Skill Mods-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i", GetBrassMod(), GetPercMod(), GetSingMod(), GetStringMod(), GetWindMod()); + GetBotOwner()->Message(Chat::Yellow, "Bard Skill Mods-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i", GetBrassMod(), GetPercMod(), GetSingMod(), GetStringMod(), GetWindMod()); } } } @@ -9070,7 +9070,7 @@ bool Bot::DyeArmor(int16 slot_id, uint32 rgb, bool all_flag, bool save_flag) if (!database.botdb.SaveEquipmentColor(GetBotID(), save_slot, rgb)) { if (GetBotOwner() && GetBotOwner()->IsClient()) - GetBotOwner()->CastToClient()->Message(13, "%s", BotDatabase::fail::SaveEquipmentColor()); + GetBotOwner()->CastToClient()->Message(Chat::Red, "%s", BotDatabase::fail::SaveEquipmentColor()); return false; } } diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index 69191d991..da17b78d8 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -84,12 +84,12 @@ namespace { //#define BCSTSPELLDUMP // only needed if you're adding/tailoring bot command spells and need a file dump -#define m_message CC_WhiteSmoke -#define m_action CC_Yellow -#define m_note CC_Gray -#define m_usage CC_Cyan -#define m_fail CC_Red -#define m_unknown CC_Magenta +#define m_message Chat::WhiteSmoke +#define m_action Chat::Yellow +#define m_note Chat::Gray +#define m_usage Chat::Cyan +#define m_fail Chat::Red +#define m_unknown Chat::Magenta #define HP_RATIO_DELTA 5.0f @@ -4833,7 +4833,7 @@ void bot_subcommand_bot_inspect_message(Client *c, const Seperator *sep) set_flag = true; } else if (strcasecmp(sep->arg[1], "clear")) { - c->Message(15, "This command requires a [set | clear] argument"); + c->Message(Chat::Yellow, "This command requires a [set | clear] argument"); return; } @@ -7284,7 +7284,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) int ab_mask = (ActionableBots::ABM_Target | ActionableBots::ABM_ByName); if (c->GetTradeskillObject() || (c->trade->state == Trading)) { - c->Message_StringID(MT_Tell, MERCHANT_BUSY); + c->Message_StringID(Chat::Tell, MERCHANT_BUSY); return; } @@ -7310,7 +7310,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) itm = itminst->GetItem(); if (itminst && itm && c->CheckLoreConflict(itm)) { - c->Message_StringID(0, PICK_LORE); + c->Message_StringID(Chat::WhiteSmoke, PICK_LORE); return; } @@ -7324,7 +7324,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) if (!c->CheckLoreConflict(itma->GetItem())) continue; - c->Message_StringID(0, PICK_LORE); + c->Message_StringID(Chat::WhiteSmoke, PICK_LORE); return; } diff --git a/zone/client.cpp b/zone/client.cpp index 7e6baf180..18385fe30 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -914,7 +914,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s { case ChatChannel_Guild: { /* Guild Chat */ if (!IsInAGuild()) - Message_StringID(MT_DefaultText, GUILD_NOT_MEMBER2); //You are not a member of any guild. + Message_StringID(Chat::DefaultText, GUILD_NOT_MEMBER2); //You are not a member of any guild. else if (!guild_mgr.CheckPermission(GuildID(), GuildRank(), GUILD_SPEAK)) Message(0, "Error: You dont have permission to speak to the guild."); else if (!worldserver.SendChannelMessage(this, targetname, chan_num, GuildID(), language, lang_skill, message)) @@ -1097,11 +1097,11 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s if(parse->PlayerHasQuestSub(EVENT_COMMAND)) { int i = parse->EventPlayer(EVENT_COMMAND, this, message, 0); if(i == 0 && !RuleB(Chat, SuppressCommandErrors)) { - Message(13, "Command '%s' not recognized.", message); + Message(Chat::Red, "Command '%s' not recognized.", message); } } else { if(!RuleB(Chat, SuppressCommandErrors)) - Message(13, "Command '%s' not recognized.", message); + Message(Chat::Red, "Command '%s' not recognized.", message); } } break; @@ -1116,12 +1116,12 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s if (parse->PlayerHasQuestSub(EVENT_COMMAND)) { int i = parse->EventPlayer(EVENT_COMMAND, this, message, 0); if (i == 0 && !RuleB(Chat, SuppressCommandErrors)) { - Message(13, "Bot command '%s' not recognized.", message); + Message(Chat::Red, "Bot command '%s' not recognized.", message); } } else { if (!RuleB(Chat, SuppressCommandErrors)) - Message(13, "Bot command '%s' not recognized.", message); + Message(Chat::Red, "Bot command '%s' not recognized.", message); } } break; @@ -1265,11 +1265,11 @@ void Client::ChannelMessageSend(const char* from, const char* to, uint8 chan_num } void Client::Message(uint32 type, const char* message, ...) { - if (GetFilter(FilterSpellDamage) == FilterHide && type == MT_NonMelee) + if (GetFilter(FilterSpellDamage) == FilterHide && type == Chat::NonMelee) return; - if (GetFilter(FilterMeleeCrits) == FilterHide && type == MT_CritMelee) //98 is self... + if (GetFilter(FilterMeleeCrits) == FilterHide && type == Chat::MeleeCrit) //98 is self... return; - if (GetFilter(FilterSpellCrits) == FilterHide && type == MT_SpellCrits) + if (GetFilter(FilterSpellCrits) == FilterHide && type == Chat::SpellCrit) return; va_list argptr; @@ -1509,7 +1509,7 @@ void Client::IncreaseLanguageSkill(int skill_id, int value) { QueuePacket(outapp); safe_delete(outapp); - Message_StringID( MT_Skills, LANG_SKILL_IMPROVED ); //Notify client + Message_StringID( Chat::Skills, LANG_SKILL_IMPROVED ); //Notify client } void Client::AddSkill(EQEmu::skills::SkillType skillid, uint16 value) { @@ -2047,7 +2047,7 @@ bool Client::ChangeFirstName(const char* in_firstname, const char* gmname) void Client::SetGM(bool toggle) { m_pp.gm = toggle ? 1 : 0; m_inv.SetGMInventory((bool)m_pp.gm); - Message(13, "You are %s a GM.", m_pp.gm ? "now" : "no longer"); + Message(Chat::Red, "You are %s a GM.", m_pp.gm ? "now" : "no longer"); SendAppearancePacket(AT_GM, m_pp.gm); Save(); UpdateWho(); @@ -2550,7 +2550,7 @@ uint16 Client::GetMaxSkillAfterSpecializationRules(EQEmu::skills::SkillType skil } else { - Message(13, "Your spell casting specializations skills have been reset. " + Message(Chat::Red, "Your spell casting specializations skills have been reset. " "Only %i primary specialization skill is allowed.", MaxSpecializations); for (int i = EQEmu::skills::SkillSpecializeAbjure; i <= EQEmu::skills::SkillSpecializeEvocation; ++i) @@ -2578,9 +2578,9 @@ void Client::SetPVP(bool toggle, bool message) { if (message) { if(GetPVP()) - this->Message_StringID(MT_Shout,PVP_ON); + this->Message_StringID(Chat::Shout,PVP_ON); else - Message(13, "You no longer follow the ways of discord."); + Message(Chat::Red, "You no longer follow the ways of discord."); } SendAppearancePacket(AT_PVP, GetPVP()); @@ -2714,22 +2714,22 @@ void Client::Disarm(Client* disarmer, int chance) { if (matslot != EQEmu::textures::materialInvalid) SendWearChange(matslot); } - Message_StringID(MT_Skills, DISARMED); + Message_StringID(Chat::Skills, DISARMED); if (disarmer != this) - disarmer->Message_StringID(MT_Skills, DISARM_SUCCESS, this->GetCleanName()); + disarmer->Message_StringID(Chat::Skills, DISARM_SUCCESS, this->GetCleanName()); if (chance != 1000) disarmer->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 4); CalcBonuses(); // CalcEnduranceWeightFactor(); return; } - disarmer->Message_StringID(MT_Skills, DISARM_FAILED); + disarmer->Message_StringID(Chat::Skills, DISARM_FAILED); if (chance != 1000) disarmer->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 2); return; } } - disarmer->Message_StringID(MT_Skills, DISARM_FAILED); + disarmer->Message_StringID(Chat::Skills, DISARM_FAILED); } bool Client::BindWound(Mob *bindmob, bool start, bool fail) @@ -2771,7 +2771,7 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail) } else { // send bindmob "stand still" if (!bindmob->IsAIControlled() && bindmob != this) { - bindmob->CastToClient()->Message_StringID(clientMessageYellow, + bindmob->CastToClient()->Message_StringID(Chat::Yellow, YOU_ARE_BEING_BANDAGED); } else if (bindmob->IsAIControlled() && bindmob != this) { ; // Tell IPC to stand still? @@ -2855,7 +2855,7 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail) } else { // I dont have the real, live - Message(15, "You cannot bind wounds above %d%% hitpoints.", + Message(Chat::Yellow, "You cannot bind wounds above %d%% hitpoints.", max_percent); if (bindmob != this && bindmob->IsClient()) bindmob->CastToClient()->Message( @@ -2916,9 +2916,9 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail) bindmob->SendHPUpdate(); } else { - Message(15, "You cannot bind wounds above %d%% hitpoints", max_percent); + Message(Chat::Yellow, "You cannot bind wounds above %d%% hitpoints", max_percent); if (bindmob != this && bindmob->IsClient()) - bindmob->CastToClient()->Message(15, "You cannot have your wounds bound above %d%% hitpoints", max_percent); + bindmob->CastToClient()->Message(Chat::Yellow, "You cannot have your wounds bound above %d%% hitpoints", max_percent); } } } @@ -3077,11 +3077,11 @@ void Client::ServerFilter(SetServerFilter_Struct* filter){ // this version is for messages with no parameters void Client::Message_StringID(uint32 type, uint32 string_id, uint32 distance) { - if (GetFilter(FilterSpellDamage) == FilterHide && type == MT_NonMelee) + if (GetFilter(FilterSpellDamage) == FilterHide && type == Chat::NonMelee) return; - if (GetFilter(FilterMeleeCrits) == FilterHide && type == MT_CritMelee) //98 is self... + if (GetFilter(FilterMeleeCrits) == FilterHide && type == Chat::MeleeCrit) //98 is self... return; - if (GetFilter(FilterSpellCrits) == FilterHide && type == MT_SpellCrits) + if (GetFilter(FilterSpellCrits) == FilterHide && type == Chat::SpellCrit) return; auto outapp = new EQApplicationPacket(OP_SimpleMessage, 12); SimpleMessage_Struct* sms = (SimpleMessage_Struct*)outapp->pBuffer; @@ -3108,20 +3108,20 @@ void Client::Message_StringID(uint32 type, uint32 string_id, const char* message const char* message5,const char* message6,const char* message7, const char* message8,const char* message9, uint32 distance) { - if (GetFilter(FilterSpellDamage) == FilterHide && type == MT_NonMelee) + if (GetFilter(FilterSpellDamage) == FilterHide && type == Chat::NonMelee) return; - if (GetFilter(FilterMeleeCrits) == FilterHide && type == MT_CritMelee) //98 is self... + if (GetFilter(FilterMeleeCrits) == FilterHide && type == Chat::MeleeCrit) //98 is self... return; - if (GetFilter(FilterSpellCrits) == FilterHide && type == MT_SpellCrits) + if (GetFilter(FilterSpellCrits) == FilterHide && type == Chat::SpellCrit) return; - if (GetFilter(FilterDamageShields) == FilterHide && type == MT_DS) + if (GetFilter(FilterDamageShields) == FilterHide && type == Chat::DamageShield) return; int i = 0, argcount = 0, length = 0; char *bufptr = nullptr; const char *message_arg[9] = {0}; - if(type==MT_Emote) + if(type==Chat::Emote) type=4; if(!message1) @@ -3236,7 +3236,7 @@ void Client::FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType fil char *bufptr = nullptr; const char *message_arg[9] = {0}; - if (type == MT_Emote) + if (type == Chat::Emote) type = 4; if (!message1) { @@ -3281,7 +3281,7 @@ void Client::Tell_StringID(uint32 string_id, const char *who, const char *messag char string_id_str[10]; snprintf(string_id_str, 10, "%d", string_id); - Message_StringID(MT_TellEcho, TELL_QUEUED_MESSAGE, who, string_id_str, message); + Message_StringID(Chat::EchoTell, TELL_QUEUED_MESSAGE, who, string_id_str, message); } void Client::SetTint(int16 in_slot, uint32 color) { @@ -3344,7 +3344,7 @@ void Client::SetLanguageSkill(int langid, int value) QueuePacket(outapp); safe_delete(outapp); - Message_StringID( MT_Skills, LANG_SKILL_IMPROVED ); //Notify the client + Message_StringID( Chat::Skills, LANG_SKILL_IMPROVED ); //Notify the client } void Client::LinkDead() @@ -3432,7 +3432,7 @@ void Client::Escape() entity_list.RemoveFromTargets(this, true); SetInvisible(1); - Message_StringID(MT_Skills, ESCAPE); + Message_StringID(Chat::Skills, ESCAPE); } float Client::CalcPriceMod(Mob* other, bool reverse) @@ -3828,9 +3828,9 @@ void Client::EnteringMessages(Client* client) uint8 flag = database.GetAgreementFlag(client->AccountID()); if(!flag) { - client->Message(13,"You must agree to the Rules, before you can move. (type #serverrules to view the rules)"); - client->Message(13,"You must agree to the Rules, before you can move. (type #serverrules to view the rules)"); - client->Message(13,"You must agree to the Rules, before you can move. (type #serverrules to view the rules)"); + client->Message(Chat::Red,"You must agree to the Rules, before you can move. (type #serverrules to view the rules)"); + client->Message(Chat::Red,"You must agree to the Rules, before you can move. (type #serverrules to view the rules)"); + client->Message(Chat::Red,"You must agree to the Rules, before you can move. (type #serverrules to view the rules)"); client->SendAppearancePacket(AT_Anim, ANIM_FREEZE); } } @@ -3872,13 +3872,13 @@ void Client::SacrificeConfirm(Client *caster) } if (GetLevel() < RuleI(Spells, SacrificeMinLevel)) { - caster->Message_StringID(13, SAC_TOO_LOW); // This being is not a worthy sacrifice. + caster->Message_StringID(Chat::Red, SAC_TOO_LOW); // This being is not a worthy sacrifice. safe_delete(outapp); return; } if (GetLevel() > RuleI(Spells, SacrificeMaxLevel)) { - caster->Message_StringID(13, SAC_TOO_HIGH); + caster->Message_StringID(Chat::Red, SAC_TOO_HIGH); safe_delete(outapp); return; } @@ -3947,7 +3947,7 @@ void Client::Sacrifice(Client *caster) caster->SummonItem(RuleI(Spells, SacrificeItemID)); } } else { - caster->Message_StringID(13, SAC_TOO_LOW); // This being is not a worthy sacrifice. + caster->Message_StringID(Chat::Red, SAC_TOO_LOW); // This being is not a worthy sacrifice. } } @@ -4222,7 +4222,7 @@ void Client::KeyRingAdd(uint32 item_id) return; } - Message(4,"Added to keyring."); + Message(Chat::LightBlue,"Added to keyring."); keyring.push_back(item_id); } @@ -4238,11 +4238,11 @@ bool Client::KeyRingCheck(uint32 item_id) void Client::KeyRingList() { - Message(4,"Keys on Keyring:"); + Message(Chat::LightBlue,"Keys on Keyring:"); const EQEmu::ItemData *item = nullptr; for (auto iter = keyring.begin(); iter != keyring.end(); ++iter) { if ((item = database.GetItem(*iter))!=nullptr) { - Message(4,item->Name); + Message(Chat::LightBlue,item->Name); } } } @@ -4414,8 +4414,8 @@ bool Client::GroupFollow(Client* inviter) { if (group->GetID() == 0) { - Message(13, "Unable to get new group id. Cannot create group."); - inviter->Message(13, "Unable to get new group id. Cannot create group."); + Message(Chat::Red, "Unable to get new group id. Cannot create group."); + inviter->Message(Chat::Red, "Unable to get new group id. Cannot create group."); return false; } @@ -4924,7 +4924,7 @@ void Client::HandleLDoNOpen(NPC *target) { Log(Logs::General, Logs::None, "%s tried to open %s but %s was out of range", GetName(), target->GetName(), target->GetName()); - Message(13, "Treasure chest out of range."); + Message(Chat::Red, "Treasure chest out of range."); return; } @@ -4932,7 +4932,7 @@ void Client::HandleLDoNOpen(NPC *target) { if(target->GetLDoNTrapSpellID() != 0) { - Message_StringID(13, LDON_ACCIDENT_SETOFF2); + Message_StringID(Chat::Red, LDON_ACCIDENT_SETOFF2); target->SpellFinished(target->GetLDoNTrapSpellID(), this, EQEmu::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].ResistDiff); target->SetLDoNTrapSpellID(0); target->SetLDoNTrapped(false); @@ -4948,7 +4948,7 @@ void Client::HandleLDoNOpen(NPC *target) if(target->IsLDoNLocked()) { - Message_StringID(MT_Skills, LDON_STILL_LOCKED, target->GetCleanName()); + Message_StringID(Chat::Skills, LDON_STILL_LOCKED, target->GetCleanName()); return; } else @@ -4982,13 +4982,13 @@ void Client::HandleLDoNSenseTraps(NPC *target, uint16 skill, uint8 type) { if((target->GetLDoNTrapType() == LDoNTypeCursed || target->GetLDoNTrapType() == LDoNTypeMagical) && type != target->GetLDoNTrapType()) { - Message_StringID(MT_Skills, LDON_CANT_DETERMINE_TRAP, target->GetCleanName()); + Message_StringID(Chat::Skills, LDON_CANT_DETERMINE_TRAP, target->GetCleanName()); return; } if(target->IsLDoNTrapDetected()) { - Message_StringID(MT_Skills, LDON_CERTAIN_TRAP, target->GetCleanName()); + Message_StringID(Chat::Skills, LDON_CERTAIN_TRAP, target->GetCleanName()); } else { @@ -4997,10 +4997,10 @@ void Client::HandleLDoNSenseTraps(NPC *target, uint16 skill, uint8 type) { case -1: case 0: - Message_StringID(MT_Skills, LDON_DONT_KNOW_TRAPPED, target->GetCleanName()); + Message_StringID(Chat::Skills, LDON_DONT_KNOW_TRAPPED, target->GetCleanName()); break; case 1: - Message_StringID(MT_Skills, LDON_CERTAIN_TRAP, target->GetCleanName()); + Message_StringID(Chat::Skills, LDON_CERTAIN_TRAP, target->GetCleanName()); target->SetLDoNTrapDetected(true); break; default: @@ -5010,7 +5010,7 @@ void Client::HandleLDoNSenseTraps(NPC *target, uint16 skill, uint8 type) } else { - Message_StringID(MT_Skills, LDON_CERTAIN_NOT_TRAP, target->GetCleanName()); + Message_StringID(Chat::Skills, LDON_CERTAIN_NOT_TRAP, target->GetCleanName()); } } } @@ -5023,13 +5023,13 @@ void Client::HandleLDoNDisarm(NPC *target, uint16 skill, uint8 type) { if(!target->IsLDoNTrapped()) { - Message_StringID(MT_Skills, LDON_WAS_NOT_TRAPPED, target->GetCleanName()); + Message_StringID(Chat::Skills, LDON_WAS_NOT_TRAPPED, target->GetCleanName()); return; } if((target->GetLDoNTrapType() == LDoNTypeCursed || target->GetLDoNTrapType() == LDoNTypeMagical) && type != target->GetLDoNTrapType()) { - Message_StringID(MT_Skills, LDON_HAVE_NOT_DISARMED, target->GetCleanName()); + Message_StringID(Chat::Skills, LDON_HAVE_NOT_DISARMED, target->GetCleanName()); return; } @@ -5048,13 +5048,13 @@ void Client::HandleLDoNDisarm(NPC *target, uint16 skill, uint8 type) target->SetLDoNTrapDetected(false); target->SetLDoNTrapped(false); target->SetLDoNTrapSpellID(0); - Message_StringID(MT_Skills, LDON_HAVE_DISARMED, target->GetCleanName()); + Message_StringID(Chat::Skills, LDON_HAVE_DISARMED, target->GetCleanName()); break; case 0: - Message_StringID(MT_Skills, LDON_HAVE_NOT_DISARMED, target->GetCleanName()); + Message_StringID(Chat::Skills, LDON_HAVE_NOT_DISARMED, target->GetCleanName()); break; case -1: - Message_StringID(13, LDON_ACCIDENT_SETOFF2); + Message_StringID(Chat::Red, LDON_ACCIDENT_SETOFF2); target->SpellFinished(target->GetLDoNTrapSpellID(), this, EQEmu::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].ResistDiff); target->SetLDoNTrapSpellID(0); target->SetLDoNTrapped(false); @@ -5073,7 +5073,7 @@ void Client::HandleLDoNPickLock(NPC *target, uint16 skill, uint8 type) { if(target->IsLDoNTrapped()) { - Message_StringID(13, LDON_ACCIDENT_SETOFF2); + Message_StringID(Chat::Red, LDON_ACCIDENT_SETOFF2); target->SpellFinished(target->GetLDoNTrapSpellID(), this, EQEmu::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].ResistDiff); target->SetLDoNTrapSpellID(0); target->SetLDoNTrapped(false); @@ -5082,13 +5082,13 @@ void Client::HandleLDoNPickLock(NPC *target, uint16 skill, uint8 type) if(!target->IsLDoNLocked()) { - Message_StringID(MT_Skills, LDON_WAS_NOT_LOCKED, target->GetCleanName()); + Message_StringID(Chat::Skills, LDON_WAS_NOT_LOCKED, target->GetCleanName()); return; } if((target->GetLDoNTrapType() == LDoNTypeCursed || target->GetLDoNTrapType() == LDoNTypeMagical) && type != target->GetLDoNTrapType()) { - Message(MT_Skills, "You cannot unlock %s with this skill.", target->GetCleanName()); + Message(Chat::Skills, "You cannot unlock %s with this skill.", target->GetCleanName()); return; } @@ -5098,11 +5098,11 @@ void Client::HandleLDoNPickLock(NPC *target, uint16 skill, uint8 type) { case 0: case -1: - Message_StringID(MT_Skills, LDON_PICKLOCK_FAILURE, target->GetCleanName()); + Message_StringID(Chat::Skills, LDON_PICKLOCK_FAILURE, target->GetCleanName()); break; case 1: target->SetLDoNLocked(false); - Message_StringID(MT_Skills, LDON_PICKLOCK_SUCCESS, target->GetCleanName()); + Message_StringID(Chat::Skills, LDON_PICKLOCK_SUCCESS, target->GetCleanName()); break; } } @@ -5161,7 +5161,7 @@ void Client::SummonAndRezzAllCorpses() int CorpseCount = database.SummonAllCharacterCorpses(CharacterID(), zone->GetZoneID(), zone->GetInstanceID(), GetPosition()); if(CorpseCount <= 0) { - Message(clientMessageYellow, "You have no corpses to summnon."); + Message(Chat::Yellow, "You have no corpses to summnon."); return; } @@ -5170,7 +5170,7 @@ void Client::SummonAndRezzAllCorpses() if(RezzExp > 0) SetEXP(GetEXP() + RezzExp, GetAAXP(), true); - Message(clientMessageYellow, "All your corpses have been summoned to your feet and have received a 100% resurrection."); + Message(Chat::Yellow, "All your corpses have been summoned to your feet and have received a 100% resurrection."); } void Client::SummonAllCorpses(const glm::vec4& position) @@ -5250,7 +5250,7 @@ void Client::SetStartZone(uint32 zoneid, float x, float y, float z) // setting city to zero allows the player to use /setstartcity to set the city themselves if(zoneid == 0) { m_pp.binds[4].zoneId = 0; - this->Message(15,"Your starting city has been reset. Use /setstartcity to choose a new one"); + this->Message(Chat::Yellow,"Your starting city has been reset. Use /setstartcity to choose a new one"); return; } @@ -5579,7 +5579,7 @@ void Client::SuspendMinion() if(m_suspendedminion.SpellID > 0) { if (m_suspendedminion.SpellID >= SPDAT_RECORDS) { - Message(13, "Invalid suspended minion spell id (%u).", m_suspendedminion.SpellID); + Message(Chat::Red, "Invalid suspended minion spell id (%u).", m_suspendedminion.SpellID); memset(&m_suspendedminion, 0, sizeof(PetInfo)); return; } @@ -5591,7 +5591,7 @@ void Client::SuspendMinion() if(!CurrentPet) { - Message(13, "Failed to recall suspended minion."); + Message(Chat::Red, "Failed to recall suspended minion."); return; } @@ -5607,7 +5607,7 @@ void Client::SuspendMinion() CurrentPet->SetMana(m_suspendedminion.Mana); - Message_StringID(clientMessageTell, SUSPEND_MINION_UNSUSPEND, CurrentPet->GetCleanName()); + Message_StringID(Chat::Magenta, SUSPEND_MINION_UNSUSPEND, CurrentPet->GetCleanName()); memset(&m_suspendedminion, 0, sizeof(struct PetInfo)); // TODO: These pet command states need to be synced ... @@ -5637,19 +5637,19 @@ void Client::SuspendMinion() { if(m_suspendedminion.SpellID > 0) { - Message_StringID(clientMessageError,ONLY_ONE_PET); + Message_StringID(Chat::Red,ONLY_ONE_PET); return; } else if(CurrentPet->IsEngaged()) { - Message_StringID(clientMessageError,SUSPEND_MINION_FIGHTING); + Message_StringID(Chat::Red,SUSPEND_MINION_FIGHTING); return; } else if(entity_list.Fighting(CurrentPet)) { - Message_StringID(clientMessageBlue,SUSPEND_MINION_HAS_AGGRO); + Message_StringID(Chat::Blue,SUSPEND_MINION_HAS_AGGRO); } else { @@ -5666,7 +5666,7 @@ void Client::SuspendMinion() else strn0cpy(m_suspendedminion.Name, CurrentPet->GetName(), 64); // Name stays even at rank 1 - Message_StringID(clientMessageTell, SUSPEND_MINION_SUSPEND, CurrentPet->GetCleanName()); + Message_StringID(Chat::Magenta, SUSPEND_MINION_SUSPEND, CurrentPet->GetCleanName()); CurrentPet->Depop(false); @@ -5675,7 +5675,7 @@ void Client::SuspendMinion() } else { - Message_StringID(clientMessageError, ONLY_SUMMONED_PETS); + Message_StringID(Chat::Red, ONLY_SUMMONED_PETS); return; } @@ -6149,16 +6149,16 @@ void Client::LocateCorpse() if(ClosestCorpse) { - Message_StringID(MT_Spells, SENSE_CORPSE_DIRECTION); + Message_StringID(Chat::Spells, SENSE_CORPSE_DIRECTION); SetHeading(CalculateHeadingToTarget(ClosestCorpse->GetX(), ClosestCorpse->GetY())); SetTarget(ClosestCorpse); SendTargetCommand(ClosestCorpse->GetID()); SentPositionPacket(0.0f, 0.0f, 0.0f, 0.0f, 0, true); } else if(!GetTarget()) - Message_StringID(clientMessageError, SENSE_CORPSE_NONE); + Message_StringID(Chat::Red, SENSE_CORPSE_NONE); else - Message_StringID(clientMessageError, SENSE_CORPSE_NOT_NAME); + Message_StringID(Chat::Red, SENSE_CORPSE_NOT_NAME); } void Client::NPCSpawn(NPC *target_npc, const char *identifier, uint32 extra) @@ -6218,7 +6218,7 @@ void Client::DragCorpses() if (!corpse || !corpse->IsPlayerCorpse() || corpse->CastToCorpse()->IsBeingLooted() || !corpse->CastToCorpse()->Summon(this, false, false)) { - Message_StringID(MT_DefaultText, CORPSEDRAG_STOP); + Message_StringID(Chat::DefaultText, CORPSEDRAG_STOP); It = DraggedCorpses.erase(It); if (It == DraggedCorpses.end()) break; @@ -6235,7 +6235,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record)) { Log(Logs::General, Logs::Error, "Unknown doppelganger spell id: %d, check pets table", spell_id); - Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone); + Message(Chat::Red, "Unable to find data for pet %s", spells[spell_id].teleport_zone); return; } @@ -6850,11 +6850,11 @@ void Client::SendStatsWindow(Client* client, bool use_window) goto Extra_Info; } else { - client->Message(15, "The window has exceeded its character limit, displaying stats to chat window:"); + client->Message(Chat::Yellow, "The window has exceeded its character limit, displaying stats to chat window:"); } } - client->Message(15, "~~~~~ %s %s ~~~~~", GetCleanName(), GetLastName()); + client->Message(Chat::Yellow, "~~~~~ %s %s ~~~~~", GetCleanName(), GetLastName()); client->Message(0, " Level: %i Class: %i Race: %i DS: %i/%i Size: %1.1f Weight: %.1f/%d ", GetLevel(), GetClass(), GetRace(), GetDS(), RuleI(Character, ItemDamageShieldCap), GetSize(), (float)CalcCurrentWeight() / 10.0f, GetSTR()); client->Message(0, " HP: %i/%i HP Regen: %i/%i",GetHP(), GetMaxHP(), CalcHPRegen(), CalcHPRegenCap()); client->Message(0, " compute_tohit: %i TotalToHit: %i", compute_tohit(skill), GetTotalToHit(skill, 0)); @@ -7623,7 +7623,7 @@ void Client::DuplicateLoreMessage(uint32 ItemID) { if (!(m_ClientVersionBit & EQEmu::versions::maskRoFAndLater)) { - Message_StringID(0, PICK_LORE); + Message_StringID(Chat::White, PICK_LORE); return; } @@ -7632,7 +7632,7 @@ void Client::DuplicateLoreMessage(uint32 ItemID) if(!item) return; - Message_StringID(0, PICK_LORE, item->Name); + Message_StringID(Chat::White, PICK_LORE, item->Name); } void Client::GarbleMessage(char *message, uint8 variance) @@ -7796,7 +7796,7 @@ void Client::SetFactionLevel(uint32 char_id, uint32 npc_id, uint8 char_class, ui UpdatePersonalFaction(char_id, npc_value[i], faction_id[i], ¤t_value, temp[i], this_faction_min, this_faction_max); - //Message(14, "Min(%d) Max(%d) Before(%d), After(%d)\n", this_faction_min, this_faction_max, faction_before_hit, current_value); + //Message(Chat::Lime, "Min(%d) Max(%d) Before(%d), After(%d)\n", this_faction_min, this_faction_max, faction_before_hit, current_value); SendFactionMessage(npc_value[i], faction_id[i], faction_before_hit, current_value, temp[i], this_faction_min, this_faction_max); } @@ -7839,7 +7839,7 @@ void Client::SetFactionLevel2(uint32 char_id, int32 faction_id, uint8 char_class UpdatePersonalFaction(char_id, value, faction_id, ¤t_value, temp, this_faction_min, this_faction_max); - //Message(14, "Min(%d) Max(%d) Before(%d), After(%d)\n", this_faction_min, this_faction_max, faction_before_hit, current_value); + //Message(Chat::Lime, "Min(%d) Max(%d) Before(%d), After(%d)\n", this_faction_min, this_faction_max, faction_before_hit, current_value); SendFactionMessage(value, faction_id, faction_before_hit, current_value, temp, this_faction_min, this_faction_max); } @@ -8031,15 +8031,15 @@ void Client::SendFactionMessage(int32 tmpvalue, int32 faction_id, int32 faction_ if (tmpvalue == 0 || temp == 1 || temp == 2) return; else if (faction_value >= this_faction_max) - Message_StringID(15, FACTION_BEST, name); + Message_StringID(Chat::Yellow, FACTION_BEST, name); else if (faction_value <= this_faction_min) - Message_StringID(15, FACTION_WORST, name); + Message_StringID(Chat::Yellow, FACTION_WORST, name); else if (tmpvalue > 0 && faction_value < this_faction_max && !RuleB(Client, UseLiveFactionMessage)) - Message_StringID(15, FACTION_BETTER, name); + Message_StringID(Chat::Yellow, FACTION_BETTER, name); else if (tmpvalue < 0 && faction_value > this_faction_min && !RuleB(Client, UseLiveFactionMessage)) - Message_StringID(15, FACTION_WORSE, name); + Message_StringID(Chat::Yellow, FACTION_WORSE, name); else if (RuleB(Client, UseLiveFactionMessage)) - Message(15, "Your faction standing with %s has been adjusted by %i.", name, tmpvalue); //New Live faction message (14261) + Message(Chat::Yellow, "Your faction standing with %s has been adjusted by %i.", name, tmpvalue); //New Live faction message (14261) return; } @@ -8428,7 +8428,7 @@ void Client::ExpeditionSay(const char *str, int ExpID) { return; if(results.RowCount() == 0) { - this->Message(14, "You say to the expedition, '%s'", str); + this->Message(Chat::Lime, "You say to the expedition, '%s'", str); return; } @@ -8531,7 +8531,7 @@ void Client::SendHPUpdateMarquee(){ return; std::string health_update_notification = StringFormat("Health: %u%%", health_percentage); - this->SendMarqueeMessage(15, 510, 0, 3000, 3000, health_update_notification); + this->SendMarqueeMessage(Chat::Yellow, 510, 0, 3000, 3000, health_update_notification); } uint32 Client::GetMoney(uint8 type, uint8 subtype) { @@ -9044,7 +9044,7 @@ void Client::SetPrimaryWeaponOrnamentation(uint32 model_id) SendItemPacket(EQEmu::invslot::slotPrimary, primary_item, ItemPacketTrade); WearChange(EQEmu::textures::weaponPrimary, static_cast(model_id), 0); - Message(15, "Your primary weapon appearance has been modified"); + Message(Chat::Yellow, "Your primary weapon appearance has been modified"); } } @@ -9067,7 +9067,7 @@ void Client::SetSecondaryWeaponOrnamentation(uint32 model_id) SendItemPacket(EQEmu::invslot::slotSecondary, secondary_item, ItemPacketTrade); WearChange(EQEmu::textures::weaponSecondary, static_cast(model_id), 0); - Message(15, "Your secondary weapon appearance has been modified"); + Message(Chat::Yellow, "Your secondary weapon appearance has been modified"); } } @@ -9107,7 +9107,7 @@ bool Client::GotoPlayer(std::string player_name) auto heading = static_cast(atof(row[5])); if (instance_id > 0 && !database.CheckInstanceExists(instance_id)) { - this->Message(15, "Instance no longer exists..."); + this->Message(Chat::Yellow, "Instance no longer exists..."); return false; } diff --git a/zone/client.h b/zone/client.h index 29632d667..c22f18419 100644 --- a/zone/client.h +++ b/zone/client.h @@ -90,23 +90,6 @@ public: bool ack_req; }; -enum { //Type arguments to the Message* routines. - //all not explicitly listed are the same grey color - clientMessageWhite0 = 0, - clientMessageLoot = 2, //dark green - clientMessageTradeskill = 4, //light blue - clientMessageTell = 5, //magenta - clientMessageWhite = 7, - clientMessageWhite2 = 10, - clientMessageLightGrey = 12, - clientMessageError = 13, //red - clientMessageGreen = 14, - clientMessageYellow = 15, - clientMessageBlue = 16, - clientMessageGroup = 18, //cyan - clientMessageWhite3 = 20, -}; - #define SPELLBAR_UNLOCK 0x2bc enum { //scribing argument to MemorizeSpell memSpellUnknown = -1, // this modifies some state data diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 2bd6ed1ac..cf0633033 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -541,7 +541,7 @@ void Client::CompleteConnect() //SendAATable(); - if (GetHideMe()) Message(13, "[GM] You are currently hidden to all clients"); + if (GetHideMe()) Message(Chat::Red, "[GM] You are currently hidden to all clients"); uint32 raidid = database.GetRaidID(GetName()); Raid *raid = nullptr; @@ -711,7 +711,7 @@ void Client::CompleteConnect() { SendAppearancePacket(AT_Levitate, 0); BuffFadeByEffect(SE_Levitate); - Message(13, "You can't levitate in this zone."); + Message(Chat::Red, "You can't levitate in this zone."); } } else { @@ -836,19 +836,19 @@ void Client::CompleteConnect() uint32 minute = (ttime / 60000) % 60; uint32 second = (ttime / 1000) % 60; if (day) { - Message(15, "%s(%u) will expire in %u days, %u hours, %u minutes, and %u seconds.", + Message(Chat::Yellow, "%s(%u) will expire in %u days, %u hours, %u minutes, and %u seconds.", zone->GetLongName(), zone->GetInstanceID(), day, hour, minute, second); } else if (hour) { - Message(15, "%s(%u) will expire in %u hours, %u minutes, and %u seconds.", + Message(Chat::Yellow, "%s(%u) will expire in %u hours, %u minutes, and %u seconds.", zone->GetLongName(), zone->GetInstanceID(), hour, minute, second); } else if (minute) { - Message(15, "%s(%u) will expire in %u minutes, and %u seconds.", + Message(Chat::Yellow, "%s(%u) will expire in %u minutes, and %u seconds.", zone->GetLongName(), zone->GetInstanceID(), minute, second); } else { - Message(15, "%s(%u) will expire in in %u seconds.", + Message(Chat::Yellow, "%s(%u) will expire in in %u seconds.", zone->GetLongName(), zone->GetInstanceID(), second); } } @@ -948,7 +948,7 @@ void Client::Handle_Connect_OP_ClientError(const EQApplicationPacket *app) ClientError_Struct* error = (ClientError_Struct*)app->pBuffer; Log(Logs::General, Logs::Error, "Client error: %s", error->character_name); Log(Logs::General, Logs::Error, "Error message: %s", error->message); - Message(13, error->message); + Message(Chat::Red, error->message); #if (EQDEBUG>=5) DumpPacket(app); #endif @@ -1752,14 +1752,14 @@ void Client::Handle_OP_AAAction(const EQApplicationPacket *app) } else if (action->action == aaActionDisableEXP) { //Turn Off AA Exp if (m_epp.perAA > 0) - Message_StringID(0, AA_OFF); + Message_StringID(Chat::White, AA_OFF); m_epp.perAA = 0; SendAlternateAdvancementStats(); } else if (action->action == aaActionSetEXP) { if (m_epp.perAA == 0) - Message_StringID(0, AA_ON); + Message_StringID(Chat::White, AA_ON); m_epp.perAA = action->exp_value; if (m_epp.perAA < 0 || m_epp.perAA > 100) m_epp.perAA = 0; // stop exploit with sanity check @@ -1897,14 +1897,14 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) } } if (!item || !found) { - Message(13, "Error: The item you purchased does not exist!"); + Message(Chat::Red, "Error: The item you purchased does not exist!"); return; } if (aps->Type == LDoNMerchant) { if (m_pp.ldon_points_available < int32(item->LDoNPrice)) { - Message(13, "You cannot afford that item."); + Message(Chat::Red, "You cannot afford that item."); return; } @@ -1914,7 +1914,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) { if (m_pp.ldon_points_tak < int32(item->LDoNPrice)) { - Message(13, "You need at least %u points in tak to purchase this item.", int32(item->LDoNPrice)); + Message(Chat::Red, "You need at least %u points in tak to purchase this item.", int32(item->LDoNPrice)); return; } } @@ -1922,7 +1922,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) { if (m_pp.ldon_points_ruj < int32(item->LDoNPrice)) { - Message(13, "You need at least %u points in ruj to purchase this item.", int32(item->LDoNPrice)); + Message(Chat::Red, "You need at least %u points in ruj to purchase this item.", int32(item->LDoNPrice)); return; } } @@ -1930,7 +1930,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) { if (m_pp.ldon_points_mmc < int32(item->LDoNPrice)) { - Message(13, "You need at least %u points in mmc to purchase this item.", int32(item->LDoNPrice)); + Message(Chat::Red, "You need at least %u points in mmc to purchase this item.", int32(item->LDoNPrice)); return; } } @@ -1938,7 +1938,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) { if (m_pp.ldon_points_mir < int32(item->LDoNPrice)) { - Message(13, "You need at least %u points in mir to purchase this item.", int32(item->LDoNPrice)); + Message(Chat::Red, "You need at least %u points in mir to purchase this item.", int32(item->LDoNPrice)); return; } } @@ -1946,7 +1946,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) { if (m_pp.ldon_points_guk < int32(item->LDoNPrice)) { - Message(13, "You need at least %u points in guk to purchase this item.", int32(item->LDoNPrice)); + Message(Chat::Red, "You need at least %u points in guk to purchase this item.", int32(item->LDoNPrice)); return; } } @@ -1956,7 +1956,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) { if (GetPVPPoints() < item->LDoNPrice) { - Message(13, "You need at least %u PVP points to purchase this item.", int32(item->LDoNPrice)); + Message(Chat::Red, "You need at least %u PVP points to purchase this item.", int32(item->LDoNPrice)); return; } } @@ -1964,7 +1964,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) { if (GetRadiantCrystals() < item->LDoNPrice) { - Message(13, "You need at least %u Radiant Crystals to purchase this item.", int32(item->LDoNPrice)); + Message(Chat::Red, "You need at least %u Radiant Crystals to purchase this item.", int32(item->LDoNPrice)); return; } } @@ -1972,20 +1972,20 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) { if (GetEbonCrystals() < item->LDoNPrice) { - Message(13, "You need at least %u Ebon Crystals to purchase this item.", int32(item->LDoNPrice)); + Message(Chat::Red, "You need at least %u Ebon Crystals to purchase this item.", int32(item->LDoNPrice)); return; } } else { - Message(13, "Unknown Adventure Merchant type."); + Message(Chat::Red, "Unknown Adventure Merchant type."); return; } if (CheckLoreConflict(item)) { - Message(15, "You can only have one of a lore item."); + Message(Chat::Yellow, "You can only have one of a lore item."); return; } @@ -2128,13 +2128,13 @@ void Client::Handle_OP_AdventureMerchantSell(const EQApplicationPacket *app) if (vendor == 0 || !vendor->IsNPC() || ((vendor->GetClass() != ADVENTUREMERCHANT) && (vendor->GetClass() != NORRATHS_KEEPERS_MERCHANT) && (vendor->GetClass() != DARK_REIGN_MERCHANT))) { - Message(13, "Vendor was not found."); + Message(Chat::Red, "Vendor was not found."); return; } if (DistanceSquared(m_Position, vendor->GetPosition()) > USE_NPC_RANGE2) { - Message(13, "Vendor is out of range."); + Message(Chat::Red, "Vendor is out of range."); return; } @@ -2142,14 +2142,14 @@ void Client::Handle_OP_AdventureMerchantSell(const EQApplicationPacket *app) if (itemid == 0) { - Message(13, "Found no item at that slot."); + Message(Chat::Red, "Found no item at that slot."); return; } const EQEmu::ItemData* item = database.GetItem(itemid); EQEmu::ItemInstance* inst = GetInv().GetItem(ams_in->slot); if (!item || !inst) { - Message(13, "You seemed to have misplaced that item..."); + Message(Chat::Red, "You seemed to have misplaced that item..."); return; } @@ -2168,13 +2168,13 @@ void Client::Handle_OP_AdventureMerchantSell(const EQApplicationPacket *app) // that case here. if (item->LDoNSold == 0) { - Message(13, "The merchant does not want that item."); + Message(Chat::Red, "The merchant does not want that item."); return; } if (item->LDoNPrice == 0) { - Message(13, "The merchant does not want that item."); + Message(Chat::Red, "The merchant does not want that item."); return; } @@ -2183,7 +2183,7 @@ void Client::Handle_OP_AdventureMerchantSell(const EQApplicationPacket *app) if (price == 0) { - Message(13, "The merchant does not want that item."); + Message(Chat::Red, "The merchant does not want that item."); return; } @@ -2203,7 +2203,7 @@ void Client::Handle_OP_AdventureMerchantSell(const EQApplicationPacket *app) if (ams_in->charges == 0) { - Message(13, "Charge mismatch error."); + Message(Chat::Red, "Charge mismatch error."); return; } @@ -2523,18 +2523,18 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app) } if (!item || !found) { - Message(13, "Error: The item you purchased does not exist!"); + Message(Chat::Red, "Error: The item you purchased does not exist!"); return; } if (cost > current_currency) { - Message(13, "You cannot afford that item right now."); + Message(Chat::Red, "You cannot afford that item right now."); return; } if (CheckLoreConflict(item)) { - Message(15, "You can only have one of a lore item."); + Message(Chat::Yellow, "You can only have one of a lore item."); return; } @@ -2689,7 +2689,7 @@ void Client::Handle_OP_AltCurrencySell(const EQApplicationPacket *app) if (sell->charges == 0) { - Message(13, "Charge mismatch error."); + Message(Chat::Red, "Charge mismatch error."); return; } @@ -2834,7 +2834,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) if (poison->Proc.Level2 > GetLevel()) { // Poison is too high to apply. - Message_StringID(clientMessageTradeskill, POISON_TOO_HIGH); + Message_StringID(Chat::LightBlue, POISON_TOO_HIGH); } else if ((primary && primary->ItemType == EQEmu::item::ItemType1HPiercing) || @@ -2951,7 +2951,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) if ((in_augment->container_slot < EQEmu::invslot::EQUIPMENT_BEGIN || in_augment->container_slot > EQEmu::invslot::GENERAL_END) && (in_augment->container_slot < EQEmu::invbag::GENERAL_BAGS_BEGIN || in_augment->container_slot > EQEmu::invbag::GENERAL_BAGS_END)) { - Message(13, "The server does not allow augmentation actions from this slot."); + Message(Chat::Red, "The server does not allow augmentation actions from this slot."); auto cursor_item = m_inv[EQEmu::invslot::slotCursor]; auto augmented_item = m_inv[in_augment->container_slot]; SendItemPacket(EQEmu::invslot::slotCursor, cursor_item, ItemPacketCharInventory); @@ -2974,7 +2974,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) if (item_slot == INVALID_INDEX || solvent_slot == INVALID_INDEX) { - Message(13, "Error: Invalid Aug Index."); + Message(Chat::Red, "Error: Invalid Aug Index."); return; } @@ -2983,7 +2983,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) if (!tobe_auged) { - Message(13, "Error: Invalid item passed for augmenting."); + Message(Chat::Red, "Error: Invalid item passed for augmenting."); return; } @@ -2996,7 +2996,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) old_aug = tobe_auged->GetAugment(in_augment->augment_index); if (!old_aug || old_aug->GetItem()->AugDistiller != 0) { Log(Logs::General, Logs::Error, "Player tried to safely remove an augment without a distiller."); - Message(13, "Error: Missing an augmentation distiller for safely removing this augment."); + Message(Chat::Red, "Error: Missing an augmentation distiller for safely removing this augment."); return; } } @@ -3007,20 +3007,20 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) if (!old_aug) { Log(Logs::General, Logs::Error, "Player tried to safely remove a nonexistent augment."); - Message(13, "Error: No augment found in slot %i for safely removing.", in_augment->augment_index); + Message(Chat::Red, "Error: No augment found in slot %i for safely removing.", in_augment->augment_index); return; } else if (solvent->GetItem()->ID != old_aug->GetItem()->AugDistiller) { Log(Logs::General, Logs::Error, "Player tried to safely remove an augment with the wrong distiller (item %u vs expected %u).", solvent->GetItem()->ID, old_aug->GetItem()->AugDistiller); - Message(13, "Error: Wrong augmentation distiller for safely removing this augment."); + Message(Chat::Red, "Error: Wrong augmentation distiller for safely removing this augment."); return; } } else if (solvent->GetItem()->ItemType != EQEmu::item::ItemTypePerfectedAugmentationDistiller) { Log(Logs::General, Logs::Error, "Player tried to safely remove an augment with a non-distiller item."); - Message(13, "Error: Invalid augmentation distiller for safely removing this augment."); + Message(Chat::Red, "Error: Invalid augmentation distiller for safely removing this augment."); return; } } @@ -3034,7 +3034,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) if (!new_aug) // Shouldn't get the OP code without the augment on the user's cursor, but maybe it's h4x. { Log(Logs::General, Logs::Error, "AugmentItem OpCode with 'Insert' or 'Swap' action received, but no augment on client's cursor."); - Message(13, "Error: No augment found on cursor for inserting."); + Message(Chat::Red, "Error: No augment found on cursor for inserting."); return; } else @@ -3073,7 +3073,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) } else { - Message(13, "Error: Could not properly insert augmentation into augment slot %i. Aborting.", in_augment->augment_index); + Message(Chat::Red, "Error: Could not properly insert augmentation into augment slot %i. Aborting.", in_augment->augment_index); return; } @@ -3101,7 +3101,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) if (!PutItemInInventory(EQEmu::invslot::slotCursor, *itemTwoToPush, true)) { Log(Logs::General, Logs::Error, "Problem returning old augment to player's cursor after augmentation swap."); - Message(15, "Error: Failed to retrieve old augment after augmentation swap!"); + Message(Chat::Yellow, "Error: Failed to retrieve old augment after augmentation swap!"); } } @@ -3118,17 +3118,17 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) } else { - Message(13, "Error: No available slot for end result. Please free up the augment slot."); + Message(Chat::Red, "Error: No available slot for end result. Please free up the augment slot."); } } else { - Message(13, "Error in cloning item for augment. Aborted."); + Message(Chat::Red, "Error in cloning item for augment. Aborted."); } } else { - Message(13, "Error: No available slot for augment in that item."); + Message(Chat::Red, "Error: No available slot for augment in that item."); } } break; @@ -3148,7 +3148,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) } else { - Message(13, "Error: Could not find augmentation to remove at index %i. Aborting.", in_augment->augment_index); + Message(Chat::Red, "Error: Could not find augmentation to remove at index %i. Aborting.", in_augment->augment_index); return; } @@ -3172,7 +3172,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) if (!PutItemInInventory(item_slot, *itemOneToPush, true)) { Log(Logs::General, Logs::Error, "Problem returning equipment item to player's inventory after safe augment removal."); - Message(15, "Error: Failed to return item after de-augmentation!"); + Message(Chat::Yellow, "Error: Failed to return item after de-augmentation!"); } CalcBonuses(); @@ -3186,7 +3186,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) if (!PutItemInInventory(EQEmu::invslot::slotCursor, *itemTwoToPush, true)) { Log(Logs::General, Logs::Error, "Problem returning augment to player's cursor after safe removal."); - Message(15, "Error: Failed to return augment after removal from item!"); + Message(Chat::Yellow, "Error: Failed to return augment after removal from item!"); return; } } @@ -3211,7 +3211,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) } else { - Message(13, "Error: Could not find augmentation to remove at index %i. Aborting."); + Message(Chat::Red, "Error: Could not find augmentation to remove at index %i. Aborting."); return; } @@ -3226,7 +3226,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) if (!PutItemInInventory(item_slot, *itemOneToPush, true)) { Log(Logs::General, Logs::Error, "Problem returning equipment item to player's inventory after augment deletion."); - Message(15, "Error: Failed to return item after destroying augment!"); + Message(Chat::Yellow, "Error: Failed to return item after destroying augment!"); } } @@ -3470,7 +3470,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) else { Buf = (char *)app->pBuffer; VARSTRUCT_ENCODE_TYPE(uint32, Buf, Barter_BuyerModeOff); - Message(13, "You cannot be a Trader and Buyer at the same time."); + Message(Chat::Red, "You cannot be a Trader and Buyer at the same time."); } QueuePacket(app); break; @@ -3526,7 +3526,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) const EQEmu::ItemData* item = database.GetItem(bislr->ItemID); if (!item) - Message(13, "Error: This item does not exist!"); + Message(Chat::Red, "Error: This item does not exist!"); else { EQEmu::ItemInstance* inst = database.CreateItem(item); @@ -3559,7 +3559,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) const EQEmu::ItemData* item = database.GetItem(bislr->ItemID); if (!item) - Message(13, "Error: This item does not exist!"); + Message(Chat::Red, "Error: This item does not exist!"); else { EQEmu::ItemInstance* inst = database.CreateItem(item); @@ -3579,7 +3579,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) } default: - Message(13, "Unrecognised Barter action."); + Message(Chat::Red, "Unrecognised Barter action."); Log(Logs::Detail, Logs::Trading, "Unrecognised Barter Action %i", Action); } @@ -3598,7 +3598,7 @@ void Client::Handle_OP_BazaarInspect(const EQApplicationPacket *app) const EQEmu::ItemData* item = database.GetItem(bis->ItemID); if (!item) { - Message(13, "Error: This item does not exist!"); + Message(Chat::Red, "Error: This item does not exist!"); return; } @@ -3653,7 +3653,7 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app) { if (!p_timers.Expired(&database, pTimerBeggingPickPocket, false)) { - Message(13, "Ability recovery time not yet met."); + Message(Chat::Red, "Ability recovery time not yet met."); auto outapp = new EQApplicationPacket(OP_Begging, sizeof(BeggingResponse_Struct)); BeggingResponse_Struct *brs = (BeggingResponse_Struct*)outapp->pBuffer; @@ -4023,8 +4023,8 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) return; } if (IsAIControlled()) { - this->Message_StringID(13, NOT_IN_CONTROL); - //Message(13, "You cant cast right now, you arent in control of yourself!"); + this->Message_StringID(Chat::Red, NOT_IN_CONTROL); + //Message(Chat::Red, "You cant cast right now, you arent in control of yourself!"); return; } @@ -4139,7 +4139,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) if (castspell->spell_id == SPELL_LAY_ON_HANDS && GetClass() == PALADIN) { if (!p_timers.Expired(&database, pTimerLayHands)) { - Message(13, "Ability recovery time not yet met."); + Message(Chat::Red, "Ability recovery time not yet met."); InterruptSpell(castspell->spell_id); return; } @@ -4149,7 +4149,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) else if ((castspell->spell_id == SPELL_HARM_TOUCH || castspell->spell_id == SPELL_HARM_TOUCH2) && GetClass() == SHADOWKNIGHT) { if (!p_timers.Expired(&database, pTimerHarmTouch)) { - Message(13, "Ability recovery time not yet met."); + Message(Chat::Red, "Ability recovery time not yet met."); InterruptSpell(castspell->spell_id); return; } @@ -4178,7 +4178,7 @@ void Client::Handle_OP_ChannelMessage(const EQApplicationPacket *app) return; } if (IsAIControlled()) { - Message(13, "You try to speak but cant move your mouth!"); + Message(Chat::Red, "You try to speak but cant move your mouth!"); return; } @@ -4625,7 +4625,7 @@ void Client::Handle_OP_Consent(const EQApplicationPacket *app) safe_delete(pack); } else { - Message_StringID(0, CONSENT_YOURSELF); + Message_StringID(Chat::White, CONSENT_YOURSELF); } } return; @@ -4664,7 +4664,7 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app) if (tmob->GetClass() == LDON_TREASURE) { - Message(15, "%s", tmob->GetCleanName()); + Message(Chat::Yellow, "%s", tmob->GetCleanName()); return; } @@ -4765,10 +4765,10 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app) // this could be done better, but this is only called when you con so w/e // Shroud of Stealth has a special message if (improved_hidden && (!tmob->see_improved_hide && (tmob->see_invis || tmob->see_hide))) - Message_StringID(10, SOS_KEEPS_HIDDEN); + Message_StringID(Chat::NPCQuestSay, SOS_KEEPS_HIDDEN); // we are trying to hide but they can see us else if ((invisible || invisible_undead || hidden || invisible_animals) && !IsInvisible(tmob)) - Message_StringID(10, SUSPECT_SEES_YOU); + Message_StringID(Chat::NPCQuestSay, SUSPECT_SEES_YOU); safe_delete(outapp); @@ -4791,10 +4791,10 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app) min = (ttime / 60000) % 60; // Total seconds / 60 drop .00 char val1[20] = { 0 }; char val2[20] = { 0 }; - Message_StringID(10, CORPSE_DECAY1, ConvertArray(min, val1), ConvertArray(sec, val2)); + Message_StringID(Chat::NPCQuestSay, CORPSE_DECAY1, ConvertArray(min, val1), ConvertArray(sec, val2)); } else { - Message_StringID(10, CORPSE_DECAY_NOW); + Message_StringID(Chat::NPCQuestSay, CORPSE_DECAY_NOW); } } else if (tcorpse && tcorpse->IsPlayerCorpse()) { @@ -4825,12 +4825,12 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app) Message(0, "This corpse can be resurrected for %i minutes and %i seconds.", min, sec); } else { - Message_StringID(0, CORPSE_TOO_OLD); + Message_StringID(Chat::WhiteSmoke, CORPSE_TOO_OLD); } */ } else { - Message_StringID(10, CORPSE_DECAY_NOW); + Message_StringID(Chat::NPCQuestSay, CORPSE_DECAY_NOW); } } } @@ -4932,7 +4932,7 @@ void Client::Handle_OP_ControlBoat(const EQApplicationPacket *app) boat->SetTarget(this); } else { - this->Message_StringID(13, IN_USE); + this->Message_StringID(Chat::Red, IN_USE); return; } } @@ -4950,7 +4950,7 @@ void Client::Handle_OP_CorpseDrag(const EQApplicationPacket *app) { if (DraggedCorpses.size() >= (unsigned int)RuleI(Character, MaxDraggedCorpses)) { - Message_StringID(13, CORPSEDRAG_LIMIT); + Message_StringID(Chat::Red, CORPSEDRAG_LIMIT); return; } @@ -4968,9 +4968,9 @@ void Client::Handle_OP_CorpseDrag(const EQApplicationPacket *app) if (c) { if (c == this) - Message_StringID(MT_DefaultText, CORPSEDRAG_ALREADY, corpse->GetCleanName()); + Message_StringID(Chat::DefaultText, CORPSEDRAG_ALREADY, corpse->GetCleanName()); else - Message_StringID(MT_DefaultText, CORPSEDRAG_SOMEONE_ELSE, corpse->GetCleanName()); + Message_StringID(Chat::DefaultText, CORPSEDRAG_SOMEONE_ELSE, corpse->GetCleanName()); return; } @@ -4980,14 +4980,14 @@ void Client::Handle_OP_CorpseDrag(const EQApplicationPacket *app) DraggedCorpses.push_back(std::pair(cds->CorpseName, corpse->GetID())); - Message_StringID(MT_DefaultText, CORPSEDRAG_BEGIN, cds->CorpseName); + Message_StringID(Chat::DefaultText, CORPSEDRAG_BEGIN, cds->CorpseName); } void Client::Handle_OP_CorpseDrop(const EQApplicationPacket *app) { if (app->size == 1) { - Message_StringID(MT_DefaultText, CORPSEDRAG_STOPALL); + Message_StringID(Chat::DefaultText, CORPSEDRAG_STOPALL); ClearDraggedCorpses(); return; } @@ -4996,7 +4996,7 @@ void Client::Handle_OP_CorpseDrop(const EQApplicationPacket *app) { if (!strcasecmp(Iterator->first.c_str(), (const char *)app->pBuffer)) { - Message_StringID(MT_DefaultText, CORPSEDRAG_STOP); + Message_StringID(Chat::DefaultText, CORPSEDRAG_STOP); Iterator = DraggedCorpses.erase(Iterator); return; } @@ -5227,7 +5227,7 @@ void Client::Handle_OP_Disarm(const EQApplicationPacket *app) { Disarm_Struct *disarm = (Disarm_Struct *)app->pBuffer; if (!p_timers.Expired(&database, pTimerCombatAbility2, false)) { - Message(13, "Ability recovery time not yet met."); + Message(Chat::Red, "Ability recovery time not yet met."); return; } @@ -5300,7 +5300,7 @@ void Client::Handle_OP_Disarm(const EQApplicationPacket *app) { return; } // Trying to disarm something we can't disarm - Message_StringID(MT_Skills, DISARM_NO_TARGET); + Message_StringID(Chat::Skills, DISARM_NO_TARGET); return; } @@ -5334,7 +5334,7 @@ void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app) return; if (!p_timers.Expired(&database, pTimerDisarmTraps, false)) { - Message(13, "Ability recovery time not yet met."); + Message(Chat::Red, "Ability recovery time not yet met."); return; } @@ -5358,14 +5358,14 @@ void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app) if ((zone->random.Int(0, 49) + uskill) >= (zone->random.Int(0, 49) + trap->skill)) { success = SKILLUP_SUCCESS; - Message_StringID(MT_Skills, DISARMED_TRAP); + Message_StringID(Chat::Skills, DISARMED_TRAP); trap->disarmed = true; Log(Logs::General, Logs::Traps, "Trap %d is disarmed.", trap->trap_id); trap->UpdateTrap(); } else { - Message_StringID(MT_Skills, FAIL_DISARM_DETECTED_TRAP); + Message_StringID(Chat::Skills, FAIL_DISARM_DETECTED_TRAP); if (zone->random.Int(0, 99) < 25) { trap->Trigger(this); } @@ -5375,12 +5375,12 @@ void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app) } else { - Message_StringID(MT_Skills, TRAP_TOO_FAR); + Message_StringID(Chat::Skills, TRAP_TOO_FAR); } } else { - Message_StringID(MT_Skills, LDON_SENSE_TRAP2); + Message_StringID(Chat::Skills, LDON_SENSE_TRAP2); } return; @@ -5464,9 +5464,9 @@ void Client::Handle_OP_DuelResponse(const EQApplicationPacket *app) initiator->CastToClient()->SetDuelTarget(0); initiator->CastToClient()->SetDueling(false); if (GetID() == initiator->GetID()) - entity->CastToClient()->Message_StringID(10, DUEL_DECLINE, initiator->GetName()); + entity->CastToClient()->Message_StringID(Chat::NPCQuestSay, DUEL_DECLINE, initiator->GetName()); else - initiator->CastToClient()->Message_StringID(10, DUEL_DECLINE, entity->GetName()); + initiator->CastToClient()->Message_StringID(Chat::NPCQuestSay, DUEL_DECLINE, entity->GetName()); return; } @@ -5589,7 +5589,7 @@ void Client::Handle_OP_EndLootRequest(const EQApplicationPacket *app) Entity* entity = entity_list.GetID(*((uint16*)app->pBuffer)); if (entity == 0) { - Message(13, "Error: OP_EndLootRequest: Corpse not found (ent = 0)"); + Message(Chat::Red, "Error: OP_EndLootRequest: Corpse not found (ent = 0)"); if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD) Corpse::SendEndLootErrorPacket(this); else @@ -5597,7 +5597,7 @@ void Client::Handle_OP_EndLootRequest(const EQApplicationPacket *app) return; } else if (!entity->IsCorpse()) { - Message(13, "Error: OP_EndLootRequest: Corpse not found (!entity->IsCorpse())"); + Message(Chat::Red, "Error: OP_EndLootRequest: Corpse not found (!entity->IsCorpse())"); Corpse::SendLootReqErrorPacket(this); return; } @@ -5636,12 +5636,12 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app) damage = 31337; if (admin >= minStatusToAvoidFalling && GetGM()) { - Message(13, "Your GM status protects you from %i points of type %i environmental damage.", ed->damage, ed->dmgtype); + Message(Chat::Red, "Your GM status protects you from %i points of type %i environmental damage.", ed->damage, ed->dmgtype); SetHP(GetHP() - 1);//needed or else the client wont acknowledge return; } else if (GetInvul()) { - Message(13, "Your invuln status protects you from %i points of type %i environmental damage.", ed->damage, ed->dmgtype); + Message(Chat::Red, "Your invuln status protects you from %i points of type %i environmental damage.", ed->damage, ed->dmgtype); SetHP(GetHP() - 1);//needed or else the client wont acknowledge return; } @@ -5690,8 +5690,8 @@ void Client::Handle_OP_FaceChange(const EQApplicationPacket *app) m_pp.drakkin_tattoo = fc->drakkin_tattoo; m_pp.drakkin_details = fc->drakkin_details; Save(); - Message_StringID(13, FACE_ACCEPTED); - //Message(13, "Facial features updated."); + Message_StringID(Chat::Red, FACE_ACCEPTED); + //Message(Chat::Red, "Facial features updated."); return; } @@ -5700,7 +5700,7 @@ void Client::Handle_OP_FeignDeath(const EQApplicationPacket *app) if (GetClass() != MONK) return; if (!p_timers.Expired(&database, pTimerFeignDeath, false)) { - Message(13, "Ability recovery time not yet met."); + Message(Chat::Red, "Ability recovery time not yet met."); return; } @@ -5756,7 +5756,7 @@ void Client::Handle_OP_FindPersonRequest(const EQApplicationPacket *app) if (!RuleB(Pathing, Find) && RuleB(Bazaar, EnableWarpToTrader) && target->IsClient() && (target->CastToClient()->Trader || target->CastToClient()->Buyer)) { - Message(15, "Moving you to Trader %s", target->GetName()); + Message(Chat::Yellow, "Moving you to Trader %s", target->GetName()); MovePC(zone->GetZoneID(), zone->GetInstanceID(), target->GetX(), target->GetY(), target->GetZ(), 0.0f); } @@ -5849,7 +5849,7 @@ void Client::Handle_OP_FindPersonRequest(const EQApplicationPacket *app) void Client::Handle_OP_Fishing(const EQApplicationPacket *app) { if (!p_timers.Expired(&database, pTimerFishing, false)) { - Message(13, "Ability recovery time not yet met."); + Message(Chat::Red, "Ability recovery time not yet met."); return; } @@ -5869,7 +5869,7 @@ void Client::Handle_OP_Forage(const EQApplicationPacket *app) { if (!p_timers.Expired(&database, pTimerForaging, false)) { - Message(13, "Ability recovery time not yet met."); + Message(Chat::Red, "Ability recovery time not yet met."); return; } p_timers.Start(pTimerForaging, ForagingReuseTime - 1); @@ -5909,7 +5909,7 @@ void Client::Handle_OP_GetGuildsList(const EQApplicationPacket *app) void Client::Handle_OP_GMBecomeNPC(const EQApplicationPacket *app) { if (this->Admin() < minStatusToUseGMCommands) { - Message(13, "Your account has been reported for hacking."); + Message(Chat::Red, "Your account has been reported for hacking."); database.SetHackerFlag(this->account_name, this->name, "/becomenpc"); return; } @@ -5929,7 +5929,7 @@ void Client::Handle_OP_GMBecomeNPC(const EQApplicationPacket *app) cli->SendAppearancePacket(AT_NPCName, 1, true); cli->CastToClient()->SetBecomeNPC(true); cli->CastToClient()->SetBecomeNPCLevel(bnpc->maxlevel); - cli->Message_StringID(0, TOGGLE_OFF); + cli->Message_StringID(Chat::White, TOGGLE_OFF); cli->CastToClient()->tellsoff = true; //TODO: Make this toggle a BecomeNPC flag so that it gets updated when people zone in as well; Make combat work with this. return; @@ -5940,7 +5940,7 @@ void Client::Handle_OP_GMDelCorpse(const EQApplicationPacket *app) if (app->size != sizeof(GMDelCorpse_Struct)) return; if (this->Admin() < commandEditPlayerCorpses) { - Message(13, "Your account has been reported for hacking."); + Message(Chat::Red, "Your account has been reported for hacking."); database.SetHackerFlag(this->account_name, this->name, "/delcorpse"); return; } @@ -5954,14 +5954,14 @@ void Client::Handle_OP_GMDelCorpse(const EQApplicationPacket *app) } corpse->CastToCorpse()->Delete(); std::cout << name << " deleted corpse " << dc->corpsename << std::endl; - Message(13, "Corpse %s deleted.", dc->corpsename); + Message(Chat::Red, "Corpse %s deleted.", dc->corpsename); return; } void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app) { if (this->Admin() < minStatusToUseGMCommands) { - Message(13, "Your account has been reported for hacking."); + Message(Chat::Red, "Your account has been reported for hacking."); database.SetHackerFlag(this->account_name, this->name, "/emote"); return; } @@ -5994,7 +5994,7 @@ void Client::Handle_OP_GMEndTraining(const EQApplicationPacket *app) void Client::Handle_OP_GMFind(const EQApplicationPacket *app) { if (this->Admin() < minStatusToUseGMCommands) { - Message(13, "Your account has been reported for hacking."); + Message(Chat::Red, "Your account has been reported for hacking."); database.SetHackerFlag(this->account_name, this->name, "/find"); return; } @@ -6032,7 +6032,7 @@ void Client::Handle_OP_GMGoto(const EQApplicationPacket *app) return; } if (this->Admin() < minStatusToUseGMCommands) { - Message(13, "Your account has been reported for hacking."); + Message(Chat::Red, "Your account has been reported for hacking."); database.SetHackerFlag(this->account_name, this->name, "/goto"); return; } @@ -6059,7 +6059,7 @@ void Client::Handle_OP_GMGoto(const EQApplicationPacket *app) void Client::Handle_OP_GMHideMe(const EQApplicationPacket *app) { if (this->Admin() < minStatusToUseGMCommands) { - Message(13, "Your account has been reported for hacking."); + Message(Chat::Red, "Your account has been reported for hacking."); database.SetHackerFlag(this->account_name, this->name, "/hideme"); return; } @@ -6068,7 +6068,7 @@ void Client::Handle_OP_GMHideMe(const EQApplicationPacket *app) return; } SpawnAppearance_Struct* sa = (SpawnAppearance_Struct*)app->pBuffer; - Message(13, "#: %i, %i", sa->type, sa->parameter); + Message(Chat::Red, "#: %i, %i", sa->type, sa->parameter); SetHideMe(!sa->parameter); return; @@ -6079,7 +6079,7 @@ void Client::Handle_OP_GMKick(const EQApplicationPacket *app) if (app->size != sizeof(GMKick_Struct)) return; if (this->Admin() < minStatusToKick) { - Message(13, "Your account has been reported for hacking."); + Message(Chat::Red, "Your account has been reported for hacking."); database.SetHackerFlag(this->account_name, this->name, "/kick"); return; } @@ -6109,7 +6109,7 @@ void Client::Handle_OP_GMKick(const EQApplicationPacket *app) void Client::Handle_OP_GMKill(const EQApplicationPacket *app) { if (this->Admin() < minStatusToUseGMCommands) { - Message(13, "Your account has been reported for hacking."); + Message(Chat::Red, "Your account has been reported for hacking."); database.SetHackerFlag(this->account_name, this->name, "/kill"); return; } @@ -6152,16 +6152,16 @@ void Client::Handle_OP_GMLastName(const EQApplicationPacket *app) } GMLastName_Struct* gmln = (GMLastName_Struct*)app->pBuffer; if (strlen(gmln->lastname) >= 64) { - Message(13, "/LastName: New last name too long. (max=63)"); + Message(Chat::Red, "/LastName: New last name too long. (max=63)"); } else { Client* client = entity_list.GetClientByName(gmln->name); if (client == 0) { - Message(13, "/LastName: %s not found", gmln->name); + Message(Chat::Red, "/LastName: %s not found", gmln->name); } else { if (this->Admin() < minStatusToUseGMCommands) { - Message(13, "Your account has been reported for hacking."); + Message(Chat::Red, "Your account has been reported for hacking."); database.SetHackerFlag(client->account_name, client->name, "/lastname"); return; } @@ -6186,7 +6186,7 @@ void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app) } const GMName_Struct* gmn = (const GMName_Struct *)app->pBuffer; if (this->Admin() < minStatusToUseGMCommands) { - Message(13, "Your account has been reported for hacking."); + Message(Chat::Red, "Your account has been reported for hacking."); database.SetHackerFlag(this->account_name, this->name, "/name"); return; } @@ -6194,15 +6194,15 @@ void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app) Log(Logs::General, Logs::Status, "GM(%s) changeing players name. Old:%s New:%s", GetName(), gmn->oldname, gmn->newname); bool usedname = database.CheckUsedName((const char*)gmn->newname); if (client == 0) { - Message(13, "%s not found for name change. Operation failed!", gmn->oldname); + Message(Chat::Red, "%s not found for name change. Operation failed!", gmn->oldname); return; } if ((strlen(gmn->newname) > 63) || (strlen(gmn->newname) == 0)) { - Message(13, "Invalid number of characters in new name (%s).", gmn->newname); + Message(Chat::Red, "Invalid number of characters in new name (%s).", gmn->newname); return; } if (!usedname) { - Message(13, "%s is already in use. Operation failed!", gmn->newname); + Message(Chat::Red, "%s is already in use. Operation failed!", gmn->newname); return; } @@ -6258,9 +6258,9 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app) return; if (results.RowCount() == maxResults) - Message(clientMessageError, "Your search found too many results; some are not displayed."); + Message(Chat::Red, "Your search found too many results; some are not displayed."); else - Message(clientMessageYellow, "There are %i corpse(s) that match the search string '%s'.", results.RowCount(), gmscs->Name); + Message(Chat::Yellow, "There are %i corpse(s) that match the search string '%s'.", results.RowCount(), gmscs->Name); char charName[64], time_of_death[20]; @@ -6287,7 +6287,7 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app) corpseRezzed ? "Yes" : "No", corpseBuried ? "Yes" : "No"); if (popupText.size() > 4000) { - Message(clientMessageError, "Unable to display all the results."); + Message(Chat::Red, "Unable to display all the results."); break; } @@ -6330,19 +6330,19 @@ void Client::Handle_OP_GMToggle(const EQApplicationPacket *app) return; } if (this->Admin() < minStatusToUseGMCommands) { - Message(13, "Your account has been reported for hacking."); + Message(Chat::Red, "Your account has been reported for hacking."); database.SetHackerFlag(this->account_name, this->name, "/toggle"); return; } GMToggle_Struct *ts = (GMToggle_Struct *)app->pBuffer; if (ts->toggle == 0) { - this->Message_StringID(0, TOGGLE_OFF); + this->Message_StringID(Chat::White, TOGGLE_OFF); //Message(0, "Turning tells OFF"); tellsoff = true; } else if (ts->toggle == 1) { //Message(0, "Turning tells ON"); - this->Message_StringID(0, TOGGLE_ON); + this->Message_StringID(Chat::White, TOGGLE_ON); tellsoff = false; } else { @@ -6381,7 +6381,7 @@ void Client::Handle_OP_GMZoneRequest(const EQApplicationPacket *app) return; } if (this->Admin() < minStatusToBeGM) { - Message(13, "Your account has been reported for hacking."); + Message(Chat::Red, "Your account has been reported for hacking."); database.SetHackerFlag(this->account_name, this->name, "/zone"); return; } @@ -6429,7 +6429,7 @@ void Client::Handle_OP_GMZoneRequest(const EQApplicationPacket *app) void Client::Handle_OP_GMZoneRequest2(const EQApplicationPacket *app) { if (this->Admin() < minStatusToBeGM) { - Message(13, "Your account has been reported for hacking."); + Message(Chat::Red, "Your account has been reported for hacking."); database.SetHackerFlag(this->account_name, this->name, "/zone"); return; } @@ -6736,7 +6736,7 @@ void Client::Handle_OP_GroupInvite2(const EQApplicationPacket *app) if (Invitee == this) { - Message_StringID(clientMessageWhite, GROUP_INVITEE_SELF); + Message_StringID(Chat::LightGray, GROUP_INVITEE_SELF); return; } @@ -6928,7 +6928,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) if ((int)zone->GetZoneID() != RuleI(World, GuildBankZoneID)) { - Message(13, "The Guild Bank is not available in this zone."); + Message(Chat::Red, "The Guild Bank is not available in this zone."); return; } @@ -6946,7 +6946,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) if (!IsInAGuild()) { - Message(13, "You must be in a Guild to use the Guild Bank."); + Message(Chat::Red, "You must be in a Guild to use the Guild Bank."); if (Action == GuildBankDeposit) GuildBankDepositAck(true, sentAction); @@ -6974,7 +6974,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { if (GuildBanks->IsAreaFull(GuildID(), GuildBankMainArea)) { - Message_StringID(13, GUILD_BANK_FULL); + Message_StringID(Chat::Red, GUILD_BANK_FULL); GuildBankDepositAck(true, sentAction); @@ -6991,12 +6991,12 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) if (inst) { - Message_StringID(clientMessageWhite, GUILD_BANK_TRANSFERRED, inst->GetItem()->Name); + Message_StringID(Chat::LightGray, GUILD_BANK_TRANSFERRED, inst->GetItem()->Name); safe_delete(inst); } } else - Message(13, "Unexpected error while moving item into Guild Bank."); + Message(Chat::Red, "Unexpected error while moving item into Guild Bank."); GuildBankAck(); @@ -7023,7 +7023,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { if (GuildBanks->IsAreaFull(GuildID(), GuildBankDepositArea)) { - Message_StringID(13, GUILD_BANK_FULL); + Message_StringID(Chat::Red, GUILD_BANK_FULL); GuildBankDepositAck(true, sentAction); @@ -7036,7 +7036,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) if (!CursorItemInst) { - Message(13, "No Item on the cursor."); + Message(Chat::Red, "No Item on the cursor."); GuildBankDepositAck(true, sentAction); @@ -7068,7 +7068,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) if (!Allowed) { - Message_StringID(13, GUILD_BANK_CANNOT_DEPOSIT); + Message_StringID(Chat::Red, GUILD_BANK_CANNOT_DEPOSIT); GuildBankDepositAck(true, sentAction); return; @@ -7101,7 +7101,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { if (GetInv()[EQEmu::invslot::slotCursor]) { - Message_StringID(13, GUILD_BANK_EMPTY_HANDS); + Message_StringID(Chat::Red, GUILD_BANK_EMPTY_HANDS); GuildBankAck(); @@ -7132,7 +7132,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) if (CheckLoreConflict(inst->GetItem())) { - Message_StringID(13, DUP_LORE); + Message_StringID(Chat::Red, DUP_LORE); GuildBankAck(); @@ -7164,7 +7164,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) case GuildBankSplitStacks: { if (GuildBanks->IsAreaFull(GuildID(), GuildBankMainArea)) - Message_StringID(13, GUILD_BANK_FULL); + Message_StringID(Chat::Red, GUILD_BANK_FULL); else { GuildBankWithdrawItem_Struct *gbwis = (GuildBankWithdrawItem_Struct*)app->pBuffer; @@ -7190,7 +7190,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) default: { - Message(13, "Unexpected GuildBank action."); + Message(Chat::Red, "Unexpected GuildBank action."); Log(Logs::General, Logs::Error, "Received unexpected guild bank action code %i from %s", Action, GetName()); } @@ -7201,13 +7201,13 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) { if (IsInAGuild()) { - Message(clientMessageError, "You are already in a guild!"); + Message(Chat::Red, "You are already in a guild!"); return; } if (!RuleB(Guild, PlayerCreationAllowed)) { - Message(clientMessageError, "This feature is disabled on this server. Contact a GM or post on your server message boards to create a guild."); + Message(Chat::Red, "This feature is disabled on this server. Contact a GM or post on your server message boards to create a guild."); return; } @@ -7215,7 +7215,7 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) (GetLevel() < RuleI(Guild, PlayerCreationRequiredLevel)) || (database.GetTotalTimeEntitledOnAccount(AccountID()) < (unsigned int)RuleI(Guild, PlayerCreationRequiredTime))) { - Message(clientMessageError, "Your status, level or time playing on this account are insufficient to use this feature."); + Message(Chat::Red, "Your status, level or time playing on this account are insufficient to use this feature."); return; } @@ -7234,7 +7234,7 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) if (strnlen(GuildName, 64) > 60) #endif // DARWIN { - Message(clientMessageError, "Guild name too long."); + Message(Chat::Red, "Guild name too long."); return; } @@ -7242,7 +7242,7 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) { if (!isalpha(GuildName[i]) && (GuildName[i] != ' ')) { - Message(clientMessageError, "Invalid character in Guild name."); + Message(Chat::Red, "Invalid character in Guild name."); return; } } @@ -7251,13 +7251,13 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) if (GuildCount >= RuleI(Guild, PlayerCreationLimit)) { - Message(clientMessageError, "You cannot create this guild because this account may only be leader of %i guilds.", RuleI(Guild, PlayerCreationLimit)); + Message(Chat::Red, "You cannot create this guild because this account may only be leader of %i guilds.", RuleI(Guild, PlayerCreationLimit)); return; } if (guild_mgr.GetGuildIDByName(GuildName) != GUILD_NONE) { - Message_StringID(clientMessageError, GUILD_NAME_IN_USE); + Message_StringID(Chat::Red, GUILD_NAME_IN_USE); return; } @@ -7267,14 +7267,14 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) GuildName, CharacterID(), (unsigned long)NewGuildID); if (NewGuildID == GUILD_NONE) - Message(clientMessageError, "Guild creation failed."); + Message(Chat::Red, "Guild creation failed."); else { if (!guild_mgr.SetGuild(CharacterID(), NewGuildID, GUILD_LEADER)) - Message(clientMessageError, "Unable to set guild leader's guild in the database. Contact a GM."); + Message(Chat::Red, "Unable to set guild leader's guild in the database. Contact a GM."); else { - Message(clientMessageYellow, "You are now the leader of %s", GuildName); + Message(Chat::Yellow, "You are now the leader of %s", GuildName); if (zone->GetZoneID() == RuleI(World, GuildBankZoneID) && GuildBanks) GuildBanks->SendGuildBank(this); @@ -7341,7 +7341,7 @@ void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) guild_mgr.GetGuildName(GuildID()), GuildID()); if (!guild_mgr.SetGuildRank(gci.char_id, rank)) { - Message(13, "Error while setting rank %d on '%s'.", rank, demote->target); + Message(Chat::Red, "Error while setting rank %d on '%s'.", rank, demote->target); return; } Message(0, "Successfully demoted %s to rank %d", demote->target, rank); @@ -7364,7 +7364,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) if (!IsInAGuild()) Message(0, "Error: You are not in a guild!"); else if (gc->officer > GUILD_MAX_RANK) - Message(13, "Invalid rank."); + Message(Chat::Red, "Invalid rank."); else if (!worldserver.Connected()) Message(0, "Error: World server disconnected"); else { @@ -7373,7 +7373,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) Mob* invitee = entity_list.GetMob(gc->othername); if (!invitee) { - Message(13, "Prospective guild member %s must be in zone to preform guild operations on them.", gc->othername); + Message(Chat::Red, "Prospective guild member %s must be in zone to preform guild operations on them.", gc->othername); return; } @@ -7386,7 +7386,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) if (gc->officer < client->GuildRank()) { //demotion if (!guild_mgr.CheckPermission(GuildID(), GuildRank(), GUILD_DEMOTE)) { - Message(13, "You dont have permission to demote."); + Message(Chat::Red, "You dont have permission to demote."); return; } @@ -7400,7 +7400,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) guild_mgr.GetGuildName(GuildID()), GuildID()); if (!guild_mgr.SetGuildRank(client->CharacterID(), gc->officer)) { - Message(13, "There was an error during the demotion, DB may now be inconsistent."); + Message(Chat::Red, "There was an error during the demotion, DB may now be inconsistent."); return; } @@ -7408,7 +7408,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) else if (gc->officer > client->GuildRank()) { //promotion if (!guild_mgr.CheckPermission(GuildID(), GuildRank(), GUILD_PROMOTE)) { - Message(13, "You dont have permission to demote."); + Message(Chat::Red, "You dont have permission to demote."); return; } @@ -7429,7 +7429,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) } else { - Message(13, "That member is already that rank."); + Message(Chat::Red, "That member is already that rank."); return; } } @@ -7438,12 +7438,12 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) // if (client->GetPendingGuildInvitation()) { - Message(13, "That person is already considering a guild invitation."); + Message(Chat::Red, "That person is already considering a guild invitation."); return; } if (!guild_mgr.CheckPermission(GuildID(), GuildRank(), GUILD_INVITE)) { - Message(13, "You dont have permission to invite."); + Message(Chat::Red, "You dont have permission to invite."); return; } @@ -7474,7 +7474,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) } else { //they are in some other guild - Message(13, "Player is in a guild."); + Message(Chat::Red, "Player is in a guild."); return; } } @@ -7551,7 +7551,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) //it has been authorized with the guild manager if (!guild_mgr.VerifyAndClearInvite(CharacterID(), gj->guildeqid, guildrank)) { worldserver.SendEmoteMessage(gj->inviter, 0, 0, "%s has sent an invalid response to your invite!", GetName()); - Message(13, "Invalid invite response packet!"); + Message(Chat::Red, "Invalid invite response packet!"); return; } @@ -7564,7 +7564,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) guild_mgr.GetGuildName(GuildID()), GuildID()); if (!guild_mgr.SetGuildRank(CharacterID(), gj->response)) { - Message(13, "There was an error during the rank change, DB may now be inconsistent."); + Message(Chat::Red, "There was an error during the rank change, DB may now be inconsistent."); return; } } @@ -7588,7 +7588,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) } if (!guild_mgr.SetGuild(CharacterID(), gj->guildeqid, guildrank)) { - Message(13, "There was an error during the invite, DB may now be inconsistent."); + Message(Chat::Red, "There was an error during the invite, DB may now be inconsistent."); return; } if (zone->GetZoneID() == RuleI(World, GuildBankZoneID) && GuildBanks) @@ -7627,7 +7627,7 @@ void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app) if (guild_mgr.SetGuildLeader(GuildID(), newleader->CharacterID())) { Message(0, "Successfully Transfered Leadership to %s.", gml->target); - newleader->Message(15, "%s has transfered the guild leadership into your hands.", GetName()); + newleader->Message(Chat::Yellow, "%s has transfered the guild leadership into your hands.", GetName()); } else Message(0, "Could not change leadership at this time."); @@ -7650,7 +7650,7 @@ void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app) GuildManageBanker_Struct* gmb = (GuildManageBanker_Struct*)app->pBuffer; if (!IsInAGuild()) { - Message(13, "Your not in a guild!"); + Message(Chat::Red, "Your not in a guild!"); return; } @@ -7671,7 +7671,7 @@ void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app) if ((IsCurrentlyABanker != NewBankerStatus) && !guild_mgr.IsGuildLeader(GuildID(), CharacterID())) { - Message(13, "Only the guild leader can assign guild bankers!"); + Message(Chat::Red, "Only the guild leader can assign guild bankers!"); return; } @@ -7681,7 +7681,7 @@ void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app) if (!IsAllowed) { - Message(13, "You are not allowed to change the alt status of %s", gmb->member); + Message(Chat::Red, "You are not allowed to change the alt status of %s", gmb->member); return; } } @@ -7694,7 +7694,7 @@ void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app) if (IsCurrentlyABanker != NewBankerStatus) { if (!guild_mgr.SetBankerFlag(gci.char_id, NewBankerStatus)) { - Message(13, "Error setting guild banker flag."); + Message(Chat::Red, "Error setting guild banker flag."); return; } @@ -7706,7 +7706,7 @@ void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app) if (IsCurrentlyAnAlt != NewAltStatus) { if (!guild_mgr.SetAltFlag(gci.char_id, NewAltStatus)) { - Message(13, "Error setting guild alt flag."); + Message(Chat::Red, "Error setting guild alt flag."); return; } @@ -7767,7 +7767,7 @@ void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) guild_mgr.GetGuildName(GuildID()), GuildID()); if (!guild_mgr.SetGuildRank(gci.char_id, rank)) { - Message(13, "Error while setting rank %d on '%s'.", rank, promote->target); + Message(Chat::Red, "Error while setting rank %d on '%s'.", rank, promote->target); return; } Message(0, "Successfully promoted %s to rank %d", promote->target, rank); @@ -7802,7 +7802,7 @@ void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) gpn->note); if (!guild_mgr.SetPublicNote(gci.char_id, gpn->note)) { - Message(13, "Failed to set public note on %s", gpn->target); + Message(Chat::Red, "Failed to set public note on %s", gpn->target); } else { Message(0, "Successfully changed public note on %s", gpn->target); @@ -7897,7 +7897,7 @@ void Client::Handle_OP_GuildStatus(const EQApplicationPacket *app) if (!c) { - Message_StringID(clientMessageWhite, TARGET_PLAYER_FOR_GUILD_STATUS); + Message_StringID(Chat::LightGray, TARGET_PLAYER_FOR_GUILD_STATUS); return; } @@ -7905,7 +7905,7 @@ void Client::Handle_OP_GuildStatus(const EQApplicationPacket *app) if (TargetGuildID == GUILD_NONE) { - Message_StringID(clientMessageWhite, NOT_IN_A_GUILD, c->GetName()); + Message_StringID(Chat::LightGray, NOT_IN_A_GUILD, c->GetName()); return; } @@ -7920,21 +7920,21 @@ void Client::Handle_OP_GuildStatus(const EQApplicationPacket *app) if ((TargetGuildID == GuildID()) && (c != this)) { if (IsLeader) - Message_StringID(clientMessageWhite, LEADER_OF_YOUR_GUILD, c->GetName()); + Message_StringID(Chat::LightGray, LEADER_OF_YOUR_GUILD, c->GetName()); else if (IsOfficer) - Message_StringID(clientMessageWhite, OFFICER_OF_YOUR_GUILD, c->GetName()); + Message_StringID(Chat::LightGray, OFFICER_OF_YOUR_GUILD, c->GetName()); else - Message_StringID(clientMessageWhite, MEMBER_OF_YOUR_GUILD, c->GetName()); + Message_StringID(Chat::LightGray, MEMBER_OF_YOUR_GUILD, c->GetName()); return; } if (IsLeader) - Message_StringID(clientMessageWhite, LEADER_OF_X_GUILD, c->GetName(), GuildName); + Message_StringID(Chat::LightGray, LEADER_OF_X_GUILD, c->GetName(), GuildName); else if (IsOfficer) - Message_StringID(clientMessageWhite, OFFICER_OF_X_GUILD, c->GetName(), GuildName); + Message_StringID(Chat::LightGray, OFFICER_OF_X_GUILD, c->GetName(), GuildName); else - Message_StringID(clientMessageWhite, MEMBER_OF_X_GUILD, c->GetName(), GuildName); + Message_StringID(Chat::LightGray, MEMBER_OF_X_GUILD, c->GetName(), GuildName); } void Client::Handle_OP_GuildUpdateURLAndChannel(const EQApplicationPacket *app) @@ -7956,7 +7956,7 @@ void Client::Handle_OP_GuildUpdateURLAndChannel(const EQApplicationPacket *app) if (!guild_mgr.IsGuildLeader(GuildID(), CharacterID())) { - Message(13, "Only the guild leader can change the Channel or URL.!"); + Message(Chat::Red, "Only the guild leader can change the Channel or URL.!"); return; } @@ -7995,7 +7995,7 @@ void Client::Handle_OP_Hide(const EQApplicationPacket *app) } if (!p_timers.Expired(&database, pTimerHide, false)) { - Message(13, "Ability recovery time not yet met."); + Message(Chat::Red, "Ability recovery time not yet met."); return; } int reuse = HideReuseTime - GetSkillReuseTime(EQEmu::skills::SkillHide); @@ -8201,7 +8201,7 @@ void Client::Handle_OP_InstillDoubt(const EQApplicationPacket *app) //packet is empty as of 12/14/04 if (!p_timers.Expired(&database, pTimerInstillDoubt, false)) { - Message(13, "Ability recovery time not yet met."); + Message(Chat::Red, "Ability recovery time not yet met."); return; } p_timers.Start(pTimerInstillDoubt, InstillDoubtReuseTime - 1); @@ -8227,7 +8227,7 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) const EQEmu::ItemData *item = database.GetItem(ivrs->item_id); if (!item) { if (ivrs->item_id != SAYLINK_ITEM_ID) { - Message(13, "Error: The item for the link you have clicked on does not exist!"); + Message(Chat::Red, "Error: The item for the link you have clicked on does not exist!"); return; } // This new scheme will shuttle the ID in the first augment for non-silent links @@ -8240,12 +8240,12 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) std::string query = StringFormat("SELECT `phrase` FROM saylink WHERE `id` = '%i'", sayid); auto results = database.QueryDatabase(query); if (!results.Success()) { - Message(13, "Error: The saylink (%s) was not found in the database.", response.c_str()); + Message(Chat::Red, "Error: The saylink (%s) was not found in the database.", response.c_str()); return; } if (results.RowCount() != 1) { - Message(13, "Error: The saylink (%s) was not found in the database.", response.c_str()); + Message(Chat::Red, "Error: The saylink (%s) was not found in the database.", response.c_str()); return; } @@ -8264,7 +8264,7 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) parse->EventPlayer(EVENT_SAY, this, response.c_str(), 0); } else { - Message(7, "You say, '%s'", response.c_str()); + Message(Chat::LightGray, "You say, '%s'", response.c_str()); ChannelMessageReceived(8, 0, 100, response.c_str()); } return; @@ -8274,14 +8274,14 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) parse->EventPlayer(EVENT_SAY, this, response.c_str(), 0); } else { - Message(7, "You say, '%s'", response.c_str()); + Message(Chat::LightGray, "You say, '%s'", response.c_str()); ChannelMessageReceived(8, 0, 100, response.c_str()); } return; } } else { - Message(13, "Error: Say Link not found or is too long."); + Message(Chat::Red, "Error: Say Link not found or is too long."); return; } } @@ -8537,7 +8537,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) if (IsAIControlled()) { - this->Message_StringID(13, NOT_IN_CONTROL); + this->Message_StringID(Chat::Red, NOT_IN_CONTROL); return; } @@ -8646,7 +8646,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) if (inst->GetCharges() == 0) { //Message(0, "This item is out of charges."); - Message_StringID(13, ITEM_OUT_OF_CHARGES); + Message_StringID(Chat::Red, ITEM_OUT_OF_CHARGES); return; } if (GetLevel() >= item->Click.Level2) @@ -8666,7 +8666,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } else { - Message_StringID(13, ITEMS_INSUFFICIENT_LEVEL); + Message_StringID(Chat::Red, ITEMS_INSUFFICIENT_LEVEL); return; } } @@ -8675,7 +8675,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) if (clickaug->GetCharges() == 0) { //Message(0, "This item is out of charges."); - Message_StringID(13, ITEM_OUT_OF_CHARGES); + Message_StringID(Chat::Red, ITEM_OUT_OF_CHARGES); return; } if (GetLevel() >= augitem->Click.Level2) @@ -8695,7 +8695,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } else { - Message_StringID(13, ITEMS_INSUFFICIENT_LEVEL); + Message_StringID(Chat::Red, ITEMS_INSUFFICIENT_LEVEL); return; } } @@ -8829,13 +8829,13 @@ void Client::Handle_OP_LDoNDisarmTraps(const EQApplicationPacket *app) { if (DistanceSquaredNoZ(m_Position, target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse)) { - Message(13, "%s is too far away.", target->GetCleanName()); + Message(Chat::Red, "%s is too far away.", target->GetCleanName()); return; } HandleLDoNDisarm(target->CastToNPC(), GetSkill(EQEmu::skills::SkillDisarmTraps), LDoNTypeMechanical); } else - Message(13, "You do not have the disarm trap skill."); + Message(Chat::Red, "You do not have the disarm trap skill."); } } @@ -8843,7 +8843,7 @@ void Client::Handle_OP_LDoNInspect(const EQApplicationPacket *app) { Mob * target = GetTarget(); if (target && target->GetClass() == LDON_TREASURE) - Message(15, "%s", target->GetCleanName()); + Message(Chat::Yellow, "%s", target->GetCleanName()); } void Client::Handle_OP_LDoNOpen(const EQApplicationPacket *app) @@ -8862,13 +8862,13 @@ void Client::Handle_OP_LDoNPickLock(const EQApplicationPacket *app) { if (DistanceSquaredNoZ(m_Position, target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse)) { - Message(13, "%s is too far away.", target->GetCleanName()); + Message(Chat::Red, "%s is too far away.", target->GetCleanName()); return; } HandleLDoNPickLock(target->CastToNPC(), GetSkill(EQEmu::skills::SkillPickLock), LDoNTypeMechanical); } else - Message(13, "You do not have the pick locks skill."); + Message(Chat::Red, "You do not have the pick locks skill."); } } @@ -8881,13 +8881,13 @@ void Client::Handle_OP_LDoNSenseTraps(const EQApplicationPacket *app) { if (DistanceSquaredNoZ(m_Position, target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse)) { - Message(13, "%s is too far away.", target->GetCleanName()); + Message(Chat::Red, "%s is too far away.", target->GetCleanName()); return; } HandleLDoNSenseTraps(target->CastToNPC(), GetSkill(EQEmu::skills::SkillSenseTraps), LDoNTypeMechanical); } else - Message(13, "You do not have the sense traps skill."); + Message(Chat::Red, "You do not have the sense traps skill."); } } @@ -8902,12 +8902,12 @@ void Client::Handle_OP_LeadershipExpToggle(const EQApplicationPacket *app) if (*mode) { m_pp.leadAAActive = 1; Save(); - Message_StringID(clientMessageYellow, LEADERSHIP_EXP_ON); + Message_StringID(Chat::Yellow, LEADERSHIP_EXP_ON); } else { m_pp.leadAAActive = 0; Save(); - Message_StringID(clientMessageYellow, LEADERSHIP_EXP_OFF); + Message_StringID(Chat::Yellow, LEADERSHIP_EXP_OFF); } } @@ -9266,7 +9266,7 @@ void Client::Handle_OP_LootItem(const EQApplicationPacket *app) EQApplicationPacket* outapp = nullptr; Entity* entity = entity_list.GetID(*((uint16*)app->pBuffer)); if (entity == 0) { - Message(13, "Error: OP_LootItem: Corpse not found (ent = 0)"); + Message(Chat::Red, "Error: OP_LootItem: Corpse not found (ent = 0)"); outapp = new EQApplicationPacket(OP_LootComplete, 0); QueuePacket(outapp); safe_delete(outapp); @@ -9278,7 +9278,7 @@ void Client::Handle_OP_LootItem(const EQApplicationPacket *app) return; } else { - Message(13, "Error: Corpse not found! (!ent->IsCorpse())"); + Message(Chat::Red, "Error: Corpse not found! (!ent->IsCorpse())"); Corpse::SendEndLootErrorPacket(this); } @@ -9294,7 +9294,7 @@ void Client::Handle_OP_LootRequest(const EQApplicationPacket *app) Entity* ent = entity_list.GetID(*((uint32*)app->pBuffer)); if (ent == 0) { - Message(13, "Error: OP_LootRequest: Corpse not found (ent = 0)"); + Message(Chat::Red, "Error: OP_LootRequest: Corpse not found (ent = 0)"); Corpse::SendLootReqErrorPacket(this); return; } @@ -9307,7 +9307,7 @@ void Client::Handle_OP_LootRequest(const EQApplicationPacket *app) } else { std::cout << "npc == 0 LOOTING FOOKED3" << std::endl; - Message(13, "Error: OP_LootRequest: Corpse not a corpse?"); + Message(Chat::Red, "Error: OP_LootRequest: Corpse not a corpse?"); Corpse::SendLootReqErrorPacket(this); } return; @@ -9359,7 +9359,7 @@ void Client::Handle_OP_Mend(const EQApplicationPacket *app) return; if (!p_timers.Expired(&database, pTimerMend, false)) { - Message(13, "Ability recovery time not yet met."); + Message(Chat::Red, "Ability recovery time not yet met."); return; } p_timers.Start(pTimerMend, MendReuseTime - 1); @@ -9372,11 +9372,11 @@ void Client::Handle_OP_Mend(const EQApplicationPacket *app) if (zone->random.Int(0, 99) < criticalchance) { mendhp *= 2; - Message_StringID(4, MEND_CRITICAL); + Message_StringID(Chat::LightBlue, MEND_CRITICAL); } SetHP(GetHP() + mendhp); SendHPUpdate(); - Message_StringID(4, MEND_SUCCESS); + Message_StringID(Chat::LightBlue, MEND_SUCCESS); } else { /* the purpose of the following is to make the chance to worsen wounds much less common, @@ -9389,10 +9389,10 @@ void Client::Handle_OP_Mend(const EQApplicationPacket *app) { SetHP(currenthp > mendhp ? (GetHP() - mendhp) : 1); SendHPUpdate(); - Message_StringID(4, MEND_WORSEN); + Message_StringID(Chat::LightBlue, MEND_WORSEN); } else - Message_StringID(4, MEND_FAIL); + Message_StringID(Chat::LightBlue, MEND_FAIL); } CheckIncreaseSkill(EQEmu::skills::SkillMend, nullptr, 10); @@ -9403,7 +9403,7 @@ void Client::Handle_OP_MercenaryCommand(const EQApplicationPacket *app) { if (app->size != sizeof(MercenaryCommand_Struct)) { - Message(13, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); + Message(Chat::Red, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); Log(Logs::General, Logs::None, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); DumpPacket(app); return; @@ -9590,7 +9590,7 @@ void Client::Handle_OP_MercenaryDataUpdateRequest(const EQApplicationPacket *app // The payload is 0 bytes. if (app->size != 0) { - Message(13, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); + Message(Chat::Red, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); Log(Logs::General, Logs::None, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); DumpPacket(app); return; @@ -9609,7 +9609,7 @@ void Client::Handle_OP_MercenaryDismiss(const EQApplicationPacket *app) // The payload is 0 or 1 bytes. if (app->size > 1) { - Message(13, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); + Message(Chat::Red, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); Log(Logs::General, Logs::None, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); DumpPacket(app); return; @@ -9704,7 +9704,7 @@ void Client::Handle_OP_MercenarySuspendRequest(const EQApplicationPacket *app) { if (app->size != sizeof(SuspendMercenary_Struct)) { - Message(13, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); + Message(Chat::Red, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); Log(Logs::General, Logs::None, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); DumpPacket(app); return; @@ -9727,7 +9727,7 @@ void Client::Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app) // The payload is 0 bytes. if (app->size > 1) { - Message(13, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); + Message(Chat::Red, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); Log(Logs::General, Logs::None, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); DumpPacket(app); return; @@ -9829,7 +9829,7 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app) } } - if (mi_hack) { Message(15, "Caution: Illegal use of inaccessible bag slots!"); } + if (mi_hack) { Message(Chat::Yellow, "Caution: Illegal use of inaccessible bag slots!"); } if (!SwapItem(mi) && IsValidSlot(mi->from_slot) && IsValidSlot(mi->to_slot)) { SwapItemResync(mi); @@ -9930,9 +9930,9 @@ void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app) return; } if (petition_list.DeletePetitionByCharName((char*)app->pBuffer)) - Message_StringID(0, PETITION_DELETED); + Message_StringID(Chat::White, PETITION_DELETED); else - Message_StringID(0, PETITION_NO_DELETE); + Message_StringID(Chat::White, PETITION_NO_DELETE); return; } @@ -9989,7 +9989,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (!target) break; if (target->IsMezzed()) { - Message_StringID(10, CANNOT_WAKE, mypet->GetCleanName(), target->GetCleanName()); + Message_StringID(Chat::NPCQuestSay, CANNOT_WAKE, mypet->GetCleanName(), target->GetCleanName()); break; } if (mypet->IsFeared()) @@ -10027,7 +10027,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) hate += mypet->GetHateAmount(top) - mypet->GetHateAmount(target) + 100; // should be enough to cause target change } mypet->AddToHateList(target, hate, 0, true, false, false, SPELL_UNKNOWN, true); - Message_StringID(MT_PetResponse, PET_ATTACKING, mypet->GetCleanName(), target->GetCleanName()); + Message_StringID(Chat::PetResponse, PET_ATTACKING, mypet->GetCleanName(), target->GetCleanName()); SetTarget(target); } } @@ -10040,7 +10040,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (!GetTarget()) break; if (GetTarget()->IsMezzed()) { - Message_StringID(10, CANNOT_WAKE, mypet->GetCleanName(), GetTarget()->GetCleanName()); + Message_StringID(Chat::NPCQuestSay, CANNOT_WAKE, mypet->GetCleanName(), GetTarget()->GetCleanName()); break; } @@ -10061,7 +10061,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) } zone->AddAggroMob(); mypet->AddToHateList(GetTarget(), 1, 0, true, false, false, SPELL_UNKNOWN, true); - Message_StringID(MT_PetResponse, PET_ATTACKING, mypet->GetCleanName(), GetTarget()->GetCleanName()); + Message_StringID(Chat::PetResponse, PET_ATTACKING, mypet->GetCleanName(), GetTarget()->GetCleanName()); } } break; @@ -10070,7 +10070,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; //keeps pet running while feared if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { - mypet->SayTo_StringID(this, MT_PetResponse, PET_CALMING); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_CALMING); mypet->WipeHateList(); mypet->SetTarget(nullptr); if (mypet->IsPetStop()) { @@ -10082,7 +10082,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) } case PET_HEALTHREPORT: { if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { - Message_StringID(MT_PetResponse, PET_REPORT_HP, ConvertArrayF(mypet->GetHPRatio(), val1)); + Message_StringID(Chat::PetResponse, PET_REPORT_HP, ConvertArrayF(mypet->GetHPRatio(), val1)); mypet->ShowBuffList(this); } break; @@ -10101,7 +10101,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) SetPet(nullptr); } - mypet->SayTo_StringID(this, MT_PetResponse, PET_GETLOST_STRING); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_GETLOST_STRING); mypet->CastToNPC()->Depop(); //Oddly, the client (Titanium) will still allow "/pet get lost" command despite me adding the code below. If someone can figure that out, you can uncomment this code and use it. @@ -10119,7 +10119,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { if (mypet->IsNPC()) { - mypet->SayTo_StringID(this, MT_PetResponse, PET_GUARDINGLIFE); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_GUARDINGLIFE); mypet->SetPetOrder(SPO_Guard); mypet->CastToNPC()->SaveGuardSpot(mypet->GetPosition()); if (!mypet->GetTarget()) // want them to not twitch if they're chasing something down @@ -10136,7 +10136,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { - mypet->SayTo_StringID(this, MT_PetResponse, PET_FOLLOWING); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_FOLLOWING); mypet->SetPetOrder(SPO_Follow); mypet->SendAppearancePacket(AT_Anim, ANIM_STAND); if (mypet->IsPetStop()) { @@ -10150,12 +10150,12 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { if (mypet->CastToNPC()->IsTaunting()) { - Message_StringID(MT_PetResponse, PET_NO_TAUNT); + Message_StringID(Chat::PetResponse, PET_NO_TAUNT); mypet->CastToNPC()->SetTaunting(false); } else { - Message_StringID(MT_PetResponse, PET_DO_TAUNT); + Message_StringID(Chat::PetResponse, PET_DO_TAUNT); mypet->CastToNPC()->SetTaunting(true); } } @@ -10163,14 +10163,14 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) } case PET_TAUNT_ON: { if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { - Message_StringID(MT_PetResponse, PET_DO_TAUNT); + Message_StringID(Chat::PetResponse, PET_DO_TAUNT); mypet->CastToNPC()->SetTaunting(true); } break; } case PET_TAUNT_OFF: { if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { - Message_StringID(MT_PetResponse, PET_NO_TAUNT); + Message_StringID(Chat::PetResponse, PET_NO_TAUNT); mypet->CastToNPC()->SetTaunting(false); } break; @@ -10179,7 +10179,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { - mypet->SayTo_StringID(this, MT_PetResponse, PET_GUARDME_STRING); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_GUARDME_STRING); mypet->SetPetOrder(SPO_Follow); mypet->SendAppearancePacket(AT_Anim, ANIM_STAND); if (mypet->IsPetStop()) { @@ -10195,13 +10195,13 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { if (mypet->GetPetOrder() == SPO_Sit) { - mypet->SayTo_StringID(this, MT_PetResponse, PET_SIT_STRING); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_SIT_STRING); mypet->SetPetOrder(SPO_Follow); mypet->SendAppearancePacket(AT_Anim, ANIM_STAND); } else { - mypet->SayTo_StringID(this, MT_PetResponse, PET_SIT_STRING); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_SIT_STRING); mypet->SetPetOrder(SPO_Sit); mypet->SetRunAnimSpeed(0); if (!mypet->UseBardSpellLogic()) //maybe we can have a bard pet @@ -10215,7 +10215,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { - mypet->SayTo_StringID(this, MT_PetResponse, PET_SIT_STRING); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_SIT_STRING); mypet->SetPetOrder(SPO_Follow); mypet->SendAppearancePacket(AT_Anim, ANIM_STAND); } @@ -10225,7 +10225,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { - mypet->SayTo_StringID(this, MT_PetResponse, PET_SIT_STRING); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_SIT_STRING); mypet->SetPetOrder(SPO_Sit); mypet->SetRunAnimSpeed(0); if (!mypet->UseBardSpellLogic()) //maybe we can have a bard pet @@ -10239,18 +10239,18 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsHeld()) { if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(MT_PetResponse, PET_HOLD_SET_OFF); + Message_StringID(Chat::PetResponse, PET_HOLD_SET_OFF); mypet->SetHeld(false); } else { if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(MT_PetResponse, PET_HOLD_SET_ON); + Message_StringID(Chat::PetResponse, PET_HOLD_SET_ON); if (m_ClientVersionBit & EQEmu::versions::maskUFAndLater) - mypet->SayTo_StringID(this, MT_PetResponse, PET_NOW_HOLDING); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_NOW_HOLDING); else - mypet->SayTo_StringID(this, MT_PetResponse, PET_ON_HOLD); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_ON_HOLD); mypet->SetHeld(true); } @@ -10262,12 +10262,12 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) case PET_HOLD_ON: { if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC() && !mypet->IsHeld()) { if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(MT_PetResponse, PET_HOLD_SET_ON); + Message_StringID(Chat::PetResponse, PET_HOLD_SET_ON); if (m_ClientVersionBit & EQEmu::versions::maskUFAndLater) - mypet->SayTo_StringID(this, MT_PetResponse, PET_NOW_HOLDING); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_NOW_HOLDING); else - mypet->SayTo_StringID(this, MT_PetResponse, PET_ON_HOLD); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_ON_HOLD); mypet->SetHeld(true); mypet->SetGHeld(false); SetPetCommandState(PET_BUTTON_GHOLD, 0); @@ -10277,7 +10277,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) case PET_HOLD_OFF: { if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC() && mypet->IsHeld()) { if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(MT_PetResponse, PET_HOLD_SET_OFF); + Message_StringID(Chat::PetResponse, PET_HOLD_SET_OFF); mypet->SetHeld(false); } break; @@ -10287,16 +10287,16 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsGHeld()) { if (m_ClientVersionBit & EQEmu::versions::maskUFAndLater) - Message_StringID(MT_PetResponse, PET_OFF_GHOLD); + Message_StringID(Chat::PetResponse, PET_OFF_GHOLD); mypet->SetGHeld(false); } else { if (m_ClientVersionBit & EQEmu::versions::maskUFAndLater) { - Message_StringID(MT_PetResponse, PET_ON_GHOLD); - mypet->SayTo_StringID(this, MT_PetResponse, PET_GHOLD_ON_MSG); + Message_StringID(Chat::PetResponse, PET_ON_GHOLD); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_GHOLD_ON_MSG); } else { - mypet->SayTo_StringID(this, MT_PetResponse, PET_ON_HOLD); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_ON_HOLD); } mypet->SetGHeld(true); } @@ -10308,10 +10308,10 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) case PET_GHOLD_ON: { if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) { if (m_ClientVersionBit & EQEmu::versions::maskUFAndLater) { - Message_StringID(MT_PetResponse, PET_ON_GHOLD); - mypet->SayTo_StringID(this, MT_PetResponse, PET_GHOLD_ON_MSG); + Message_StringID(Chat::PetResponse, PET_ON_GHOLD); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_GHOLD_ON_MSG); } else { - mypet->SayTo_StringID(this, MT_PetResponse, PET_ON_HOLD); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_ON_HOLD); } mypet->SetGHeld(true); mypet->SetHeld(false); @@ -10322,7 +10322,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) case PET_GHOLD_OFF: { if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC() && mypet->IsGHeld()) { if (m_ClientVersionBit & EQEmu::versions::maskUFAndLater) - Message_StringID(MT_PetResponse, PET_OFF_GHOLD); + Message_StringID(Chat::PetResponse, PET_OFF_GHOLD); mypet->SetGHeld(false); } break; @@ -10332,15 +10332,15 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; if (mypet->IsNoCast()) { - Message_StringID(MT_PetResponse, PET_CASTING); + Message_StringID(Chat::PetResponse, PET_CASTING); if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(MT_PetResponse, PET_SPELLHOLD_SET_OFF); + Message_StringID(Chat::PetResponse, PET_SPELLHOLD_SET_OFF); mypet->SetNoCast(false); } else { - Message_StringID(MT_PetResponse, PET_NOT_CASTING); + Message_StringID(Chat::PetResponse, PET_NOT_CASTING); if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(MT_PetResponse, PET_SPELLHOLD_SET_ON); + Message_StringID(Chat::PetResponse, PET_SPELLHOLD_SET_ON); mypet->SetNoCast(true); } } @@ -10351,9 +10351,9 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; if (!mypet->IsNoCast()) { - Message_StringID(MT_PetResponse, PET_NOT_CASTING); + Message_StringID(Chat::PetResponse, PET_NOT_CASTING); if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(MT_PetResponse, PET_SPELLHOLD_SET_ON); + Message_StringID(Chat::PetResponse, PET_SPELLHOLD_SET_ON); mypet->SetNoCast(true); } } @@ -10364,9 +10364,9 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; if (mypet->IsNoCast()) { - Message_StringID(MT_PetResponse, PET_CASTING); + Message_StringID(Chat::PetResponse, PET_CASTING); if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(MT_PetResponse, PET_SPELLHOLD_SET_OFF); + Message_StringID(Chat::PetResponse, PET_SPELLHOLD_SET_OFF); mypet->SetNoCast(false); } } @@ -10377,15 +10377,15 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; if (mypet->IsFocused()) { - Message_StringID(MT_PetResponse, PET_NOT_FOCUSING); + Message_StringID(Chat::PetResponse, PET_NOT_FOCUSING); if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(MT_PetResponse, PET_FOCUS_SET_OFF); + Message_StringID(Chat::PetResponse, PET_FOCUS_SET_OFF); mypet->SetFocused(false); } else { - Message_StringID(MT_PetResponse, PET_NOW_FOCUSING); + Message_StringID(Chat::PetResponse, PET_NOW_FOCUSING); if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(MT_PetResponse, PET_FOCUS_SET_ON); + Message_StringID(Chat::PetResponse, PET_FOCUS_SET_ON); mypet->SetFocused(true); } } @@ -10396,9 +10396,9 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; if (!mypet->IsFocused()) { - Message_StringID(MT_PetResponse, PET_NOW_FOCUSING); + Message_StringID(Chat::PetResponse, PET_NOW_FOCUSING); if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(MT_PetResponse, PET_FOCUS_SET_ON); + Message_StringID(Chat::PetResponse, PET_FOCUS_SET_ON); mypet->SetFocused(true); } } @@ -10409,9 +10409,9 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; if (mypet->IsFocused()) { - Message_StringID(MT_PetResponse, PET_NOT_FOCUSING); + Message_StringID(Chat::PetResponse, PET_NOT_FOCUSING); if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(MT_PetResponse, PET_FOCUS_SET_OFF); + Message_StringID(Chat::PetResponse, PET_FOCUS_SET_OFF); mypet->SetFocused(false); } } @@ -10432,7 +10432,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) SetPetCommandState(PET_BUTTON_REGROUP, 0); } } - mypet->SayTo_StringID(this, MT_PetResponse, PET_GETLOST_STRING); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_GETLOST_STRING); } break; } @@ -10443,7 +10443,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) mypet->SetPetStop(true); mypet->StopNavigation(); mypet->SetTarget(nullptr); - mypet->SayTo_StringID(this, MT_PetResponse, PET_GETLOST_STRING); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_GETLOST_STRING); if (mypet->IsPetRegroup()) { mypet->SetPetRegroup(false); SetPetCommandState(PET_BUTTON_REGROUP, 0); @@ -10456,7 +10456,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { mypet->SetPetStop(false); - mypet->SayTo_StringID(this, MT_PetResponse, PET_GETLOST_STRING); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_GETLOST_STRING); } break; } @@ -10466,11 +10466,11 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (aabonuses.PetCommands[PetCommand]) { if (mypet->IsPetRegroup()) { mypet->SetPetRegroup(false); - mypet->SayTo_StringID(this, MT_PetResponse, PET_OFF_REGROUPING); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_OFF_REGROUPING); } else { mypet->SetPetRegroup(true); mypet->SetTarget(nullptr); - mypet->SayTo_StringID(this, MT_PetResponse, PET_ON_REGROUPING); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_ON_REGROUPING); if (mypet->IsPetStop()) { mypet->SetPetStop(false); SetPetCommandState(PET_BUTTON_STOP, 0); @@ -10485,7 +10485,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (aabonuses.PetCommands[PetCommand]) { mypet->SetPetRegroup(true); mypet->SetTarget(nullptr); - mypet->SayTo_StringID(this, MT_PetResponse, PET_ON_REGROUPING); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_ON_REGROUPING); if (mypet->IsPetStop()) { mypet->SetPetStop(false); SetPetCommandState(PET_BUTTON_STOP, 0); @@ -10498,7 +10498,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (aabonuses.PetCommands[PetCommand]) { mypet->SetPetRegroup(false); - mypet->SayTo_StringID(this, MT_PetResponse, PET_OFF_REGROUPING); + mypet->SayTo_StringID(this, Chat::PetResponse, PET_OFF_REGROUPING); } break; } @@ -10706,7 +10706,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app) if (!p_timers.Expired(&database, pTimerBeggingPickPocket, false)) { - Message(13, "Ability recovery time not yet met."); + Message(Chat::Red, "Ability recovery time not yet met."); database.SetMQDetectionFlag(this->AccountName(), this->GetName(), "OP_PickPocket was sent again too quickly.", zone->GetShortName()); return; } @@ -10793,7 +10793,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app) case EQEmu::popupresponse::MOB_INFO_DISMISS: this->SetDisplayMobInfoWindow(false); - this->Message(15, "[DevTools] Window snoozed in this zone..."); + this->Message(Chat::Yellow, "[DevTools] Window snoozed in this zone..."); break; default: break; @@ -10855,13 +10855,13 @@ void Client::Handle_OP_PurchaseLeadershipAA(const EQApplicationPacket *app) uint32 current_rank = m_pp.leader_abilities.ranks[aaid]; if (current_rank >= MAX_LEADERSHIP_TIERS) { - Message(13, "This ability can be trained no further."); + Message(Chat::Red, "This ability can be trained no further."); return; } uint8 cost = LeadershipAACosts[aaid][current_rank]; if (cost == 0) { - Message(13, "This ability can be trained no further."); + Message(Chat::Red, "This ability can be trained no further."); return; } @@ -10870,7 +10870,7 @@ void Client::Handle_OP_PurchaseLeadershipAA(const EQApplicationPacket *app) if (aaid >= raidAAMarkNPC) { //it is a raid ability. if (cost > m_pp.raid_leadership_points) { - Message(13, "You do not have enough points to purchase this ability."); + Message(Chat::Red, "You do not have enough points to purchase this ability."); return; } @@ -10883,7 +10883,7 @@ void Client::Handle_OP_PurchaseLeadershipAA(const EQApplicationPacket *app) else { //it is a group ability. if (cost > m_pp.group_leadership_points) { - Message(13, "You do not have enough points to purchase this ability."); + Message(Chat::Red, "You do not have enough points to purchase this ability."); return; } @@ -11082,12 +11082,12 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) Group *player_to_invite_group = player_to_invite->GetGroup(); if (player_to_invite->HasRaid()) { - Message(13, "%s is already in a raid.", player_to_invite->GetName()); + Message(Chat::Red, "%s is already in a raid.", player_to_invite->GetName()); break; } if (player_to_invite_group && !player_to_invite_group->IsLeader(player_to_invite)) { - Message(13, "You can only invite an ungrouped player or group leader to join your raid."); + Message(Chat::Red, "You can only invite an ungrouped player or group leader to join your raid."); break; } @@ -11111,7 +11111,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) Client *player_accepting_invite = entity_list.GetClientByName(raid_command_packet->player_name); if (player_accepting_invite) { if (IsRaidGrouped()) { - player_accepting_invite->Message_StringID(0, ALREADY_IN_RAID, GetName()); //group failed, must invite members not in raid... + player_accepting_invite->Message_StringID(Chat::White, ALREADY_IN_RAID, GetName()); //group failed, must invite members not in raid... return; } Raid *raid = entity_list.GetRaidByClient(player_accepting_invite); @@ -11120,13 +11120,13 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) Group *group = GetGroup(); if (group) { if (group->GroupCount() + raid->RaidCount() > MAX_RAID_MEMBERS) { - player_accepting_invite->Message(13, "Invite failed, group invite would create a raid larger than the maximum number of members allowed."); + player_accepting_invite->Message(Chat::Red, "Invite failed, group invite would create a raid larger than the maximum number of members allowed."); return; } } else { if (1 + raid->RaidCount() > MAX_RAID_MEMBERS) { - player_accepting_invite->Message(13, "Invite failed, member invite would create a raid larger than the maximum number of members allowed."); + player_accepting_invite->Message(Chat::Red, "Invite failed, member invite would create a raid larger than the maximum number of members allowed."); return; } } @@ -11618,7 +11618,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) { Raid *raid = entity_list.GetRaidByClient(this); if (raid) { - Message(15, "Loot type changed to: %d.", raid_command_packet->parameter); + Message(Chat::Yellow, "Loot type changed to: %d.", raid_command_packet->parameter); raid->ChangeLootType(raid_command_packet->parameter); } break; @@ -11629,7 +11629,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) { Raid *raid = entity_list.GetRaidByClient(this); if (raid) { - Message(15, "Adding %s as a raid looter.", raid_command_packet->leader_name); + Message(Chat::Yellow, "Adding %s as a raid looter.", raid_command_packet->leader_name); raid->AddRaidLooter(raid_command_packet->leader_name); } break; @@ -11640,7 +11640,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) { Raid *raid = entity_list.GetRaidByClient(this); if (raid) { - Message(15, "Removing %s as a raid looter.", raid_command_packet->leader_name); + Message(Chat::Yellow, "Removing %s as a raid looter.", raid_command_packet->leader_name); raid->RemoveRaidLooter(raid_command_packet->leader_name); } break; @@ -11673,7 +11673,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) } default: { - Message(13, "Raid command (%d) NYI", raid_command_packet->action); + Message(Chat::Red, "Raid command (%d) NYI", raid_command_packet->action); break; } } @@ -11983,14 +11983,14 @@ void Client::Handle_OP_RemoveTrap(const EQApplicationPacket *app) if (good) RemoveAura(id); else - Message_StringID(MT_SpellFailure, NOT_YOUR_TRAP); // pretty sure this was red + Message_StringID(Chat::SpellFailure, NOT_YOUR_TRAP); // pretty sure this was red } void Client::Handle_OP_Report(const EQApplicationPacket *app) { if (!CanUseReport) { - Message_StringID(MT_System, REPORT_ONCE); + Message_StringID(Chat::System, REPORT_ONCE); return; } @@ -12057,11 +12057,11 @@ void Client::Handle_OP_RequestDuel(const EQApplicationPacket *app) ds->duel_target = duel; Entity* entity = entity_list.GetID(ds->duel_target); if (GetID() != ds->duel_target && entity->IsClient() && (entity->CastToClient()->IsDueling() && entity->CastToClient()->GetDuelTarget() != 0)) { - Message_StringID(10, DUEL_CONSIDERING, entity->GetName()); + Message_StringID(Chat::NPCQuestSay, DUEL_CONSIDERING, entity->GetName()); return; } if (IsDueling()) { - Message_StringID(10, DUEL_INPROGRESS); + Message_StringID(Chat::NPCQuestSay, DUEL_INPROGRESS); return; } @@ -12108,7 +12108,7 @@ void Client::Handle_OP_RespawnWindow(const EQApplicationPacket *app) void Client::Handle_OP_Rewind(const EQApplicationPacket *app) { if ((rewind_timer.GetRemainingTime() > 1 && rewind_timer.Enabled())) { - Message_StringID(MT_System, REWIND_WAIT); + Message_StringID(Chat::System, REWIND_WAIT); } else { CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), m_RewindLocation.x, m_RewindLocation.y, m_RewindLocation.z, 0, 2, Rewind); @@ -12220,7 +12220,7 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app) return; if (!p_timers.Expired(&database, pTimerSenseTraps, false)) { - Message(13, "Ability recovery time not yet met."); + Message(Chat::Red, "Ability recovery time not yet met."); return; } @@ -12243,23 +12243,23 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app) auto diff = trap->m_Position - glm::vec3(GetPosition()); if (diff.x == 0 && diff.y == 0) - Message(MT_Skills, "You sense a trap right under your feet!"); + Message(Chat::Skills, "You sense a trap right under your feet!"); else if (diff.x > 10 && diff.y > 10) - Message(MT_Skills, "You sense a trap to the NorthWest."); + Message(Chat::Skills, "You sense a trap to the NorthWest."); else if (diff.x < -10 && diff.y > 10) - Message(MT_Skills, "You sense a trap to the NorthEast."); + Message(Chat::Skills, "You sense a trap to the NorthEast."); else if (diff.y > 10) - Message(MT_Skills, "You sense a trap to the North."); + Message(Chat::Skills, "You sense a trap to the North."); else if (diff.x > 10 && diff.y < -10) - Message(MT_Skills, "You sense a trap to the SouthWest."); + Message(Chat::Skills, "You sense a trap to the SouthWest."); else if (diff.x < -10 && diff.y < -10) - Message(MT_Skills, "You sense a trap to the SouthEast."); + Message(Chat::Skills, "You sense a trap to the SouthEast."); else if (diff.y < -10) - Message(MT_Skills, "You sense a trap to the South."); + Message(Chat::Skills, "You sense a trap to the South."); else if (diff.x > 10) - Message(MT_Skills, "You sense a trap to the West."); + Message(Chat::Skills, "You sense a trap to the West."); else - Message(MT_Skills, "You sense a trap to the East."); + Message(Chat::Skills, "You sense a trap to the East."); trap->detected = true; float angle = CalculateHeadingToTarget(trap->m_Position.x, trap->m_Position.y); @@ -12272,7 +12272,7 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app) return; } } - Message(MT_Skills, "You did not find any traps nearby."); + Message(Chat::Skills, "You did not find any traps nearby."); return; } @@ -12286,11 +12286,11 @@ void Client::Handle_OP_SetGuildMOTD(const EQApplicationPacket *app) return; } if (!IsInAGuild()) { - Message(13, "You are not in a guild!"); + Message(Chat::Red, "You are not in a guild!"); return; } if (!guild_mgr.CheckPermission(GuildID(), GuildRank(), GUILD_MOTD)) { - Message(13, "You do not have permissions to edit your guild's MOTD."); + Message(Chat::Red, "You do not have permissions to edit your guild's MOTD."); return; } @@ -12341,7 +12341,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) { // if the character has a start city, don't let them use the command if (m_pp.binds[4].zoneId != 0 && m_pp.binds[4].zoneId != 189) { - Message(15, "Your home city has already been set.", m_pp.binds[4].zoneId, database.GetZoneName(m_pp.binds[4].zoneId)); + Message(Chat::Yellow, "Your home city has already been set.", m_pp.binds[4].zoneId, database.GetZoneName(m_pp.binds[4].zoneId)); return; } @@ -12381,7 +12381,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) } if (validCity) { - Message(15, "Your home city has been set"); + Message(Chat::Yellow, "Your home city has been set"); SetStartZone(startCity, x, y, z); return; } @@ -12393,7 +12393,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) if (!results.Success()) return; - Message(15, "Use \"/setstartcity #\" to choose a home city from the following list:"); + Message(Chat::Yellow, "Use \"/setstartcity #\" to choose a home city from the following list:"); for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[1]) != 0) @@ -12403,7 +12403,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) char* name = nullptr; database.GetZoneLongName(database.GetZoneName(zoneid), &name); - Message(15, "%d - %s", zoneid, name); + Message(Chat::Yellow, "%d - %s", zoneid, name); } } @@ -12509,7 +12509,7 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app) } if (!ack) { - Message_StringID(0, ALREADY_SHIELDED); + Message_StringID(Chat::White, ALREADY_SHIELDED); shield_target = 0; return; } @@ -12586,7 +12586,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) item = database.GetItem(item_id); if (!item) { //error finding item, client didnt get the update packet for whatever reason, roleplay a tad - Message(15, "%s tells you 'Sorry, that item is for display purposes only.' as they take the item off the shelf.", tmp->GetCleanName()); + Message(Chat::Yellow, "%s tells you 'Sorry, that item is for display purposes only.' as they take the item off the shelf.", tmp->GetCleanName()); auto delitempacket = new EQApplicationPacket(OP_ShopDelItem, sizeof(Merchant_DelItem_Struct)); Merchant_DelItem_Struct* delitem = (Merchant_DelItem_Struct*)delitempacket->pBuffer; delitem->itemslot = mp->itemslot; @@ -12599,7 +12599,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) } if (CheckLoreConflict(item)) { - Message(15, "You can only have one of a lore item."); + Message(Chat::Yellow, "You can only have one of a lore item."); return; } if (tmpmer_used && (mp->quantity > prevcharges || item->MaxCharges > 1)) @@ -12673,7 +12673,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) //make sure we are not completely full... if (freeslotid == EQEmu::invslot::slotCursor) { if (m_inv.GetItem(EQEmu::invslot::slotCursor) != nullptr) { - Message(13, "You do not have room for any more items."); + Message(Chat::Red, "You do not have room for any more items."); safe_delete(outapp); safe_delete(inst); return; @@ -12682,7 +12682,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) if (!stacked && freeslotid == INVALID_INDEX) { - Message(13, "You do not have room for any more items."); + Message(Chat::Red, "You do not have room for any more items."); safe_delete(outapp); safe_delete(inst); return; @@ -12817,7 +12817,7 @@ void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) const EQEmu::ItemData* item = database.GetItem(itemid); EQEmu::ItemInstance* inst = GetInv().GetItem(mp->itemslot); if (!item || !inst) { - Message(13, "You seemed to have misplaced that item.."); + Message(Chat::Red, "You seemed to have misplaced that item.."); return; } if (mp->quantity > 1) @@ -12827,7 +12827,7 @@ void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) } if (!item->NoDrop) { - //Message(13,"%s tells you, 'LOL NOPE'", vendor->GetName()); + //Message(Chat::Red,"%s tells you, 'LOL NOPE'", vendor->GetName()); return; } @@ -13021,7 +13021,7 @@ void Client::Handle_OP_ShopRequest(const EQApplicationPacket *app) return; } if (tmp->IsEngaged()) { - this->Message_StringID(0, MERCHANT_BUSY); + this->Message_StringID(Chat::White, MERCHANT_BUSY); action = 0; } if (GetFeigned() || IsInvisible()) @@ -13074,7 +13074,7 @@ void Client::Handle_OP_Sneak(const EQApplicationPacket *app) } if (!p_timers.Expired(&database, pTimerSneak, false)) { - Message(13, "Ability recovery time not yet met."); + Message(Chat::Red, "Ability recovery time not yet met."); return; } p_timers.Start(pTimerSneak, SneakReuseTime - 1); @@ -13295,13 +13295,13 @@ void Client::Handle_OP_Split(const EQApplicationPacket *app) //Per the note above, Im not exactly sure what to do on error //to notify the client of the error... if (!isgrouped) { - Message(13, "You can not split money if you're not in a group."); + Message(Chat::Red, "You can not split money if you're not in a group."); return; } Group *cgroup = GetGroup(); if (cgroup == nullptr) { //invalid group, not sure if we should say more... - Message(13, "You can not split money if you're not in a group."); + Message(Chat::Red, "You can not split money if you're not in a group."); return; } @@ -13309,7 +13309,7 @@ void Client::Handle_OP_Split(const EQApplicationPacket *app) 10 * static_cast(split->silver) + 100 * static_cast(split->gold) + 1000 * static_cast(split->platinum))) { - Message(13, "You do not have enough money to do that split."); + Message(Chat::Red, "You do not have enough money to do that split."); return; } cgroup->SplitMoney(split->copper, split->silver, split->gold, split->platinum); @@ -13328,13 +13328,13 @@ void Client::Handle_OP_Surname(const EQApplicationPacket *app) if (!p_timers.Expired(&database, pTimerSurnameChange, false) && !GetGM()) { - Message(15, "You may only change surnames once every 7 days, your /surname is currently on cooldown."); + Message(Chat::Yellow, "You may only change surnames once every 7 days, your /surname is currently on cooldown."); return; } if (GetLevel() < 20) { - Message_StringID(15, SURNAME_LEVEL); + Message_StringID(Chat::Yellow, SURNAME_LEVEL); return; } @@ -13356,13 +13356,13 @@ void Client::Handle_OP_Surname(const EQApplicationPacket *app) } if (strlen(surname->lastname) >= 20) { - Message_StringID(15, SURNAME_TOO_LONG); + Message_StringID(Chat::Yellow, SURNAME_TOO_LONG); return; } if (!database.CheckNameFilter(surname->lastname, true)) { - Message_StringID(15, SURNAME_REJECTED); + Message_StringID(Chat::Yellow, SURNAME_REJECTED); return; } @@ -13657,7 +13657,7 @@ void Client::Handle_OP_Taunt(const EQApplicationPacket *app) } if (!p_timers.Expired(&database, pTimerTaunt, false)) { - Message(13, "Ability recovery time not yet met."); + Message(Chat::Red, "Ability recovery time not yet met."); return; } p_timers.Start(pTimerTaunt, TauntReuseTime - 1); @@ -13666,7 +13666,7 @@ void Client::Handle_OP_Taunt(const EQApplicationPacket *app) return; if (!zone->CanDoCombat()) { - Message(13, "You cannot taunt in a no combat zone."); + Message(Chat::Red, "You cannot taunt in a no combat zone."); return; } @@ -13742,31 +13742,31 @@ void Client::Handle_OP_TradeAcceptClick(const EQApplicationPacket *app) trade->state = TradeCompleting; if (CheckTradeLoreConflict(other) || other->CheckTradeLoreConflict(this)) { - Message_StringID(13, TRADE_CANCEL_LORE); - other->Message_StringID(13, TRADE_CANCEL_LORE); + Message_StringID(Chat::Red, TRADE_CANCEL_LORE); + other->Message_StringID(Chat::Red, TRADE_CANCEL_LORE); this->FinishTrade(this); other->FinishTrade(other); other->trade->Reset(); trade->Reset(); } else if (CheckTradeNonDroppable()) { - Message_StringID(13, TRADE_HAS_BEEN_CANCELLED); - other->Message_StringID(13, TRADE_HAS_BEEN_CANCELLED); + Message_StringID(Chat::Red, TRADE_HAS_BEEN_CANCELLED); + other->Message_StringID(Chat::Red, TRADE_HAS_BEEN_CANCELLED); this->FinishTrade(this); other->FinishTrade(other); other->trade->Reset(); trade->Reset(); - Message(15, "Hacking activity detected in trade transaction."); + Message(Chat::Yellow, "Hacking activity detected in trade transaction."); // TODO: query (this) as a hacker } else if (other->CheckTradeNonDroppable()) { - Message_StringID(13, TRADE_HAS_BEEN_CANCELLED); - other->Message_StringID(13, TRADE_HAS_BEEN_CANCELLED); + Message_StringID(Chat::Red, TRADE_HAS_BEEN_CANCELLED); + other->Message_StringID(Chat::Red, TRADE_HAS_BEEN_CANCELLED); this->FinishTrade(this); other->FinishTrade(other); other->trade->Reset(); trade->Reset(); - other->Message(15, "Hacking activity detected in trade transaction."); + other->Message(Chat::Yellow, "Hacking activity detected in trade transaction."); // TODO: query (other) as a hacker } else { @@ -13955,7 +13955,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) { if (Buyer) { Trader_EndTrader(); - Message(13, "You cannot be a Trader and Buyer at the same time."); + Message(Chat::Red, "You cannot be a Trader and Buyer at the same time."); return; } @@ -13974,20 +13974,20 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) if (gis->Items[i] == 0) break; if (ints->ItemCost[i] == 0) { - Message(13, "Item in Trader Satchel with no price. Unable to start trader mode"); + Message(Chat::Red, "Item in Trader Satchel with no price. Unable to start trader mode"); TradeItemsValid = false; break; } const EQEmu::ItemData *Item = database.GetItem(gis->Items[i]); if (!Item) { - Message(13, "Unexpected error. Unable to start trader mode"); + Message(Chat::Red, "Unexpected error. Unable to start trader mode"); TradeItemsValid = false; break; } if (Item->NoDrop == 0) { - Message(13, "NODROP Item in Trader Satchel. Unable to start trader mode"); + Message(Chat::Red, "NODROP Item in Trader Satchel. Unable to start trader mode"); TradeItemsValid = false; break; } @@ -14209,7 +14209,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) } else { - Message_StringID(clientMessageYellow, TRADER_BUSY); + Message_StringID(Chat::Yellow, TRADER_BUSY); Log(Logs::Detail, Logs::Trading, "Client::Handle_OP_TraderShop: Trader Busy"); } @@ -14287,7 +14287,7 @@ void Client::Handle_OP_TradeSkillCombine(const EQApplicationPacket *app) return; } /*if (m_tradeskill_object == nullptr) { - Message(13, "Error: Server is not aware of the tradeskill container you are attempting to use"); + Message(Chat::Red, "Error: Server is not aware of the tradeskill container you are attempting to use"); return; }*/ @@ -14313,7 +14313,7 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app) return; if ((RuleI(Spells, TranslocateTimeLimit) > 0) && (time(nullptr) > (TranslocateTime + RuleI(Spells, TranslocateTimeLimit)))) { - Message(13, "You did not accept the Translocate within the required time limit."); + Message(Chat::Red, "You did not accept the Translocate within the required time limit."); PendingTranslocate = false; return; } diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 244f36580..ecbf90d1e 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -378,10 +378,10 @@ bool Client::Process() { } if (!CombatRange(auto_attack_target)) { - Message_StringID(MT_TooFarAway, TARGET_TOO_FAR); + Message_StringID(Chat::TooFarAway, TARGET_TOO_FAR); } else if (auto_attack_target == this) { - Message_StringID(MT_TooFarAway, TRY_ATTACKING_SOMEONE); + Message_StringID(Chat::TooFarAway, TRY_ATTACKING_SOMEONE); } else if (!los_status || !los_status_facing) { //you can't see your target @@ -416,11 +416,11 @@ bool Client::Process() { // Range check if (!CombatRange(auto_attack_target)) { // this is a duplicate message don't use it. - //Message_StringID(MT_TooFarAway,TARGET_TOO_FAR); + //Message_StringID(Chat::TooFarAway,TARGET_TOO_FAR); } // Don't attack yourself else if (auto_attack_target == this) { - //Message_StringID(MT_TooFarAway,TRY_ATTACKING_SOMEONE); + //Message_StringID(Chat::TooFarAway,TRY_ATTACKING_SOMEONE); } else if (!los_status || !los_status_facing) { @@ -951,9 +951,9 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) { sprintf(handy_id, "%i", greet_id); if (greet_id != MERCHANT_GREETING) - Message_StringID(10, GENERIC_STRINGID_SAY, merch->GetCleanName(), handy_id, this->GetName(), handyitem->Name); + Message_StringID(Chat::NPCQuestSay, GENERIC_STRINGID_SAY, merch->GetCleanName(), handy_id, this->GetName(), handyitem->Name); else - Message_StringID(10, GENERIC_STRINGID_SAY, merch->GetCleanName(), handy_id, this->GetName()); + Message_StringID(Chat::NPCQuestSay, GENERIC_STRINGID_SAY, merch->GetCleanName(), handy_id, this->GetName()); } // safe_delete_array(cpi); @@ -989,7 +989,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I if(PendingRezzXP < 0) { // pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer Log(Logs::Detail, Logs::Spells, "Unexpected OP_RezzAnswer. Ignoring it."); - Message(13, "You have already been resurrected.\n"); + Message(Chat::Red, "You have already been resurrected.\n"); return; } @@ -1043,7 +1043,7 @@ void Client::OPTGB(const EQApplicationPacket *app) uint32 tgb_flag = *(uint32 *)app->pBuffer; if(tgb_flag == 2) - Message_StringID(0, TGB() ? TGB_ON : TGB_OFF); + Message_StringID(Chat::White, TGB() ? TGB_ON : TGB_OFF); else tgb = tgb_flag; } @@ -1061,7 +1061,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app) if(!IsValidSpell(memspell->spell_id)) { - Message(13, "Unexpected error: spell id out of range"); + Message(Chat::Red, "Unexpected error: spell id out of range"); return; } @@ -1072,8 +1072,8 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app) ) { char val1[20]={0}; - Message_StringID(13,SPELL_LEVEL_TO_LOW,ConvertArray(spells[memspell->spell_id].classes[GetClass()-1],val1),spells[memspell->spell_id].name); - //Message(13, "Unexpected error: Class cant use this spell at your level!"); + Message_StringID(Chat::Red,SPELL_LEVEL_TO_LOW,ConvertArray(spells[memspell->spell_id].classes[GetClass()-1],val1),spells[memspell->spell_id].name); + //Message(Chat::Red, "Unexpected error: Class cant use this spell at your level!"); return; } @@ -1087,7 +1087,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app) const EQEmu::ItemData* item = inst->GetItem(); if (RuleB(Character, RestrictSpellScribing) && !item->IsEquipable(GetRace(), GetClass())) { - Message_StringID(13, CANNOT_USE_ITEM); + Message_StringID(Chat::Red, CANNOT_USE_ITEM); break; } @@ -1439,7 +1439,7 @@ void Client::OPMoveCoin(const EQApplicationPacket* app) } else{ if (to_bucket == &m_pp.platinum_shared || from_bucket == &m_pp.platinum_shared){ - this->Message(13, "::: WARNING! ::: SHARED BANK IS DISABLED AND YOUR PLATINUM WILL BE DESTROYED IF YOU PUT IT HERE"); + this->Message(Chat::Red, "::: WARNING! ::: SHARED BANK IS DISABLED AND YOUR PLATINUM WILL BE DESTROYED IF YOU PUT IT HERE"); } } } @@ -1455,8 +1455,8 @@ void Client::OPMoveCoin(const EQApplicationPacket* app) with->trade->state = Trading; Client* recipient = trader->CastToClient(); - recipient->Message(15, "%s adds some coins to the trade.", GetName()); - recipient->Message(15, "The total trade is: %i PP, %i GP, %i SP, %i CP", + recipient->Message(Chat::Yellow, "%s adds some coins to the trade.", GetName()); + recipient->Message(Chat::Yellow, "The total trade is: %i PP, %i GP, %i SP, %i CP", trade->pp, trade->gp, trade->sp, trade->cp ); @@ -1645,7 +1645,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app) case EQEmu::skills::SkillJewelryMaking: case EQEmu::skills::SkillPottery: if(skilllevel >= RuleI(Skills, MaxTrainTradeskills)) { - Message_StringID(13, MORE_SKILLED_THAN_I, pTrainer->GetCleanName()); + Message_StringID(Chat::Red, MORE_SKILLED_THAN_I, pTrainer->GetCleanName()); return; } break; @@ -1655,7 +1655,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app) case EQEmu::skills::SkillSpecializeDivination: case EQEmu::skills::SkillSpecializeEvocation: if(skilllevel >= RuleI(Skills, MaxTrainSpecializations)) { - Message_StringID(13, MORE_SKILLED_THAN_I, pTrainer->GetCleanName()); + Message_StringID(Chat::Red, MORE_SKILLED_THAN_I, pTrainer->GetCleanName()); return; } default: @@ -1666,7 +1666,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app) if (skilllevel >= MaxSkillValue) { // Don't allow training over max skill level - Message_StringID(13, MORE_SKILLED_THAN_I, pTrainer->GetCleanName()); + Message_StringID(Chat::Red, MORE_SKILLED_THAN_I, pTrainer->GetCleanName()); return; } @@ -1676,7 +1676,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app) if (skilllevel >= MaxSpecSkill) { // Restrict specialization training to follow the rules - Message_StringID(13, MORE_SKILLED_THAN_I, pTrainer->GetCleanName()); + Message_StringID(Chat::Red, MORE_SKILLED_THAN_I, pTrainer->GetCleanName()); return; } } @@ -1919,7 +1919,7 @@ void Client::DoTracking() Mob *m = entity_list.GetMob(TrackingID); if (!m || m->IsCorpse()) { - Message_StringID(MT_Skills, TRACK_LOST_TARGET); + Message_StringID(Chat::Skills, TRACK_LOST_TARGET); TrackingID = 0; return; } @@ -1930,23 +1930,23 @@ void Client::DoTracking() RelativeHeading += 512; if (RelativeHeading > 480) - Message_StringID(MT_Skills, TRACK_STRAIGHT_AHEAD, m->GetCleanName()); + Message_StringID(Chat::Skills, TRACK_STRAIGHT_AHEAD, m->GetCleanName()); else if (RelativeHeading > 416) - Message_StringID(MT_Skills, TRACK_AHEAD_AND_TO, m->GetCleanName(), "left"); + Message_StringID(Chat::Skills, TRACK_AHEAD_AND_TO, m->GetCleanName(), "left"); else if (RelativeHeading > 352) - Message_StringID(MT_Skills, TRACK_TO_THE, m->GetCleanName(), "left"); + Message_StringID(Chat::Skills, TRACK_TO_THE, m->GetCleanName(), "left"); else if (RelativeHeading > 288) - Message_StringID(MT_Skills, TRACK_BEHIND_AND_TO, m->GetCleanName(), "left"); + Message_StringID(Chat::Skills, TRACK_BEHIND_AND_TO, m->GetCleanName(), "left"); else if (RelativeHeading > 224) - Message_StringID(MT_Skills, TRACK_BEHIND_YOU, m->GetCleanName()); + Message_StringID(Chat::Skills, TRACK_BEHIND_YOU, m->GetCleanName()); else if (RelativeHeading > 160) - Message_StringID(MT_Skills, TRACK_BEHIND_AND_TO, m->GetCleanName(), "right"); + Message_StringID(Chat::Skills, TRACK_BEHIND_AND_TO, m->GetCleanName(), "right"); else if (RelativeHeading > 96) - Message_StringID(MT_Skills, TRACK_TO_THE, m->GetCleanName(), "right"); + Message_StringID(Chat::Skills, TRACK_TO_THE, m->GetCleanName(), "right"); else if (RelativeHeading > 32) - Message_StringID(MT_Skills, TRACK_AHEAD_AND_TO, m->GetCleanName(), "right"); + Message_StringID(Chat::Skills, TRACK_AHEAD_AND_TO, m->GetCleanName(), "right"); else if (RelativeHeading >= 0) - Message_StringID(MT_Skills, TRACK_STRAIGHT_AHEAD, m->GetCleanName()); + Message_StringID(Chat::Skills, TRACK_STRAIGHT_AHEAD, m->GetCleanName()); } void Client::HandleRespawnFromHover(uint32 Option) diff --git a/zone/corpse.cpp b/zone/corpse.cpp index 1465064f3..942c3374b 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -889,14 +889,14 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a if(IsPlayerCorpse() && !corpse_db_id) { // really should try to resave in this case // SendLootReqErrorPacket(client, 0); - client->Message(13, "Warning: Corpse's dbid = 0! Corpse will not survive zone shutdown!"); + client->Message(Chat::Red, "Warning: Corpse's dbid = 0! Corpse will not survive zone shutdown!"); std::cout << "Error: PlayerCorpse::MakeLootRequestPackets: dbid = 0!" << std::endl; // return; } if(is_locked && client->Admin() < 100) { SendLootReqErrorPacket(client, LootResponse::SomeoneElse); - client->Message(13, "Error: Corpse locked by GM."); + client->Message(Chat::Red, "Error: Corpse locked by GM."); return; } @@ -960,7 +960,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a loot_coin = (tmp[0] == 1 && tmp[1] == '\0'); if (loot_request_type == LootRequestType::GMPeek || loot_request_type == LootRequestType::GMAllowed) { - client->Message(15, "This corpse contains %u platinum, %u gold, %u silver and %u copper.", + client->Message(Chat::Yellow, "This corpse contains %u platinum, %u gold, %u silver and %u copper.", GetPlatinum(), GetGold(), GetSilver(), GetCopper()); auto outapp = new EQApplicationPacket(OP_MoneyOnCorpse, sizeof(moneyOnCorpseStruct)); @@ -1035,7 +1035,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a else { Log(Logs::General, Logs::Inventory, "MakeLootRequestPackets() PlayerKillItem %i not found", pkitemid); - client->Message(CC_Red, "PlayerKillItem (id: %i) could not be found!", pkitemid); + client->Message(Chat::Red, "PlayerKillItem (id: %i) could not be found!", pkitemid); } client->QueuePacket(app); @@ -1129,7 +1129,7 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app) /* To prevent item loss for a player using 'Loot All' who doesn't have inventory space for all their items. */ if (RuleB(Character, CheckCursorEmptyWhenLooting) && !client->GetInv().CursorEmpty()) { - client->Message(13, "You may not loot an item while you have an item on your cursor."); + client->Message(Chat::Red, "You may not loot an item while you have an item on your cursor."); client->QueuePacket(app); SendEndLootErrorPacket(client); /* Unlock corpse for others */ @@ -1146,7 +1146,7 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app) if (IsPlayerCorpse() && !CanPlayerLoot(client->CharacterID()) && !become_npc && (char_id != client->CharacterID() && client->Admin() < 150)) { - client->Message(13, "Error: This is a player corpse and you dont own it."); + client->Message(Chat::Red, "Error: This is a player corpse and you dont own it."); client->QueuePacket(app); SendEndLootErrorPacket(client); return; @@ -1155,13 +1155,13 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app) if (is_locked && client->Admin() < 100) { client->QueuePacket(app); SendLootReqErrorPacket(client, LootResponse::SomeoneElse); - client->Message(13, "Error: Corpse locked by GM."); + client->Message(Chat::Red, "Error: Corpse locked by GM."); return; } if (IsPlayerCorpse() && (char_id != client->CharacterID()) && CanPlayerLoot(client->CharacterID()) && GetPlayerKillItem() == 0) { - client->Message(13, "Error: You cannot loot any more items from this corpse."); + client->Message(Chat::Red, "Error: You cannot loot any more items from this corpse."); client->QueuePacket(app); SendEndLootErrorPacket(client); ResetLooter(); @@ -1201,7 +1201,7 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app) if (client && inst) { if (client->CheckLoreConflict(item)) { - client->Message_StringID(0, LOOT_LORE_ERROR); + client->Message_StringID(Chat::White, LOOT_LORE_ERROR); client->QueuePacket(app); SendEndLootErrorPacket(client); ResetLooter(); @@ -1214,7 +1214,7 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app) EQEmu::ItemInstance *itm = inst->GetAugment(i); if (itm) { if (client->CheckLoreConflict(itm->GetItem())) { - client->Message_StringID(0, LOOT_LORE_ERROR); + client->Message_StringID(Chat::White, LOOT_LORE_ERROR); client->QueuePacket(app); SendEndLootErrorPacket(client); ResetLooter(); @@ -1236,7 +1236,7 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app) args.push_back(this); if (parse->EventPlayer(EVENT_LOOT, client, buf, 0, &args) != 0) { lootitem->auto_loot = -1; - client->Message_StringID(CC_Red, LOOT_NOT_ALLOWED, inst->GetItem()->Name); + client->Message_StringID(Chat::Red, LOOT_NOT_ALLOWED, inst->GetItem()->Name); client->QueuePacket(app); delete inst; return; @@ -1312,18 +1312,18 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app) linker.GenerateLink(); - client->Message_StringID(MT_LootMessages, LOOTED_MESSAGE, linker.Link().c_str()); + client->Message_StringID(Chat::Loot, LOOTED_MESSAGE, linker.Link().c_str()); if (!IsPlayerCorpse()) { Group *g = client->GetGroup(); if (g != nullptr) { - g->GroupMessage_StringID(client, MT_LootMessages, OTHER_LOOTED_MESSAGE, + g->GroupMessage_StringID(client, Chat::Loot, OTHER_LOOTED_MESSAGE, client->GetName(), linker.Link().c_str()); } else { Raid *r = client->GetRaid(); if (r != nullptr) { - r->RaidMessage_StringID(client, MT_LootMessages, OTHER_LOOTED_MESSAGE, + r->RaidMessage_StringID(client, Chat::Loot, OTHER_LOOTED_MESSAGE, client->GetName(), linker.Link().c_str()); } } @@ -1426,7 +1426,7 @@ bool Corpse::Summon(Client* client, bool spell, bool CheckDistance) { if (!spell) { if (this->GetCharID() == client->CharacterID()) { if (IsLocked() && client->Admin() < 100) { - client->Message(13, "That corpse is locked by a GM."); + client->Message(Chat::Red, "That corpse is locked by a GM."); return false; } if (!CheckDistance || (DistanceSquaredNoZ(m_Position, client->GetPosition()) <= dist2)) { diff --git a/zone/doors.cpp b/zone/doors.cpp index 899e3f6b5..15f61ba47 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -171,7 +171,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) { if (RuleI(Adventure, ItemIDToEnablePorts) != 0) { if (!sender->KeyRingCheck(RuleI(Adventure, ItemIDToEnablePorts))) { if (sender->GetInv().HasItem(RuleI(Adventure, ItemIDToEnablePorts)) == INVALID_INDEX) { - sender->Message_StringID(13, DUNGEON_SEALED); + sender->Message_StringID(Chat::Red, DUNGEON_SEALED); safe_delete(outapp); return; } else { @@ -267,7 +267,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) { strcpy(door_message, "Door is locked by an unknown guild"); } - sender->Message(4, door_message); + sender->Message(Chat::LightBlue, door_message); safe_delete(outapp); return; } @@ -275,13 +275,13 @@ void Doors::HandleClick(Client* sender, uint8 trigger) { /** * Key required */ - sender->Message(4, "This is locked..."); + sender->Message(Chat::LightBlue, "This is locked..."); /** * GM can always open locks */ if (sender->GetGM()) { - sender->Message_StringID(4, DOORS_GM); + sender->Message_StringID(Chat::LightBlue, DOORS_GM); if (!IsDoorOpen() || (open_type == 58)) { move_door_packet->action = static_cast(invert_state == 0 ? OPEN_DOOR : OPEN_INVDOOR); @@ -306,7 +306,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) { sender->KeyRingAdd(player_key); } - sender->Message(4, "You got it open!"); + sender->Message(Chat::LightBlue, "You got it open!"); if (!IsDoorOpen() || (open_type == 58)) { move_door_packet->action = static_cast(invert_state == 0 ? OPEN_DOOR : OPEN_INVDOOR); @@ -333,19 +333,19 @@ void Doors::HandleClick(Client* sender, uint8 trigger) { } else { move_door_packet->action = static_cast(invert_state == 0 ? CLOSE_DOOR : CLOSE_INVDOOR); } - sender->Message_StringID(4, DOORS_SUCCESSFUL_PICK); + sender->Message_StringID(Chat::LightBlue, DOORS_SUCCESSFUL_PICK); } else { - sender->Message_StringID(4, DOORS_INSUFFICIENT_SKILL); + sender->Message_StringID(Chat::LightBlue, DOORS_INSUFFICIENT_SKILL); safe_delete(outapp); return; } } else { - sender->Message_StringID(4, DOORS_NO_PICK); + sender->Message_StringID(Chat::LightBlue, DOORS_NO_PICK); safe_delete(outapp); return; } } else { - sender->Message_StringID(4, DOORS_CANT_PICK); + sender->Message_StringID(Chat::LightBlue, DOORS_CANT_PICK); safe_delete(outapp); return; } @@ -361,14 +361,14 @@ void Doors::HandleClick(Client* sender, uint8 trigger) { */ if (sender->KeyRingCheck(required_key_item)) { player_key = required_key_item; - sender->Message(4, "You got it open!"); // more debug spam + sender->Message(Chat::LightBlue, "You got it open!"); // more debug spam if (!IsDoorOpen() || (open_type == 58)) { move_door_packet->action = static_cast(invert_state == 0 ? OPEN_DOOR : OPEN_INVDOOR); } else { move_door_packet->action = static_cast(invert_state == 0 ? CLOSE_DOOR : CLOSE_INVDOOR); } } else { - sender->Message_StringID(4, DOORS_LOCKED); + sender->Message_StringID(Chat::LightBlue, DOORS_LOCKED); safe_delete(outapp); return; } diff --git a/zone/effects.cpp b/zone/effects.cpp index 7887eb652..e51d540ad 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -122,11 +122,11 @@ int32 Mob::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) { else if (IsNPC() && CastToNPC()->GetSpellScale()) value = int(static_cast(value) * CastToNPC()->GetSpellScale() / 100.0f); - entity_list.MessageClose_StringID(this, true, 100, MT_SpellCrits, + entity_list.MessageClose_StringID(this, true, 100, Chat::SpellCrit, OTHER_CRIT_BLAST, GetName(), itoa(-value)); if (IsClient()) - Message_StringID(MT_SpellCrits, YOU_CRIT_BLAST, itoa(-value)); + Message_StringID(Chat::SpellCrit, YOU_CRIT_BLAST, itoa(-value)); return value; } @@ -306,11 +306,11 @@ int32 Mob::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { value = int(static_cast(value) * CastToNPC()->GetHealScale() / 100.0f); if (Critical) { - entity_list.MessageClose_StringID(this, true, 100, MT_SpellCrits, + entity_list.MessageClose_StringID(this, true, 100, Chat::SpellCrit, OTHER_CRIT_HEAL, GetName(), itoa(value)); if (IsClient()) - Message_StringID(MT_SpellCrits, YOU_CRIT_HEAL, itoa(value)); + Message_StringID(Chat::SpellCrit, YOU_CRIT_HEAL, itoa(value)); } return value; @@ -432,13 +432,13 @@ bool Client::TrainDiscipline(uint32 itemid) { //get the item info const EQEmu::ItemData *item = database.GetItem(itemid); if(item == nullptr) { - Message(13, "Unable to find the tome you turned in!"); + Message(Chat::Red, "Unable to find the tome you turned in!"); Log(Logs::General, Logs::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid); return(false); } if (!item->IsClassCommon() || item->ItemType != EQEmu::item::ItemTypeSpell) { - Message(13, "Invalid item type, you cannot learn from this item."); + Message(Chat::Red, "Invalid item type, you cannot learn from this item."); //summon them the item back... SummonItem(itemid); return(false); @@ -462,7 +462,7 @@ bool Client::TrainDiscipline(uint32 itemid) { item->Name[5] == ':' && item->Name[6] == ' ' )) { - Message(13, "This item is not a tome."); + Message(Chat::Red, "This item is not a tome."); //summon them the item back... SummonItem(itemid); return(false); @@ -470,7 +470,7 @@ bool Client::TrainDiscipline(uint32 itemid) { int myclass = GetClass(); if(myclass == WIZARD || myclass == ENCHANTER || myclass == MAGICIAN || myclass == NECROMANCER) { - Message(13, "Your class cannot learn from this tome."); + Message(Chat::Red, "Your class cannot learn from this tome."); //summon them the item back... SummonItem(itemid); return(false); @@ -480,7 +480,7 @@ bool Client::TrainDiscipline(uint32 itemid) { //can we use the item? uint32 cbit = 1 << (myclass-1); if(!(item->Classes & cbit)) { - Message(13, "Your class cannot learn from this tome."); + Message(Chat::Red, "Your class cannot learn from this tome."); //summon them the item back... SummonItem(itemid); return(false); @@ -488,7 +488,7 @@ bool Client::TrainDiscipline(uint32 itemid) { uint32 spell_id = item->Scroll.Effect; if(!IsValidSpell(spell_id)) { - Message(13, "This tome contains invalid knowledge."); + Message(Chat::Red, "This tome contains invalid knowledge."); return(false); } @@ -496,14 +496,14 @@ bool Client::TrainDiscipline(uint32 itemid) { const SPDat_Spell_Struct &spell = spells[spell_id]; uint8 level_to_use = spell.classes[myclass - 1]; if(level_to_use == 255) { - Message(13, "Your class cannot learn from this tome."); + Message(Chat::Red, "Your class cannot learn from this tome."); //summon them the item back... SummonItem(itemid); return(false); } if(level_to_use > GetLevel()) { - Message(13, "You must be at least level %d to learn this discipline.", level_to_use); + Message(Chat::Red, "You must be at least level %d to learn this discipline.", level_to_use); //summon them the item back... SummonItem(itemid); return(false); @@ -513,7 +513,7 @@ bool Client::TrainDiscipline(uint32 itemid) { int r; for(r = 0; r < MAX_PP_DISCIPLINES; r++) { if(m_pp.disciplines.values[r] == spell_id) { - Message(13, "You already know this discipline."); + Message(Chat::Red, "You already know this discipline."); //summon them the item back... SummonItem(itemid); return(false); @@ -525,7 +525,7 @@ bool Client::TrainDiscipline(uint32 itemid) { return(true); } } - Message(13, "You have learned too many disciplines and can learn no more."); + Message(Chat::Red, "You have learned too many disciplines and can learn no more."); return(false); } @@ -537,7 +537,7 @@ void Client::TrainDiscBySpellID(int32 spell_id) m_pp.disciplines.values[i] = spell_id; database.SaveCharacterDisc(this->CharacterID(), i, spell_id); SendDisciplineUpdate(); - Message(15, "You have learned a new combat ability!"); + Message(Chat::Yellow, "You have learned a new combat ability!"); return; } } @@ -581,7 +581,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { //make sure we can use it.. if(!IsValidSpell(spell_id)) { - Message(13, "This tome contains invalid knowledge."); + Message(Chat::Red, "This tome contains invalid knowledge."); return(false); } @@ -589,13 +589,13 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { const SPDat_Spell_Struct &spell = spells[spell_id]; uint8 level_to_use = spell.classes[GetClass() - 1]; if(level_to_use == 255) { - Message(13, "Your class cannot learn from this tome."); + Message(Chat::Red, "Your class cannot learn from this tome."); //should summon them a new one... return(false); } if(level_to_use > GetLevel()) { - Message_StringID(13, DISC_LEVEL_USE_ERROR); + Message_StringID(Chat::Red, DISC_LEVEL_USE_ERROR); //should summon them a new one... return(false); } @@ -607,7 +607,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { // sneak attack discs require you to be hidden for 4 seconds before use if (spell.sneak && (!hidden || (hidden && (Timer::GetCurrentTime() - tmHidden) < 4000))) { - Message_StringID(MT_SpellFailure, SNEAK_RESTRICT); + Message_StringID(Chat::SpellFailure, SNEAK_RESTRICT); return false; } @@ -621,7 +621,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { /*char val1[20]={0};*/ //unused /*char val2[20]={0};*/ //unused uint32 remain = p_timers.GetRemainingTime(DiscTimer); - //Message_StringID(0, DISCIPLINE_CANUSEIN, ConvertArray((remain)/60,val1), ConvertArray(remain%60,val2)); + //Message_StringID(Chat::WhiteSmoke, DISCIPLINE_CANUSEIN, ConvertArray((remain)/60,val1), ConvertArray(remain%60,val2)); Message(0, "You can use this discipline in %d minutes %d seconds.", ((remain)/60), (remain%60)); return(false); } diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index bdb190e9c..5cb17ca50 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -160,7 +160,7 @@ XS(XS__say) { opts.speak_mode = Journal::SpeakMode::Say; opts.journal_mode = Journal::Mode::Log2; opts.language = 0; - opts.message_type = MT_NPCQuestSay; + opts.message_type = Chat::NPCQuestSay; if (items == 0 || items > 5) { Perl_croak(aTHX_ "Usage: quest::say(string message, [int language_id], [int message_type], [int speak_mode], [int journal_mode])"); } else if (items == 2) { diff --git a/zone/entity.cpp b/zone/entity.cpp index 1c8de0780..97678b2d0 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -1671,9 +1671,9 @@ void EntityList::DuelMessage(Mob *winner, Mob *loser, bool flee) //might want some sort of distance check in here? if (cur != winner && cur != loser) { if (flee) - cur->Message_StringID(15, DUEL_FLED, winner->GetName(),loser->GetName(),loser->GetName()); + cur->Message_StringID(Chat::Yellow, DUEL_FLED, winner->GetName(),loser->GetName(),loser->GetName()); else - cur->Message_StringID(15, DUEL_FINISHED, winner->GetName(),loser->GetName()); + cur->Message_StringID(Chat::Yellow, DUEL_FINISHED, winner->GetName(),loser->GetName()); } ++it; } @@ -2099,6 +2099,23 @@ void EntityList::MessageClose_StringID(Mob *sender, bool skipsender, float dist, } } +/** + * @param sender + * @param skipsender + * @param dist + * @param type + * @param filter + * @param string_id + * @param message1 + * @param message2 + * @param message3 + * @param message4 + * @param message5 + * @param message6 + * @param message7 + * @param message8 + * @param message9 + */ void EntityList::FilteredMessageClose_StringID(Mob *sender, bool skipsender, float dist, uint32 type, eqFilterType filter, uint32 string_id, const char *message1, const char *message2, const char *message3, @@ -2774,7 +2791,7 @@ void EntityList::CorpseFix(Client* c) Corpse* corpse = it->second; if (corpse->IsNPCCorpse()) { if (DistanceNoZ(c->GetPosition(), corpse->GetPosition()) < 100) { - c->Message(15, "Attempting to fix %s", it->second->GetCleanName()); + c->Message(Chat::Yellow, "Attempting to fix %s", it->second->GetCleanName()); corpse->GMMove(corpse->GetX(), corpse->GetY(), c->GetZ() + 2, 0); } } @@ -4632,7 +4649,7 @@ void EntityList::ExpeditionWarning(uint32 minutes_left) auto it = client_list.begin(); while (it != client_list.end()) { - it->second->Message_StringID(15, EXPEDITION_MIN_REMAIN, itoa((int)minutes_left)); + it->second->Message_StringID(Chat::Yellow, EXPEDITION_MIN_REMAIN, itoa((int)minutes_left)); it->second->QueuePacket(outapp); ++it; } diff --git a/zone/exp.cpp b/zone/exp.cpp index 63fbff79a..2fe87997b 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -333,18 +333,18 @@ void Client::CalculateLeadershipExp(uint32 &add_exp, uint8 conlevel) uint32 mentor_exp = exp * (GetGroup()->GetMentorPercent() / 100.0f); exp -= mentor_exp; mentoree->AddLeadershipEXP(mentor_exp, 0); // ends up rounded down - mentoree->Message_StringID(MT_Leadership, GAIN_GROUP_LEADERSHIP_EXP); + mentoree->Message_StringID(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_EXP); } if (exp > 0) { // possible if you mentor 100% to the other client AddLeadershipEXP(exp, 0); // ends up rounded up if mentored, no idea how live actually does it - Message_StringID(MT_Leadership, GAIN_GROUP_LEADERSHIP_EXP); + Message_StringID(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_EXP); } } else { - Message_StringID(MT_Leadership, MAX_GROUP_LEADERSHIP_POINTS); + Message_StringID(Chat::LeaderShip, MAX_GROUP_LEADERSHIP_POINTS); } } else @@ -357,11 +357,11 @@ void Client::CalculateLeadershipExp(uint32 &add_exp, uint8 conlevel) && RuleI(Character, KillsPerRaidLeadershipAA) > 0) { AddLeadershipEXP(0, RAID_EXP_PER_POINT / RuleI(Character, KillsPerRaidLeadershipAA)); - Message_StringID(MT_Leadership, GAIN_RAID_LEADERSHIP_EXP); + Message_StringID(Chat::LeaderShip, GAIN_RAID_LEADERSHIP_EXP); } else { - Message_StringID(MT_Leadership, MAX_RAID_LEADERSHIP_POINTS); + Message_StringID(Chat::LeaderShip, MAX_RAID_LEADERSHIP_POINTS); } } else @@ -378,17 +378,17 @@ void Client::CalculateLeadershipExp(uint32 &add_exp, uint8 conlevel) uint32 mentor_exp = exp * (raid->GetMentorPercent(group_id) / 100.0f); exp -= mentor_exp; mentoree->AddLeadershipEXP(mentor_exp, 0); - mentoree->Message_StringID(MT_Leadership, GAIN_GROUP_LEADERSHIP_EXP); + mentoree->Message_StringID(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_EXP); } if (exp > 0) { AddLeadershipEXP(exp, 0); - Message_StringID(MT_Leadership, GAIN_GROUP_LEADERSHIP_EXP); + Message_StringID(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_EXP); } } else { - Message_StringID(MT_Leadership, MAX_GROUP_LEADERSHIP_POINTS); + Message_StringID(Chat::LeaderShip, MAX_GROUP_LEADERSHIP_POINTS); } } } @@ -514,7 +514,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) { // AA Sanity Checking for players who set aa exp and deleveled below allowed aa level. if (GetLevel() <= 50 && m_epp.perAA > 0) { - Message(15, "You are below the level allowed to gain AA Experience. AA Experience set to 0%"); + Message(Chat::Yellow, "You are below the level allowed to gain AA Experience. AA Experience set to 0%"); aaexp = 0; m_epp.perAA = 0; } @@ -528,7 +528,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { auto max_AAXP = GetRequiredAAExperience(); if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) { - Message(13, "Error in Client::SetEXP. EXP not set."); + Message(Chat::Red, "Error in Client::SetEXP. EXP not set."); return; // Must be invalid class/race } uint32 i = 0; @@ -564,23 +564,23 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { if (isrezzexp) { if (RuleI(Character, ShowExpValues) > 0) - Message(MT_Experience, "You regain %s experience from resurrection. %s", exp_amount_message.c_str(), exp_percent_message.c_str()); - else Message_StringID(MT_Experience, REZ_REGAIN); + Message(Chat::Experience, "You regain %s experience from resurrection. %s", exp_amount_message.c_str(), exp_percent_message.c_str()); + else Message_StringID(Chat::Experience, REZ_REGAIN); } else { if (membercount > 1) { if (RuleI(Character, ShowExpValues) > 0) - Message(MT_Experience, "You have gained %s party experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str()); - else Message_StringID(MT_Experience, GAIN_GROUPXP); + Message(Chat::Experience, "You have gained %s party experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str()); + else Message_StringID(Chat::Experience, GAIN_GROUPXP); } else if (IsRaidGrouped()) { if (RuleI(Character, ShowExpValues) > 0) - Message(MT_Experience, "You have gained %s raid experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str()); - else Message_StringID(MT_Experience, GAIN_RAIDEXP); + Message(Chat::Experience, "You have gained %s raid experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str()); + else Message_StringID(Chat::Experience, GAIN_RAIDEXP); } else { if (RuleI(Character, ShowExpValues) > 0) - Message(MT_Experience, "You have gained %s experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str()); - else Message_StringID(MT_Experience, GAIN_XP); + Message(Chat::Experience, "You have gained %s experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str()); + else Message_StringID(Chat::Experience, GAIN_XP); } } } @@ -588,9 +588,9 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { uint32 exp_lost = m_pp.exp - set_exp; float exp_percent = (float)((float)exp_lost / (float)(GetEXPForLevel(GetLevel() + 1) - GetEXPForLevel(GetLevel())))*(float)100; - if (RuleI(Character, ShowExpValues) == 1 && exp_lost > 0) Message(15, "You have lost %i experience.", exp_lost); - else if (RuleI(Character, ShowExpValues) == 2 && exp_lost > 0) Message(15, "You have lost %i experience. (%.3f%%)", exp_lost, exp_percent); - else Message(15, "You have lost experience."); + if (RuleI(Character, ShowExpValues) == 1 && exp_lost > 0) Message(Chat::Yellow, "You have lost %i experience.", exp_lost); + else if (RuleI(Character, ShowExpValues) == 2 && exp_lost > 0) Message(Chat::Yellow, "You have lost %i experience. (%.3f%%)", exp_lost, exp_percent); + else Message(Chat::Yellow, "You have lost experience."); } //check_level represents the level we should be when we have @@ -654,9 +654,9 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { //figure out how many points were actually gained /*uint32 gained = m_pp.aapoints - last_unspentAA;*/ //unused - //Message(15, "You have gained %d skill points!!", m_pp.aapoints - last_unspentAA); + //Message(Chat::Yellow, "You have gained %d skill points!!", m_pp.aapoints - last_unspentAA); char val1[20]={0}; - Message_StringID(MT_Experience, GAIN_ABILITY_POINT, ConvertArray(m_pp.aapoints, val1),m_pp.aapoints == 1 ? "" : "(s)"); //You have gained an ability point! You now have %1 ability point%2. + Message_StringID(Chat::Experience, GAIN_ABILITY_POINT, ConvertArray(m_pp.aapoints, val1),m_pp.aapoints == 1 ? "" : "(s)"); //You have gained an ability point! You now have %1 ability point%2. /* QS: PlayerLogAARate */ if (RuleB(QueryServ, PlayerLogAARate)){ @@ -665,7 +665,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { QServ->SendQuery(query.c_str()); } - //Message(15, "You now have %d skill points available to spend.", m_pp.aapoints); + //Message(Chat::Yellow, "You now have %d skill points available to spend.", m_pp.aapoints); } uint8 maxlevel = RuleI(Character, MaxExpLevel) + 1; @@ -699,18 +699,18 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { if (level_increase) { if (level_count == 1) - Message_StringID(MT_Experience, GAIN_LEVEL, ConvertArray(check_level, val1)); + Message_StringID(Chat::Experience, GAIN_LEVEL, ConvertArray(check_level, val1)); else - Message(15, "Welcome to level %i!", check_level); + Message(Chat::Yellow, "Welcome to level %i!", check_level); if (check_level == RuleI(Character, DeathItemLossLevel)) - Message_StringID(15, CORPSE_ITEM_LOST); + Message_StringID(Chat::Yellow, CORPSE_ITEM_LOST); if (check_level == RuleI(Character, DeathExpLossLevel)) - Message_StringID(15, CORPSE_EXP_LOST); + Message_StringID(Chat::Yellow, CORPSE_EXP_LOST); } else - Message_StringID(MT_Experience, LOSE_LEVEL, ConvertArray(check_level, val1)); + Message_StringID(Chat::Experience, LOSE_LEVEL, ConvertArray(check_level, val1)); #ifdef BOTS uint8 myoldlevel = GetLevel(); @@ -758,7 +758,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { char val1[20]={0}; char val2[20]={0}; char val3[20]={0}; - Message_StringID(MT_Experience, GM_GAINXP, ConvertArray(set_aaxp,val1),ConvertArray(set_exp,val2),ConvertArray(GetEXPForLevel(GetLevel()+1),val3)); //[GM] You have gained %1 AXP and %2 EXP (%3). + Message_StringID(Chat::Experience, GM_GAINXP, ConvertArray(set_aaxp,val1),ConvertArray(set_exp,val2),ConvertArray(GetEXPForLevel(GetLevel()+1),val3)); //[GM] You have gained %1 AXP and %2 EXP (%3). } } @@ -812,7 +812,7 @@ void Client::SetLevel(uint8 set_level, bool command) m_pp.level = set_level; if (command){ m_pp.exp = GetEXPForLevel(set_level); - Message(15, "Welcome to level %i!", set_level); + Message(Chat::Yellow, "Welcome to level %i!", set_level); lu->exp = 0; } else { @@ -1077,12 +1077,12 @@ void Client::SetLeadershipEXP(uint32 group_exp, uint32 raid_exp) { while(group_exp >= GROUP_EXP_PER_POINT) { group_exp -= GROUP_EXP_PER_POINT; m_pp.group_leadership_points++; - Message_StringID(MT_Leadership, GAIN_GROUP_LEADERSHIP_POINT); + Message_StringID(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_POINT); } while(raid_exp >= RAID_EXP_PER_POINT) { raid_exp -= RAID_EXP_PER_POINT; m_pp.raid_leadership_points++; - Message_StringID(MT_Leadership, GAIN_RAID_LEADERSHIP_POINT); + Message_StringID(Chat::LeaderShip, GAIN_RAID_LEADERSHIP_POINT); } m_pp.group_leadership_exp = group_exp; diff --git a/zone/forage.cpp b/zone/forage.cpp index 3bdb87d7a..df3cce2a0 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -161,14 +161,14 @@ bool Client::CanFish() { if (!Pole || !Pole->IsClassCommon() || Pole->GetItem()->ItemType != EQEmu::item::ItemTypeFishingPole) { if (m_inv.HasItemByUse(EQEmu::item::ItemTypeFishingPole, 1, invWhereWorn | invWherePersonal | invWhereBank | invWhereSharedBank | invWhereTrading | invWhereCursor)) //We have a fishing pole somewhere, just not equipped - Message_StringID(MT_Skills, FISHING_EQUIP_POLE); //You need to put your fishing pole in your primary hand. + Message_StringID(Chat::Skills, FISHING_EQUIP_POLE); //You need to put your fishing pole in your primary hand. else //We don't have a fishing pole anywhere - Message_StringID(MT_Skills, FISHING_NO_POLE); //You can't fish without a fishing pole, go buy one. + Message_StringID(Chat::Skills, FISHING_NO_POLE); //You can't fish without a fishing pole, go buy one. return false; } if (!Bait || !Bait->IsClassCommon() || Bait->GetItem()->ItemType != EQEmu::item::ItemTypeFishingBait) { - Message_StringID(MT_Skills, FISHING_NO_BAIT); //You can't fish without fishing bait, go buy some. + Message_StringID(Chat::Skills, FISHING_NO_BAIT); //You can't fish without fishing bait, go buy some. return false; } @@ -190,7 +190,7 @@ bool Client::CanFish() { float bestz = zone->zonemap->FindBestZ(rodPosition, nullptr); float len = m_Position.z - bestz; if(len > LineLength || len < 0.0f) { - Message_StringID(MT_Skills, FISHING_LAND); + Message_StringID(Chat::Skills, FISHING_LAND); return false; } @@ -203,7 +203,7 @@ bool Client::CanFish() { bool in_water = zone->watermap->InWater(dest) || zone->watermap->InVWater(dest); if (in_lava) { - Message_StringID(MT_Skills, FISHING_LAVA); //Trying to catch a fire elemental or something? + Message_StringID(Chat::Skills, FISHING_LAVA); //Trying to catch a fire elemental or something? return false; } @@ -212,7 +212,7 @@ bool Client::CanFish() { } } - Message_StringID(MT_Skills, FISHING_LAND); + Message_StringID(Chat::Skills, FISHING_LAND); return false; } return true; @@ -223,7 +223,7 @@ void Client::GoFish() //TODO: generate a message if we're already fishing /*if (!fishing_timer.Check()) { //this isn't the right check, may need to add something to the Client class like 'bool is_fishing' - Message_StringID(0, ALREADY_FISHING); //You are already fishing! + Message_StringID(Chat::WhiteSmoke, ALREADY_FISHING); //You are already fishing! return; }*/ @@ -293,12 +293,12 @@ void Client::GoFish() entity_list.AddNPC(npc); - Message(MT_Emote, + Message(Chat::Emote, "You fish up a little more than you bargained for..."); } } else { - Message(MT_Emote, "You notice something lurking just below the water's surface..."); + Message(Chat::Emote, "You notice something lurking just below the water's surface..."); } } } @@ -315,17 +315,17 @@ void Client::GoFish() const EQEmu::ItemData* food_item = database.GetItem(food_id); if (food_item->ItemType != EQEmu::item::ItemTypeFood) { - Message_StringID(MT_Skills, FISHING_SUCCESS); + Message_StringID(Chat::Skills, FISHING_SUCCESS); } else { - Message_StringID(MT_Skills, FISHING_SUCCESS_FISH_NAME, food_item->Name); + Message_StringID(Chat::Skills, FISHING_SUCCESS_FISH_NAME, food_item->Name); } EQEmu::ItemInstance* inst = database.CreateItem(food_item, 1); if(inst != nullptr) { if(CheckLoreConflict(inst->GetItem())) { - Message_StringID(0, DUP_LORE); + Message_StringID(Chat::White, DUP_LORE); safe_delete(inst); } else @@ -351,13 +351,13 @@ void Client::GoFish() //chance to use bait when you dont catch anything... if (zone->random.Int(0, 4) == 1) { DeleteItemInInventory(bslot, 1, true); //do we need client update? - Message_StringID(MT_Skills, FISHING_LOST_BAIT); //You lost your bait! + Message_StringID(Chat::Skills, FISHING_LOST_BAIT); //You lost your bait! } else { if (zone->random.Int(0, 15) == 1) //give about a 1 in 15 chance to spill your beer. we could make this a rule, but it doesn't really seem worth it //TODO: check for & consume an alcoholic beverage from inventory when this triggers, and set it as a rule that's disabled by default - Message_StringID(MT_Skills, FISHING_SPILL_BEER); //You spill your beer while bringing in your line. + Message_StringID(Chat::Skills, FISHING_SPILL_BEER); //You spill your beer while bringing in your line. else - Message_StringID(MT_Skills, FISHING_FAILED); //You didn't catch anything. + Message_StringID(Chat::Skills, FISHING_FAILED); //You didn't catch anything. } parse->EventPlayer(EVENT_FISH_FAILURE, this, "", 0); @@ -367,7 +367,7 @@ void Client::GoFish() //this is potentially exploitable in that they can fish //and then swap out items in primary slot... too lazy to fix right now if (zone->random.Int(0, 49) == 1) { - Message_StringID(MT_Skills, FISHING_POLE_BROKE); //Your fishing pole broke! + Message_StringID(Chat::Skills, FISHING_POLE_BROKE); //Your fishing pole broke! DeleteItemInInventory(EQEmu::invslot::slotPrimary, 0, true); } @@ -434,13 +434,13 @@ void Client::ForageItem(bool guarantee) { break; } - Message_StringID(MT_Skills, stringid); + Message_StringID(Chat::Skills, stringid); EQEmu::ItemInstance* inst = database.CreateItem(food_item, 1); if(inst != nullptr) { // check to make sure it isn't a foraged lore item if(CheckLoreConflict(inst->GetItem())) { - Message_StringID(0, DUP_LORE); + Message_StringID(Chat::White, DUP_LORE); safe_delete(inst); } else { @@ -462,12 +462,12 @@ void Client::ForageItem(bool guarantee) { int ChanceSecondForage = aabonuses.ForageAdditionalItems + itembonuses.ForageAdditionalItems + spellbonuses.ForageAdditionalItems; if(!guarantee && zone->random.Roll(ChanceSecondForage)) { - Message_StringID(MT_Skills, FORAGE_MASTERY); + Message_StringID(Chat::Skills, FORAGE_MASTERY); ForageItem(true); } } else { - Message_StringID(MT_Skills, FORAGE_FAILED); + Message_StringID(Chat::Skills, FORAGE_FAILED); parse->EventPlayer(EVENT_FORAGE_FAILURE, this, "", 0); } diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index eafe4b9f5..43157ed2d 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -1391,7 +1391,7 @@ bool GuildApproval::ProcessApproval() { if(owner && owner->GuildID() != 0) { - owner->Message(10,"You are already in a guild! Guild request deleted."); + owner->Message(Chat::NPCQuestSay,"You are already in a guild! Guild request deleted."); return false; } if(deletion_timer->Check() || !owner) diff --git a/zone/horse.cpp b/zone/horse.cpp index 6c81b3d21..3871b355d 100644 --- a/zone/horse.cpp +++ b/zone/horse.cpp @@ -118,7 +118,7 @@ const NPCType *Horse::BuildHorseType(uint16 spell_id) { void Client::SummonHorse(uint16 spell_id) { if (GetHorseId() != 0) { - Message(13,"You already have a Horse. Get off, Fatbutt!"); + Message(Chat::Red,"You already have a Horse. Get off, Fatbutt!"); return; } if(!Horse::IsHorseSpell(spell_id)) { diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 96f0fe15b..b24d03795 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -185,7 +185,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // make sure the item exists if(item == nullptr) { - Message(13, "Item %u does not exist.", item_id); + Message(Chat::Red, "Item %u does not exist.", item_id); Log(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item_id, aug1, aug2, aug3, aug4, aug5, aug6); @@ -194,13 +194,13 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check that there is not a lore conflict between base item and existing inventory else if(CheckLoreConflict(item)) { // DuplicateLoreMessage(item_id); - Message(13, "You already have a lore %s (%i) in your inventory.", item->Name, item_id); + Message(Chat::Red, "You already have a lore %s (%i) in your inventory.", item->Name, item_id); return false; } // check to make sure we are augmenting an augmentable item else if (((!item->IsClassCommon()) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5 | aug6)) { - Message(13, "You can not augment an augment or a non-common class item."); + Message(Chat::Red, "You can not augment an augment or a non-common class item."); Log(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug5: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); @@ -214,7 +214,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check to make sure we are a GM if the item is GM-only /* else if(item->MinStatus && ((this->Admin() < item->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) { - Message(13, "You are not a GM or do not have the status to summon this item."); + Message(Chat::Red, "You are not a GM or do not have the status to summon this item."); Log(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u, MinStatus: %u)\n", GetName(), account_name, this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus); @@ -237,7 +237,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(augtest == nullptr) { if(augments[iter]) { - Message(13, "Augment %u (Aug%i) does not exist.", augments[iter], iter + 1); + Message(Chat::Red, "Augment %u (Aug%i) does not exist.", augments[iter], iter + 1); Log(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); @@ -248,13 +248,13 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check that there is not a lore conflict between augment and existing inventory if(CheckLoreConflict(augtest)) { // DuplicateLoreMessage(augtest->ID); - Message(13, "You already have a lore %s (%u) in your inventory.", augtest->Name, augtest->ID); + Message(Chat::Red, "You already have a lore %s (%u) in your inventory.", augtest->Name, augtest->ID); return false; } // check that augment is an actual augment else if(augtest->AugType == 0) { - Message(13, "%s (%u) (Aug%i) is not an actual augment.", augtest->Name, augtest->ID, iter + 1); + Message(Chat::Red, "%s (%u) (Aug%i) is not an actual augment.", augtest->Name, augtest->ID, iter + 1); Log(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, (iter + 1), aug1, aug2, aug3, aug4, aug5, aug6); @@ -266,7 +266,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check to make sure we are a GM if the augment is GM-only /* else if(augtest->MinStatus && ((this->Admin() < augtest->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) { - Message(13, "You are not a GM or do not have the status to summon this augment."); + Message(Chat::Red, "You are not a GM or do not have the status to summon this augment."); Log(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to create a GM-only augment (Aug%i) with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n", GetName(), account_name, (iter + 1), this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus); @@ -277,7 +277,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for augment type allowance if(enforcewear) { if ((item->AugSlotType[iter] == EQEmu::item::AugTypeNone) || !(((uint32)1 << (item->AugSlotType[iter] - 1)) & augtest->AugType)) { - Message(13, "Augment %u (Aug%i) is not acceptable wear on Item %u.", augments[iter], iter + 1, item->ID); + Message(Chat::Red, "Augment %u (Aug%i) is not acceptable wear on Item %u.", augments[iter], iter + 1, item->ID); Log(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); @@ -285,7 +285,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, } if(item->AugSlotVisible[iter] == 0) { - Message(13, "Item %u has not evolved enough to accept Augment %u (Aug%i).", item->ID, augments[iter], iter + 1); + Message(Chat::Red, "Item %u has not evolved enough to accept Augment %u (Aug%i).", item->ID, augments[iter], iter + 1); Log(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); @@ -462,7 +462,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, } if(restrictfail) { - Message(13, "Augment %u (Aug%i) is restricted from wear on Item %u.", augments[iter], (iter + 1), item->ID); + Message(Chat::Red, "Augment %u (Aug%i) is restricted from wear on Item %u.", augments[iter], (iter + 1), item->ID); Log(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); @@ -473,7 +473,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(enforceusable) { // check for class usability if(item->Classes && !(classes &= augtest->Classes)) { - Message(13, "Augment %u (Aug%i) will result in an item not usable by any class.", augments[iter], (iter + 1)); + Message(Chat::Red, "Augment %u (Aug%i) will result in an item not usable by any class.", augments[iter], (iter + 1)); Log(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); @@ -482,7 +482,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for race usability if(item->Races && !(races &= augtest->Races)) { - Message(13, "Augment %u (Aug%i) will result in an item not usable by any race.", augments[iter], (iter + 1)); + Message(Chat::Red, "Augment %u (Aug%i) will result in an item not usable by any race.", augments[iter], (iter + 1)); Log(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); @@ -491,7 +491,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for slot usability if(item->Slots && !(slots &= augtest->Slots)) { - Message(13, "Augment %u (Aug%i) will result in an item not usable in any slot.", augments[iter], (iter + 1)); + Message(Chat::Red, "Augment %u (Aug%i) will result in an item not usable in any slot.", augments[iter], (iter + 1)); Log(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); @@ -517,7 +517,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, EQEmu::ItemInstance* inst = database.CreateItem(item, charges); if(inst == nullptr) { - Message(13, "An unknown server error has occurred and your item was not created."); + Message(Chat::Red, "An unknown server error has occurred and your item was not created."); // this goes to logfile since this is a major error Log(Logs::General, Logs::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); @@ -652,7 +652,7 @@ void Client::DropItem(int16 slot_id, bool recurse) } else { // Item doesn't exist in inventory! Log(Logs::General, Logs::Inventory, "DropItem() - No item found in slot %i", slot_id); - Message(13, "Error: Item not found in slot %i", slot_id); + Message(Chat::Red, "Error: Item not found in slot %i", slot_id); return; } @@ -752,14 +752,14 @@ void Client::DropInst(const EQEmu::ItemInstance* inst) { if (!inst) { // Item doesn't exist in inventory! - Message(13, "Error: Item not found"); + Message(Chat::Red, "Error: Item not found"); return; } if (inst->GetItem()->NoDrop == 0) { - Message(13, "This item is NODROP. Deleting."); + Message(Chat::Red, "This item is NODROP. Deleting."); return; } @@ -853,7 +853,7 @@ void Client::SendCursorBuffer() if (!lore_pass) { Log(Logs::General, Logs::Inventory, "(%s) Duplicate lore items are not allowed - destroying item %s(id:%u) on cursor", GetName(), test_item->Name, test_item->ID); - Message_StringID(MT_LootMessages, 290); + Message_StringID(Chat::Loot, 290); parse->EventItem(EVENT_DESTROY_ITEM, this, test_inst, nullptr, "", 0); DeleteItemInInventory(EQEmu::invslot::slotCursor); SendCursorBuffer(); @@ -1520,7 +1520,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if(!IsValidSlot(src_slot_check)){ // SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason. if(src_slot_check < 2147483647) - Message(13, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); + Message(Chat::Red, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); Log(Logs::Detail, Logs::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); return false; } @@ -1528,7 +1528,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if(!IsValidSlot(dst_slot_check)) { // SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason. if(src_slot_check < 2147483647) - Message(13, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); + Message(Chat::Red, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); Log(Logs::Detail, Logs::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); return false; } @@ -1555,7 +1555,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if (!lore_pass) { Log(Logs::General, Logs::Inventory, "(%s) Duplicate lore items are not allowed - destroying item %s(id:%u) on cursor", GetName(), test_item->Name, test_item->ID); - Message_StringID(MT_LootMessages, 290); + Message_StringID(Chat::Loot, 290); parse->EventItem(EVENT_DESTROY_ITEM, this, test_inst, nullptr, "", 0); DeleteItemInInventory(EQEmu::invslot::slotCursor, 0, true); } @@ -1624,7 +1624,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { //SetTint(dst_slot_id,src_inst->GetColor()); if (src_inst->GetCharges() > 0 && (src_inst->GetCharges() < (int16)move_in->number_in_stack || move_in->number_in_stack > src_inst->GetItem()->StackSize)) { - Message(13,"Error: Insufficient number in stack."); + Message(Chat::Red,"Error: Insufficient number in stack."); return false; } } @@ -1650,7 +1650,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } if (srcitemid==17899 || srcbagid==17899 || dstitemid==17899 || dstbagid==17899){ this->Trader_EndTrader(); - this->Message(13,"You cannot move your Trader Satchels, or items inside them, while Trading."); + this->Message(Chat::Red,"You cannot move your Trader Satchels, or items inside them, while Trading."); } } @@ -1829,7 +1829,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { Log(Logs::Detail, Logs::Inventory, "Trade item move from slot %d to slot %d (trade with %s)", src_slot_id, dst_slot_id, with->GetName()); // Fill Trade list with items from cursor if (!m_inv[EQEmu::invslot::slotCursor]) { - Message(13, "Error: Cursor item not located on server!"); + Message(Chat::Red, "Error: Cursor item not located on server!"); return false; } @@ -1939,7 +1939,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { fail_message = "You are not sufficient level to use this item."; if (fail_message) - Message(CC_Red, "%s", fail_message); + Message(Chat::Red, "%s", fail_message); return false; } @@ -2008,7 +2008,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) { // resync the 'from' and 'to' slots on an as-needed basis // Not as effective as the full process, but less intrusive to gameplay Log(Logs::Detail, Logs::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot); - Message(15, "Inventory Desyncronization detected: Resending slot data..."); + Message(Chat::Yellow, "Inventory Desyncronization detected: Resending slot data..."); if (move_slots->from_slot >= EQEmu::invslot::EQUIPMENT_BEGIN && move_slots->from_slot <= EQEmu::invbag::CURSOR_BAG_END) { int16 resync_slot = (EQEmu::InventoryProfile::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : EQEmu::InventoryProfile::CalcSlotId(move_slots->from_slot); @@ -2031,9 +2031,9 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) { safe_delete(outapp); } safe_delete(token_inst); - Message(14, "Source slot %i resyncronized.", move_slots->from_slot); + Message(Chat::Lime, "Source slot %i resyncronized.", move_slots->from_slot); } - else { Message(13, "Could not resyncronize source slot %i.", move_slots->from_slot); } + else { Message(Chat::Red, "Could not resyncronize source slot %i.", move_slots->from_slot); } } else { int16 resync_slot = (EQEmu::InventoryProfile::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : EQEmu::InventoryProfile::CalcSlotId(move_slots->from_slot); @@ -2046,11 +2046,11 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) { SendItemPacket(resync_slot, m_inv[resync_slot], ItemPacketTrade); safe_delete(token_inst); - Message(14, "Source slot %i resyncronized.", move_slots->from_slot); + Message(Chat::Lime, "Source slot %i resyncronized.", move_slots->from_slot); } - else { Message(13, "Could not resyncronize source slot %i.", move_slots->from_slot); } + else { Message(Chat::Red, "Could not resyncronize source slot %i.", move_slots->from_slot); } } - else { Message(13, "Could not resyncronize source slot %i.", move_slots->from_slot); } + else { Message(Chat::Red, "Could not resyncronize source slot %i.", move_slots->from_slot); } } if (move_slots->to_slot >= EQEmu::invslot::EQUIPMENT_BEGIN && move_slots->to_slot <= EQEmu::invbag::CURSOR_BAG_END) { @@ -2073,9 +2073,9 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) { safe_delete(outapp); } safe_delete(token_inst); - Message(14, "Destination slot %i resyncronized.", move_slots->to_slot); + Message(Chat::Lime, "Destination slot %i resyncronized.", move_slots->to_slot); } - else { Message(13, "Could not resyncronize destination slot %i.", move_slots->to_slot); } + else { Message(Chat::Red, "Could not resyncronize destination slot %i.", move_slots->to_slot); } } else { int16 resync_slot = (EQEmu::InventoryProfile::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : EQEmu::InventoryProfile::CalcSlotId(move_slots->to_slot); @@ -2088,11 +2088,11 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) { SendItemPacket(resync_slot, m_inv[resync_slot], ItemPacketTrade); safe_delete(token_inst); - Message(14, "Destination slot %i resyncronized.", move_slots->to_slot); + Message(Chat::Lime, "Destination slot %i resyncronized.", move_slots->to_slot); } - else { Message(13, "Could not resyncronize destination slot %i.", move_slots->to_slot); } + else { Message(Chat::Red, "Could not resyncronize destination slot %i.", move_slots->to_slot); } } - else { Message(13, "Could not resyncronize destination slot %i.", move_slots->to_slot); } + else { Message(Chat::Red, "Could not resyncronize destination slot %i.", move_slots->to_slot); } } } @@ -2219,7 +2219,7 @@ void Client::DyeArmor(EQEmu::TintProfile* dye){ SendWearChange(i); } else{ - Message(13,"Could not locate A Vial of Prismatic Dye."); + Message(Chat::Red,"Could not locate A Vial of Prismatic Dye."); return; } } @@ -3406,9 +3406,9 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool } if (error) { - Message(13, "An error has been discovered in your inventory!"); - Message(13, "Do not log out, zone or re-arrange items until this"); - Message(13, "issue has been resolved or item loss may occur!"); + Message(Chat::Red, "An error has been discovered in your inventory!"); + Message(Chat::Red, "Do not log out, zone or re-arrange items until this"); + Message(Chat::Red, "issue has been resolved or item loss may occur!"); if (allowtrip) TripInterrogateInvState(); @@ -3466,7 +3466,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea head, depth, i.c_str(), p.c_str(), e.c_str()); } if (!silent) { - requester->Message(6, "%i:%i - inst: %s - parent: %s%s", + requester->Message(Chat::Gray, "%i:%i - inst: %s - parent: %s%s", head, depth, i.c_str(), p.c_str(), e.c_str()); } diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index ef9180b68..4dddd887d 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -2234,92 +2234,92 @@ luabind::scope lua_register_message_types() { return luabind::class_("MT") .enum_("constants") [ - luabind::value("NPCQuestSay", MT_NPCQuestSay), - luabind::value("Say", MT_Say), - luabind::value("Tell", MT_Tell), - luabind::value("Group", MT_Group), - luabind::value("Guild", MT_Guild), - luabind::value("OOC", MT_OOC), - luabind::value("Auction", MT_Auction), - luabind::value("Shout", MT_Shout), - luabind::value("Emote", MT_Emote), - luabind::value("Spells", MT_Spells), - luabind::value("YouHitOther", MT_YouHitOther), - luabind::value("OtherHitsYou", MT_OtherHitsYou), - luabind::value("YouMissOther", MT_YouMissOther), - luabind::value("OtherMissesYou", MT_OtherMissesYou), - luabind::value("Broadcasts", MT_Broadcasts), - luabind::value("Skills", MT_Skills), - luabind::value("Disciplines", MT_Disciplines), - luabind::value("Unused1", MT_Unused1), - luabind::value("DefaultText", MT_DefaultText), - luabind::value("Unused2", MT_Unused2), - luabind::value("MerchantOffer", MT_MerchantOffer), - luabind::value("MerchantBuySell", MT_MerchantBuySell), - luabind::value("YourDeath", MT_YourDeath), - luabind::value("OtherDeath", MT_OtherDeath), - luabind::value("OtherHits", MT_OtherHits), - luabind::value("OtherMisses", MT_OtherMisses), - luabind::value("Who", MT_Who), - luabind::value("YellForHelp", MT_YellForHelp), - luabind::value("NonMelee", MT_NonMelee), - luabind::value("WornOff", MT_WornOff), - luabind::value("MoneySplit", MT_MoneySplit), - luabind::value("LootMessages", MT_LootMessages), - luabind::value("DiceRoll", MT_DiceRoll), - luabind::value("OtherSpells", MT_OtherSpells), - luabind::value("SpellFailure", MT_SpellFailure), - luabind::value("Chat", MT_Chat), - luabind::value("Channel1", MT_Channel1), - luabind::value("Channel2", MT_Channel2), - luabind::value("Channel3", MT_Channel3), - luabind::value("Channel4", MT_Channel4), - luabind::value("Channel5", MT_Channel5), - luabind::value("Channel6", MT_Channel6), - luabind::value("Channel7", MT_Channel7), - luabind::value("Channel8", MT_Channel8), - luabind::value("Channel9", MT_Channel9), - luabind::value("Channel10", MT_Channel10), - luabind::value("CritMelee", MT_CritMelee), - luabind::value("SpellCrits", MT_SpellCrits), - luabind::value("TooFarAway", MT_TooFarAway), - luabind::value("NPCRampage", MT_NPCRampage), - luabind::value("NPCFlurry", MT_NPCFlurry), - luabind::value("NPCEnrage", MT_NPCEnrage), - luabind::value("SayEcho", MT_SayEcho), - luabind::value("TellEcho", MT_TellEcho), - luabind::value("GroupEcho", MT_GroupEcho), - luabind::value("GuildEcho", MT_GuildEcho), - luabind::value("OOCEcho", MT_OOCEcho), - luabind::value("AuctionEcho", MT_AuctionEcho), - luabind::value("ShoutECho", MT_ShoutECho), - luabind::value("EmoteEcho", MT_EmoteEcho), - luabind::value("Chat1Echo", MT_Chat1Echo), - luabind::value("Chat2Echo", MT_Chat2Echo), - luabind::value("Chat3Echo", MT_Chat3Echo), - luabind::value("Chat4Echo", MT_Chat4Echo), - luabind::value("Chat5Echo", MT_Chat5Echo), - luabind::value("Chat6Echo", MT_Chat6Echo), - luabind::value("Chat7Echo", MT_Chat7Echo), - luabind::value("Chat8Echo", MT_Chat8Echo), - luabind::value("Chat9Echo", MT_Chat9Echo), - luabind::value("Chat10Echo", MT_Chat10Echo), - luabind::value("DoTDamage", MT_DoTDamage), - luabind::value("ItemLink", MT_ItemLink), - luabind::value("RaidSay", MT_RaidSay), - luabind::value("MyPet", MT_MyPet), - luabind::value("DS", MT_DS), - luabind::value("Leadership", MT_Leadership), - luabind::value("PetFlurry", MT_PetFlurry), - luabind::value("PetCrit", MT_PetCrit), - luabind::value("FocusEffect", MT_FocusEffect), - luabind::value("Experience", MT_Experience), - luabind::value("System", MT_System), - luabind::value("PetSpell", MT_PetSpell), - luabind::value("PetResponse", MT_PetResponse), - luabind::value("ItemSpeech", MT_ItemSpeech), - luabind::value("StrikeThrough", MT_StrikeThrough), - luabind::value("Stun", MT_Stun) + luabind::value("NPCQuestSay", Chat::NPCQuestSay), + luabind::value("Say", Chat::Say), + luabind::value("Tell", Chat::Tell), + luabind::value("Group", Chat::Group), + luabind::value("Guild", Chat::Guild), + luabind::value("OOC", Chat::OOC), + luabind::value("Auction", Chat::Auction), + luabind::value("Shout", Chat::Shout), + luabind::value("Emote", Chat::Emote), + luabind::value("Spells", Chat::Spells), + luabind::value("YouHitOther", Chat::YouHitOther), + luabind::value("OtherHitsYou", Chat::OtherHitYou), + luabind::value("YouMissOther", Chat::YouMissOther), + luabind::value("OtherMissesYou", Chat::OtherMissYou), + luabind::value("Broadcasts", Chat::Broadcasts), + luabind::value("Skills", Chat::Skills), + luabind::value("Disciplines", Chat::Disciplines), + luabind::value("Unused1", Chat::Unused1), + luabind::value("DefaultText", Chat::DefaultText), + luabind::value("Unused2", Chat::Unused2), + luabind::value("MerchantOffer", Chat::MerchantOffer), + luabind::value("MerchantBuySell", Chat::MerchantExchange), + luabind::value("YourDeath", Chat::YourDeath), + luabind::value("OtherDeath", Chat::OtherDeath), + luabind::value("OtherHits", Chat::OtherHitOther), + luabind::value("OtherMisses", Chat::OtherMissOther), + luabind::value("Who", Chat::Who), + luabind::value("YellForHelp", Chat::YellForHelp), + luabind::value("NonMelee", Chat::NonMelee), + luabind::value("WornOff", Chat::SpellWornOff), + luabind::value("MoneySplit", Chat::MoneySplit), + luabind::value("LootMessages", Chat::Loot), + luabind::value("DiceRoll", Chat::DiceRoll), + luabind::value("OtherSpells", Chat::OtherSpells), + luabind::value("SpellFailure", Chat::SpellFailure), + luabind::value("Chat", Chat::ChatChannel), + luabind::value("Channel1", Chat::Chat1), + luabind::value("Channel2", Chat::Chat2), + luabind::value("Channel3", Chat::Chat3), + luabind::value("Channel4", Chat::Chat4), + luabind::value("Channel5", Chat::Chat5), + luabind::value("Channel6", Chat::Chat6), + luabind::value("Channel7", Chat::Chat7), + luabind::value("Channel8", Chat::Chat8), + luabind::value("Channel9", Chat::Chat9), + luabind::value("Channel10", Chat::Chat10), + luabind::value("CritMelee", Chat::MeleeCrit), + luabind::value("SpellCrits", Chat::SpellCrit), + luabind::value("TooFarAway", Chat::TooFarAway), + luabind::value("NPCRampage", Chat::NPCRampage), + luabind::value("NPCFlurry", Chat::NPCFlurry), + luabind::value("NPCEnrage", Chat::NPCEnrage), + luabind::value("SayEcho", Chat::EchoSay), + luabind::value("TellEcho", Chat::EchoTell), + luabind::value("GroupEcho", Chat::EchoGroup), + luabind::value("GuildEcho", Chat::EchoGuild), + luabind::value("OOCEcho", Chat::EchoOOC), + luabind::value("AuctionEcho", Chat::EchoAuction), + luabind::value("ShoutECho", Chat::EchoShout), + luabind::value("EmoteEcho", Chat::EchoEmote), + luabind::value("Chat1Echo", Chat::EchoChat1), + luabind::value("Chat2Echo", Chat::EchoChat2), + luabind::value("Chat3Echo", Chat::EchoChat3), + luabind::value("Chat4Echo", Chat::EchoChat4), + luabind::value("Chat5Echo", Chat::EchoChat5), + luabind::value("Chat6Echo", Chat::EchoChat6), + luabind::value("Chat7Echo", Chat::EchoChat7), + luabind::value("Chat8Echo", Chat::EchoChat8), + luabind::value("Chat9Echo", Chat::EchoChat9), + luabind::value("Chat10Echo", Chat::EchoChat10), + luabind::value("DoTDamage", Chat::DotDamage), + luabind::value("ItemLink", Chat::ItemLink), + luabind::value("RaidSay", Chat::RaidSay), + luabind::value("MyPet", Chat::MyPet), + luabind::value("DS", Chat::DamageShield), + luabind::value("Leadership", Chat::LeaderShip), + luabind::value("PetFlurry", Chat::PetFlurry), + luabind::value("PetCrit", Chat::PetCritical), + luabind::value("FocusEffect", Chat::FocusEffect), + luabind::value("Experience", Chat::Experience), + luabind::value("System", Chat::System), + luabind::value("PetSpell", Chat::PetSpell), + luabind::value("PetResponse", Chat::PetResponse), + luabind::value("ItemSpeech", Chat::ItemSpeech), + luabind::value("StrikeThrough", Chat::StrikeThrough), + luabind::value("Stun", Chat::Stun) ]; } diff --git a/zone/lua_mob.cpp b/zone/lua_mob.cpp index 6f7e435f3..df0cd7b70 100644 --- a/zone/lua_mob.cpp +++ b/zone/lua_mob.cpp @@ -764,7 +764,7 @@ void Lua_Mob::QuestSay(Lua_Client client, const char *message) { journal_opts.speak_mode = Journal::SpeakMode::Say; journal_opts.journal_mode = RuleB(NPC, EnableNPCQuestJournal) ? Journal::Mode::Log2 : Journal::Mode::None; journal_opts.language = 0; - journal_opts.message_type = MT_NPCQuestSay; + journal_opts.message_type = Chat::NPCQuestSay; journal_opts.target_spawn_id = 0; self->QuestJournalledSay(client, message, journal_opts); } @@ -777,7 +777,7 @@ void Lua_Mob::QuestSay(Lua_Client client, const char *message, luabind::adl::obj journal_opts.speak_mode = Journal::SpeakMode::Say; journal_opts.journal_mode = Journal::Mode::Log2; journal_opts.language = 0; - journal_opts.message_type = MT_NPCQuestSay; + journal_opts.message_type = Chat::NPCQuestSay; journal_opts.target_spawn_id = 0; if (luabind::type(opts) == LUA_TTABLE) { diff --git a/zone/merc.cpp b/zone/merc.cpp index 7c15fbd65..7ae4a4d9f 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -1618,7 +1618,7 @@ void Merc::AI_Process() { { if(zone->random.Roll(flurrychance)) { - Message_StringID(MT_NPCFlurry, YOU_FLURRY); + Message_StringID(Chat::NPCFlurry, YOU_FLURRY); Attack(GetTarget(), EQEmu::invslot::slotPrimary, false); Attack(GetTarget(), EQEmu::invslot::slotPrimary, false); } @@ -2623,7 +2623,7 @@ int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) { realTotal = CalcFocusEffect(type, UsedFocusID, spell_id); if (realTotal != 0 && UsedItem) - Message_StringID(MT_Spells, BEGINS_TO_GLOW, UsedItem->Name); + Message_StringID(Chat::Spells, BEGINS_TO_GLOW, UsedItem->Name); } //Check if spell focus effect exists for the client. @@ -5321,10 +5321,10 @@ void Client::UpdateMercTimer() Log(Logs::General, Logs::Mercenaries, "UpdateMercTimer Complete for %s.", GetName()); // Normal upkeep charge message - //Message(7, "You have been charged a mercenary upkeep cost of %i plat, and %i gold and your mercenary upkeep cost timer has been reset to 15 minutes.", upkeep_plat, upkeep_gold, (int)(RuleI(Mercs, UpkeepIntervalMS) / 1000 / 60)); + //Message(Chat::LightGray, "You have been charged a mercenary upkeep cost of %i plat, and %i gold and your mercenary upkeep cost timer has been reset to 15 minutes.", upkeep_plat, upkeep_gold, (int)(RuleI(Mercs, UpkeepIntervalMS) / 1000 / 60)); // Message below given when too low level to be charged - //Message(7, "Your mercenary waived an upkeep cost of %i plat, and %i gold or %i %s and your mercenary upkeep cost timer has been reset to %i minutes", upkeep_plat, upkeep_gold, 1, "Bayle Marks", (int)(RuleI(Mercs, UpkeepIntervalMS) / 1000 / 60)); + //Message(Chat::LightGray, "Your mercenary waived an upkeep cost of %i plat, and %i gold or %i %s and your mercenary upkeep cost timer has been reset to %i minutes", upkeep_plat, upkeep_gold, 1, "Bayle Marks", (int)(RuleI(Mercs, UpkeepIntervalMS) / 1000 / 60)); } } } diff --git a/zone/mob.cpp b/zone/mob.cpp index 3a307bf3f..6067f206e 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -2709,7 +2709,7 @@ bool Mob::HateSummon() { if(target) { if(summon_level == 1) { - entity_list.MessageClose(this, true, 500, MT_Say, "%s says,'You will not evade me, %s!' ", GetCleanName(), target->GetCleanName() ); + entity_list.MessageClose(this, true, 500, Chat::Say, "%s says 'You will not evade me, %s!' ", GetCleanName(), target->GetCleanName() ); if (target->IsClient()) target->CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), m_Position.x, m_Position.y, m_Position.z, target->GetHeading(), 0, SummonPC); @@ -2718,7 +2718,7 @@ bool Mob::HateSummon() { return true; } else if(summon_level == 2) { - entity_list.MessageClose(this, true, 500, MT_Say, "%s says,'You will not evade me, %s!'", GetCleanName(), target->GetCleanName()); + entity_list.MessageClose(this, true, 500, Chat::Say, "%s says 'You will not evade me, %s!'", GetCleanName(), target->GetCleanName()); GMMove(target->GetX(), target->GetY(), target->GetZ()); } } @@ -2875,7 +2875,7 @@ void Mob::SayTo_StringID(Client *to, uint32 string_id, const char *message3, con auto string_id_str = std::to_string(string_id); - to->Message_StringID(10, GENERIC_STRINGID_SAY, GetCleanName(), string_id_str.c_str(), message3, message4, message5, message6, message7, message8, message9); + to->Message_StringID(Chat::NPCQuestSay, GENERIC_STRINGID_SAY, GetCleanName(), string_id_str.c_str(), message3, message4, message5, message6, message7, message8, message9); } void Mob::SayTo_StringID(Client *to, uint32 type, uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9) @@ -2897,7 +2897,7 @@ void Mob::Shout(const char *format, ...) vsnprintf(buf, 1000, format, ap); va_end(ap); - entity_list.Message_StringID(this, false, MT_Shout, + entity_list.Message_StringID(this, false, Chat::Shout, GENERIC_SHOUT, GetCleanName(), buf); } @@ -3569,7 +3569,7 @@ void Mob::TryTwincast(Mob *caster, Mob *target, uint32 spell_id) { if(zone->random.Roll(focus)) { - Message(MT_Spells,"You twincast %s!",spells[spell_id].name); + Message(Chat::Spells,"You twincast %s!", spells[spell_id].name); SpellFinished(spell_id, target, EQEmu::spells::CastingSlot::Item, 0, -1, spells[spell_id].ResistDiff); } } @@ -4887,16 +4887,16 @@ void Mob::SlowMitigation(Mob* caster) if (GetSlowMitigation() && caster && caster->IsClient()) { if ((GetSlowMitigation() > 0) && (GetSlowMitigation() < 26)) - caster->Message_StringID(MT_SpellFailure, SLOW_MOSTLY_SUCCESSFUL); + caster->Message_StringID(Chat::SpellFailure, SLOW_MOSTLY_SUCCESSFUL); else if ((GetSlowMitigation() >= 26) && (GetSlowMitigation() < 74)) - caster->Message_StringID(MT_SpellFailure, SLOW_PARTIALLY_SUCCESSFUL); + caster->Message_StringID(Chat::SpellFailure, SLOW_PARTIALLY_SUCCESSFUL); else if ((GetSlowMitigation() >= 74) && (GetSlowMitigation() < 101)) - caster->Message_StringID(MT_SpellFailure, SLOW_SLIGHTLY_SUCCESSFUL); + caster->Message_StringID(Chat::SpellFailure, SLOW_SLIGHTLY_SUCCESSFUL); else if (GetSlowMitigation() > 100) - caster->Message_StringID(MT_SpellFailure, SPELL_OPPOSITE_EFFECT); + caster->Message_StringID(Chat::SpellFailure, SPELL_OPPOSITE_EFFECT); } } diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 0df05254e..e71a28a05 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -578,7 +578,7 @@ void NPC::AI_Stop() { void Client::AI_Stop() { Mob::AI_Stop(); - this->Message_StringID(13,PLAYER_REGAIN); + this->Message_StringID(Chat::Red,PLAYER_REGAIN); auto app = new EQApplicationPacket(OP_Charm, sizeof(Charm_Struct)); Charm_Struct *ps = (Charm_Struct*)app->pBuffer; @@ -1667,9 +1667,9 @@ void NPC::AI_DoMovement() { pause_timer_complete = true; AI_walking_timer->Disable(); } - + int32 gridno = CastToNPC()->GetGrid(); - + if (gridno > 0 || cur_wp == EQEmu::WaypointStatus::QuestControlNoGrid) { if (pause_timer_complete == true) { // time to pause at wp is over AI_SetupNextWaypoint(); @@ -1685,7 +1685,7 @@ void NPC::AI_DoMovement() { GetY(), GetZ(), GetGrid()); - + SetWaypointPause(); SetAppearance(eaStanding, false); if (cur_wp_pause > 0) { @@ -2029,14 +2029,14 @@ void Mob::StartEnrage() // start the timer. need to call IsEnraged frequently since we dont have callback timers :-/ bEnraged = true; - entity_list.MessageClose_StringID(this, true, 200, MT_NPCEnrage, NPC_ENRAGE_START, GetCleanName()); + entity_list.MessageClose_StringID(this, true, 200, Chat::NPCEnrage, NPC_ENRAGE_START, GetCleanName()); } void Mob::ProcessEnrage(){ if(IsEnraged()){ Timer *timer = GetSpecialAbilityTimer(SPECATK_ENRAGE); if(timer && timer->Check()){ - entity_list.MessageClose_StringID(this, true, 200, MT_NPCEnrage, NPC_ENRAGE_END, GetCleanName()); + entity_list.MessageClose_StringID(this, true, 200, Chat::NPCEnrage, NPC_ENRAGE_END, GetCleanName()); int enraged_cooldown = GetSpecialAbilityParam(SPECATK_ENRAGE, 2); enraged_cooldown = enraged_cooldown > 0 ? enraged_cooldown : EnragedTimer; @@ -2057,9 +2057,9 @@ bool Mob::Flurry(ExtraAttackOptions *opts) Mob *target = GetTarget(); if (target) { if (!IsPet()) { - entity_list.MessageClose_StringID(this, true, 200, MT_NPCFlurry, NPC_FLURRY, GetCleanName(), target->GetCleanName()); + entity_list.MessageClose_StringID(this, true, 200, Chat::NPCFlurry, NPC_FLURRY, GetCleanName(), target->GetCleanName()); } else { - entity_list.MessageClose_StringID(this, true, 200, MT_PetFlurry, NPC_FLURRY, GetCleanName(), target->GetCleanName()); + entity_list.MessageClose_StringID(this, true, 200, Chat::PetFlurry, NPC_FLURRY, GetCleanName(), target->GetCleanName()); } int num_attacks = GetSpecialAbilityParam(SPECATK_FLURRY, 1); @@ -2096,9 +2096,9 @@ bool Mob::Rampage(ExtraAttackOptions *opts) { int index_hit = 0; if (!IsPet()) - entity_list.MessageClose_StringID(this, true, 200, MT_NPCRampage, NPC_RAMPAGE, GetCleanName()); + entity_list.MessageClose_StringID(this, true, 200, Chat::NPCRampage, NPC_RAMPAGE, GetCleanName()); else - entity_list.MessageClose_StringID(this, true, 200, MT_PetFlurry, NPC_RAMPAGE, GetCleanName()); + entity_list.MessageClose_StringID(this, true, 200, Chat::PetFlurry, NPC_RAMPAGE, GetCleanName()); int rampage_targets = GetSpecialAbilityParam(SPECATK_RAMPAGE, 1); if (rampage_targets == 0) // if set to 0 or not set in the DB @@ -2153,9 +2153,9 @@ void Mob::AreaRampage(ExtraAttackOptions *opts) { int index_hit = 0; if (!IsPet()) { // do not know every pet AA so thought it safer to add this - entity_list.MessageClose_StringID(this, true, 200, MT_NPCRampage, AE_RAMPAGE, GetCleanName()); + entity_list.MessageClose_StringID(this, true, 200, Chat::NPCRampage, AE_RAMPAGE, GetCleanName()); } else { - entity_list.MessageClose_StringID(this, true, 200, MT_PetFlurry, AE_RAMPAGE, GetCleanName()); + entity_list.MessageClose_StringID(this, true, 200, Chat::PetFlurry, AE_RAMPAGE, GetCleanName()); } int rampage_targets = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 1); diff --git a/zone/mob_movement_manager.cpp b/zone/mob_movement_manager.cpp index 4bf1663d3..2f87a1912 100644 --- a/zone/mob_movement_manager.cpp +++ b/zone/mob_movement_manager.cpp @@ -835,27 +835,27 @@ void MobMovementManager::DumpStats(Client *client) auto current_time = static_cast(Timer::GetCurrentTime()) / 1000.0; auto total_time = current_time - _impl->Stats.LastResetTime; - client->Message(MT_System, "Dumping Movement Stats:"); + client->Message(Chat::System, "Dumping Movement Stats:"); client->Message( - MT_System, + Chat::System, "Total Sent: %u (%.2f / sec)", _impl->Stats.TotalSent, static_cast(_impl->Stats.TotalSent) / total_time ); client->Message( - MT_System, + Chat::System, "Total Heading: %u (%.2f / sec)", _impl->Stats.TotalSentHeading, static_cast(_impl->Stats.TotalSentHeading) / total_time ); client->Message( - MT_System, + Chat::System, "Total Movement: %u (%.2f / sec)", _impl->Stats.TotalSentMovement, static_cast(_impl->Stats.TotalSentMovement) / total_time ); client->Message( - MT_System, + Chat::System, "Total Position: %u (%.2f / sec)", _impl->Stats.TotalSentPosition, static_cast(_impl->Stats.TotalSentPosition) / total_time diff --git a/zone/npc.cpp b/zone/npc.cpp index 60e6f73c4..3f31d57da 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1577,7 +1577,7 @@ void NPC::PickPocket(Client* thief) //make sure were allowed to target them: int over_level = GetLevel(); if(over_level > (thief->GetLevel() + THIEF_PICKPOCKET_OVER)) { - thief->Message(13, "You are too inexperienced to pick pocket this target"); + thief->Message(Chat::Red, "You are too inexperienced to pick pocket this target"); thief->SendPickPocketResponse(this, 0, PickPocketFailed); //should we check aggro return; @@ -1587,7 +1587,7 @@ void NPC::PickPocket(Client* thief) if (zone->CanDoCombat()) AddToHateList(thief, 50); Say("Stop thief!"); - thief->Message(13, "You are noticed trying to steal!"); + thief->Message(Chat::Red, "You are noticed trying to steal!"); thief->SendPickPocketResponse(this, 0, PickPocketFailed); return; } @@ -1744,17 +1744,17 @@ void NPC::Disarm(Client* client, int chance) { SendWearChange(matslot); if ((CastToMob()->GetBodyType() == BT_Humanoid || CastToMob()->GetBodyType() == BT_Summoned) && eslot == EQEmu::invslot::slotPrimary) Say("Ahh! My weapon!"); - client->Message_StringID(MT_Skills, DISARM_SUCCESS, this->GetCleanName()); + client->Message_StringID(Chat::Skills, DISARM_SUCCESS, this->GetCleanName()); if (chance != 1000) client->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 4); return; } - client->Message_StringID(MT_Skills, DISARM_FAILED); + client->Message_StringID(Chat::Skills, DISARM_FAILED); if (chance != 1000) client->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 2); return; } - client->Message_StringID(MT_Skills, DISARM_FAILED); + client->Message_StringID(Chat::Skills, DISARM_FAILED); } void Mob::NPCSpecialAttacks(const char* parse, int permtag, bool reset, bool remove) { diff --git a/zone/oldcode.cpp b/zone/oldcode.cpp index 600e8ad5c..7da290439 100644 --- a/zone/oldcode.cpp +++ b/zone/oldcode.cpp @@ -1198,7 +1198,7 @@ Message(0, "Disc packet id=%d, %x,%x,%x", disc_in->disc_id, disc_in->unknown3[0] char val1[20]={0}; char val2[20]={0}; uint32 remain = p_timers.GetRemainingTime(pTimerDisciplineReuse); - Message_StringID(0,DISCIPLINE_CANUSEIN,ConvertArray((remain)/60,val1),ConvertArray(remain%60,val2)); + Message_StringID(Chat::WhiteSmoke,DISCIPLINE_CANUSEIN,ConvertArray((remain)/60,val1),ConvertArray(remain%60,val2)); //Message(0,"You can use a new discipline in %i minutes %i seconds.", (disc_timer.GetRemainingTime()/1000)/60, disc_timer.GetRemainingTime()/1000%60); return; } diff --git a/zone/pathing.cpp b/zone/pathing.cpp index 79b7900d2..e579bd0fe 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -50,7 +50,7 @@ void Client::SendPathPacket(const std::vector &points) { auto points = EQEmu::any_cast>(result); if (points.size() < 2) { if (Admin() > 10) { - Message(MT_System, "Too few points"); + Message(Chat::System, "Too few points"); } EQApplicationPacket outapp(OP_FindPersonReply, 0); @@ -60,7 +60,7 @@ void Client::SendPathPacket(const std::vector &points) { if (points.size() > 36) { if (Admin() > 10) { - Message(MT_System, "Too many points %u", points.size()); + Message(Chat::System, "Too many points %u", points.size()); } EQApplicationPacket outapp(OP_FindPersonReply, 0); @@ -69,7 +69,7 @@ void Client::SendPathPacket(const std::vector &points) { } if (Admin() > 10) { - Message(MT_System, "Total points %u", points.size()); + Message(Chat::System, "Total points %u", points.size()); } int len = sizeof(FindPersonResult_Struct) + (points.size() + 1) * sizeof(FindPerson_Point); diff --git a/zone/pets.cpp b/zone/pets.cpp index ab1f13bce..6f8c5d44e 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -212,7 +212,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, //lookup our pets table record for this type PetRecord record; if(!database.GetPoweredPetEntry(pettype, act_power, &record)) { - Message(13, "Unable to find data for pet %s", pettype); + Message(Chat::Red, "Unable to find data for pet %s", pettype); Log(Logs::General, Logs::Error, "Unable to find data for pet %s, check pets table.", pettype); return; } @@ -220,7 +220,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, //find the NPC data for the specified NPC type const NPCType *base = database.LoadNPCTypesData(record.npc_type); if(base == nullptr) { - Message(13, "Unable to load NPC data for pet %s", pettype); + Message(Chat::Red, "Unable to load NPC data for pet %s", pettype); Log(Logs::General, Logs::Error, "Unable to load NPC data for pet %s (NPC ID %d), check pets and npc_types tables.", pettype, record.npc_type); return; } diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index dafc3f1e6..cc19c59fd 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -807,13 +807,13 @@ void QuestManager::changedeity(int diety_id) { if(initiator->IsClient()) { initiator->SetDeity(diety_id); - initiator->Message(15,"Your Deity has been changed/set to: %i", diety_id); + initiator->Message(Chat::Yellow,"Your Deity has been changed/set to: %i", diety_id); initiator->Save(1); initiator->Kick("Deity change by QuestManager"); } else { - initiator->Message(15,"Error changing Deity"); + initiator->Message(Chat::Yellow,"Error changing Deity"); } } } @@ -929,11 +929,11 @@ void QuestManager::surname(const char *name) { if(initiator->IsClient()) { initiator->ChangeLastName(name); - initiator->Message(15,"Your surname has been changed/set to: %s", name); + initiator->Message(Chat::Yellow,"Your surname has been changed/set to: %s", name); } else { - initiator->Message(15,"Error changing/setting surname"); + initiator->Message(Chat::Yellow,"Error changing/setting surname"); } } } @@ -986,11 +986,11 @@ uint16 QuestManager::scribespells(uint8 max_level, uint8 min_level) { break; } if (spell_id < 0 || spell_id >= SPDAT_RECORDS) { - initiator->Message(13, "FATAL ERROR: Spell id out-of-range (id: %i, min: 0, max: %i)", spell_id, SPDAT_RECORDS); + initiator->Message(Chat::Red, "FATAL ERROR: Spell id out-of-range (id: %i, min: 0, max: %i)", spell_id, SPDAT_RECORDS); return count; } if (book_slot < 0 || book_slot >= EQEmu::spells::SPELLBOOK_SIZE) { - initiator->Message(13, "FATAL ERROR: Book slot out-of-range (slot: %i, min: 0, max: %i)", book_slot, EQEmu::spells::SPELLBOOK_SIZE); + initiator->Message(Chat::Red, "FATAL ERROR: Book slot out-of-range (slot: %i, min: 0, max: %i)", book_slot, EQEmu::spells::SPELLBOOK_SIZE); return count; } @@ -1008,7 +1008,7 @@ uint16 QuestManager::scribespells(uint8 max_level, uint8 min_level) { uint16 spell_id_ = (uint16)spell_id; if ((spell_id_ != spell_id) || (spell_id != spell_id_)) { - initiator->Message(13, "FATAL ERROR: Type conversion data loss with spell_id (%i != %u)", spell_id, spell_id_); + initiator->Message(Chat::Red, "FATAL ERROR: Type conversion data loss with spell_id (%i != %u)", spell_id, spell_id_); return count; } @@ -1059,7 +1059,7 @@ uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) { for( ; spell_id < SPDAT_RECORDS; ++spell_id) { if (spell_id < 0 || spell_id >= SPDAT_RECORDS) { - initiator->Message(13, "FATAL ERROR: Spell id out-of-range (id: %i, min: 0, max: %i)", spell_id, SPDAT_RECORDS); + initiator->Message(Chat::Red, "FATAL ERROR: Spell id out-of-range (id: %i, min: 0, max: %i)", spell_id, SPDAT_RECORDS); return count; } @@ -1077,7 +1077,7 @@ uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) { uint16 spell_id_ = (uint16)spell_id; if ((spell_id_ != spell_id) || (spell_id != spell_id_)) { - initiator->Message(13, "FATAL ERROR: Type conversion data loss with spell_id (%i != %u)", spell_id, spell_id_); + initiator->Message(Chat::Red, "FATAL ERROR: Type conversion data loss with spell_id (%i != %u)", spell_id, spell_id_); return count; } @@ -1086,7 +1086,7 @@ uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) { for (uint32 r = 0; r < MAX_PP_DISCIPLINES; r++) { if (initiator->GetPP().disciplines.values[r] == spell_id_) { - initiator->Message(13, "You already know this discipline."); + initiator->Message(Chat::Red, "You already know this discipline."); break; // continue the 1st loop } else if (initiator->GetPP().disciplines.values[r] == 0) { @@ -1190,7 +1190,7 @@ void QuestManager::givecash(int copper, int silver, int gold, int platinum) { } tmp += " pieces."; if (initiator) - initiator->Message(MT_OOC, tmp.c_str()); + initiator->Message(Chat::OOC, tmp.c_str()); } } @@ -2164,7 +2164,7 @@ bool QuestManager::createBot(const char *name, const char *lastname, uint8 level { if(Bot::SpawnedBotCount(initiator->CharacterID()) >= MaxBotCreate) { - initiator->Message(15,"You have the maximum number of bots allowed."); + initiator->Message(Chat::Yellow,"You have the maximum number of bots allowed."); return false; } @@ -2657,13 +2657,13 @@ uint16 QuestManager::CreateInstance(const char *zone, int16 version, uint32 dura uint16 id = 0; if(!database.GetUnusedInstanceID(id)) { - initiator->Message(13, "Server was unable to find a free instance id."); + initiator->Message(Chat::Red, "Server was unable to find a free instance id."); return 0; } if(!database.CreateInstance(id, zone_id, version, duration)) { - initiator->Message(13, "Server was unable to create a new instance."); + initiator->Message(Chat::Red, "Server was unable to create a new instance."); return 0; } return id; @@ -2776,9 +2776,9 @@ void QuestManager::RemoveFromInstance(uint16 instance_id) if (initiator) { if (database.RemoveClientFromInstance(instance_id, initiator->CharacterID())) - initiator->Message(MT_Say, "Removed client from instance."); + initiator->Message(Chat::Say, "Removed client from instance."); else - initiator->Message(MT_Say, "Failed to remove client from instance."); + initiator->Message(Chat::Say, "Failed to remove client from instance."); } } @@ -2794,11 +2794,11 @@ void QuestManager::RemoveAllFromInstance(uint16 instance_id) std::list charid_list; if (database.RemoveClientsFromInstance(instance_id)) - initiator->Message(MT_Say, "Removed all players from instance."); + initiator->Message(Chat::Say, "Removed all players from instance."); else { database.GetCharactersInInstance(instance_id, charid_list); - initiator->Message(MT_Say, "Failed to remove %i player(s) from instance.", charid_list.size()); // once the expedition system is in, this message it not relevant + initiator->Message(Chat::Say, "Failed to remove %i player(s) from instance.", charid_list.size()); // once the expedition system is in, this message it not relevant } } } diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index bcffa4077..35b865610 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -177,7 +177,7 @@ void Mob::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32 auto fbash = GetFuriousBash(itm->Focus.Effect); hate = hate * (100 + fbash) / 100; if (fbash) - Message_StringID(MT_Spells, GLOWS_RED, itm->Name); + Message_StringID(Chat::Spells, GLOWS_RED, itm->Name); } } } @@ -283,7 +283,7 @@ void Client::OPCombatAbility(const CombatAbility_Struct *ca_atk) return; if (!p_timers.Expired(&database, timer, false)) { - Message(13, "Ability recovery time not yet met."); + Message(Chat::Red, "Ability recovery time not yet met."); return; } @@ -530,7 +530,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) { if(IsClient()) { const EQEmu::ItemInstance *wpn = CastToClient()->GetInv().GetItem(EQEmu::invslot::slotPrimary); if (!wpn || (wpn->GetItem()->ItemType != EQEmu::item::ItemType1HPiercing)){ - Message_StringID(13, BACKSTAB_WEAPON); + Message_StringID(Chat::Red, BACKSTAB_WEAPON); return; } } @@ -720,11 +720,11 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { float dist = DistanceSquared(m_Position, other->GetPosition()); if(dist > range) { Log(Logs::Detail, Logs::Combat, "Ranged attack out of range... client should catch this. (%f > %f).\n", dist, range); - Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. + Message_StringID(Chat::Red,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. return; } else if(dist < (RuleI(Combat, MinRangedAttackDist)*RuleI(Combat, MinRangedAttackDist))){ - Message_StringID(15,RANGED_TOO_CLOSE);//Client enforces range and sends the message, this is a backup just incase. + Message_StringID(Chat::Yellow,RANGED_TOO_CLOSE);//Client enforces range and sends the message, this is a backup just incase. return; } @@ -1273,11 +1273,11 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 float dist = DistanceSquared(m_Position, other->GetPosition()); if(dist > range) { Log(Logs::Detail, Logs::Combat, "Throwing attack out of range... client should catch this. (%f > %f).\n", dist, range); - Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. + Message_StringID(Chat::Red,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. return; } else if(dist < (RuleI(Combat, MinRangedAttackDist)*RuleI(Combat, MinRangedAttackDist))){ - Message_StringID(15,RANGED_TOO_CLOSE);//Client enforces range and sends the message, this is a backup just incase. + Message_StringID(Chat::Yellow,RANGED_TOO_CLOSE);//Client enforces range and sends the message, this is a backup just incase. return; } @@ -1566,7 +1566,7 @@ void NPC::DoClassAttacks(Mob *target) { //general stuff, for all classes.... //only gets used when their primary ability get used too if (taunting && HasOwner() && target->IsNPC() && target->GetBodyType() != BT_Undead && taunt_time) { - this->GetOwner()->Message_StringID(MT_PetResponse, PET_TAUNTING); + this->GetOwner()->Message_StringID(Chat::PetResponse, PET_TAUNTING); Taunt(target->CastToNPC(), false); } @@ -1898,7 +1898,7 @@ void Mob::Taunt(NPC *who, bool always_succeed, int chance_bonus, bool FromSpell, // Support for how taunt worked pre 2000 on LIVE - Can not taunt NPC over your level. if ((RuleB(Combat, TauntOverLevel) == false) && (level_difference < 0) || who->GetSpecialAbility(IMMUNE_TAUNT)) { - Message_StringID(MT_SpellFailure, FAILED_TAUNT); + Message_StringID(Chat::SpellFailure, FAILED_TAUNT); return; } @@ -1955,10 +1955,10 @@ void Mob::Taunt(NPC *who, bool always_succeed, int chance_bonus, bool FromSpell, if (who->CanTalk()) who->Say_StringID(SUCCESSFUL_TAUNT, GetCleanName()); } else { - Message_StringID(MT_SpellFailure, FAILED_TAUNT); + Message_StringID(Chat::SpellFailure, FAILED_TAUNT); } } else { - Message_StringID(MT_SpellFailure, FAILED_TAUNT); + Message_StringID(Chat::SpellFailure, FAILED_TAUNT); } if (HasSkillProcs()) @@ -2003,10 +2003,10 @@ void Mob::InstillDoubt(Mob *who) { SpellOnTarget(229, who, false, true, -2000); //is there a success message? } else { - Message_StringID(4,NOT_SCARING); + Message_StringID(Chat::LightBlue,NOT_SCARING); //Idea from WR: /* if (target->IsNPC() && zone->random.Int(0,99) < 10 ) { - entity_list.MessageClose(target, false, 50, MT_NPCRampage, "%s lashes out in anger!",target->GetName()); + entity_list.MessageClose(target, false, 50, Chat::NPCRampage, "%s lashes out in anger!",target->GetName()); //should we actually do this? and the range is completely made up, unconfirmed entity_list.AEAttack(target, 50); }*/ @@ -2033,7 +2033,7 @@ int Mob::TryHeadShot(Mob *defender, EQEmu::skills::SkillType skillInUse) chance = chance * norm / 100; chance += aabonuses.HeadShot[0] + spellbonuses.HeadShot[0] + itembonuses.HeadShot[0]; if (zone->random.Int(1, 1000) <= chance) { - entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FATAL_BOW_SHOT, + entity_list.MessageClose_StringID(this, false, 200, Chat::MeleeCrit, FATAL_BOW_SHOT, GetName()); return HeadShot_Dmg; } @@ -2078,7 +2078,7 @@ int Mob::TryAssassinate(Mob *defender, EQEmu::skills::SkillType skillInUse) if (Assassinate_Dmg && Assassinate_Level && (defender->GetLevel() <= Assassinate_Level)) { if (zone->random.Int(1, 1000) <= chance) { - entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, ASSASSINATES, + entity_list.MessageClose_StringID(this, false, 200, Chat::MeleeCrit, ASSASSINATES, GetName()); return Assassinate_Dmg; } diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index e4c0badd5..af5a63ffc 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -471,7 +471,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(zone->random.Roll(RuleI(Spells, SuccorFailChance))) { //2% Fail chance by default if(IsClient()) { - CastToClient()->Message_StringID(MT_SpellFailure,SUCCOR_FAIL); + CastToClient()->Message_StringID(Chat::SpellFailure,SUCCOR_FAIL); } break; } @@ -638,11 +638,11 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove CastToClient()->SummonItem(13073, fcharges); } else{ - Message(13, "You can only transmute flesh to bone."); + Message(Chat::Red, "You can only transmute flesh to bone."); } } else{ - Message(13, "You can only transmute flesh to bone."); + Message(Chat::Red, "You can only transmute flesh to bone."); } } break; @@ -703,7 +703,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity)))))) { if (caster) - caster->Message_StringID(MT_SpellFailure, IMMUNE_STUN); + caster->Message_StringID(Chat::SpellFailure, IMMUNE_STUN); } else { int stun_resist = itembonuses.StunResist+spellbonuses.StunResist; if (IsClient()) @@ -718,7 +718,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove Stun(effect_value); } else { if (IsClient()) - Message_StringID(MT_Stun, SHAKE_OFF_STUN); + Message_StringID(Chat::Stun, SHAKE_OFF_STUN); Log(Logs::Detail, Logs::Combat, "Stun Resisted. We had %d percent resist chance.", stun_resist); } @@ -847,14 +847,14 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(ClosestMob) { - Message_StringID(MT_Spells, MessageID); + Message_StringID(Chat::Spells, MessageID); SetHeading(CalculateHeadingToTarget(ClosestMob->GetX(), ClosestMob->GetY())); SetTarget(ClosestMob); CastToClient()->SendTargetCommand(ClosestMob->GetID()); SentPositionPacket(0.0f, 0.0f, 0.0f, 0.0f, 0, true); } else - Message_StringID(clientMessageError, SENSE_NOTHING); + Message_StringID(Chat::Red, SENSE_NOTHING); } } break; @@ -939,14 +939,14 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove { if(!zone->CanBind()) { - Message_StringID(MT_SpellFailure, CANNOT_BIND); + Message_StringID(Chat::SpellFailure, CANNOT_BIND); break; } if(!zone->IsCity()) { if(caster != this) { - Message_StringID(MT_SpellFailure, CANNOT_BIND); + Message_StringID(Chat::SpellFailure, CANNOT_BIND); break; } else @@ -1039,7 +1039,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(zone->random.Roll(effect_value)) Gate(spells[spell_id].base2[i] - 1); else if (caster) - caster->Message_StringID(MT_SpellFailure,GATE_FAIL); + caster->Message_StringID(Chat::SpellFailure,GATE_FAIL); } break; } @@ -1051,7 +1051,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #endif if(GetSpecialAbility(UNDISPELLABLE)){ if (caster) - caster->Message_StringID(MT_SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name); + caster->Message_StringID(Chat::SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name); break; } @@ -1077,7 +1077,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #endif if(GetSpecialAbility(UNDISPELLABLE)){ if (caster) - caster->Message_StringID(MT_SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name); + caster->Message_StringID(Chat::SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name); break; } @@ -1103,7 +1103,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #endif if(GetSpecialAbility(UNDISPELLABLE)){ if (caster) - caster->Message_StringID(MT_SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name); + caster->Message_StringID(Chat::SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name); break; } @@ -1155,7 +1155,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove snprintf(effect_desc, _EDLEN, "Summon Item: %s (id %d)", itemname, spell.base[i]); #endif if (!item) { - Message(13, "Unable to summon item %d. Item not found.", spell.base[i]); + Message(Chat::Red, "Unable to summon item %d. Item not found.", spell.base[i]); } else if (IsClient()) { Client *c = CastToClient(); if (c->CheckLoreConflict(item)) { @@ -1194,10 +1194,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if (!SummonedItem || !SummonedItem->IsClassBag()) { if (caster) - caster->Message(13, "SE_SummonItemIntoBag but no bag has been summoned!"); + caster->Message(Chat::Red, "SE_SummonItemIntoBag but no bag has been summoned!"); } else if ((slot = SummonedItem->FirstOpenSlot()) == 0xff) { if (caster) - caster->Message(13, "SE_SummonItemIntoBag but no room in summoned bag!"); + caster->Message(Chat::Red, "SE_SummonItemIntoBag but no room in summoned bag!"); } else if (IsClient()) { if (CastToClient()->CheckLoreConflict(item)) { CastToClient()->DuplicateLoreMessage(spell.base[i]); @@ -1235,7 +1235,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #endif if(GetPet()) { - Message_StringID(MT_Shout, ONLY_ONE_PET); + Message_StringID(Chat::Shout, ONLY_ONE_PET); } else { @@ -1516,7 +1516,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove { WipeHateList(); } - Message(13, "Your mind fogs. Who are my friends? Who are my enemies?... it was all so clear a moment ago..."); + Message(Chat::Red, "Your mind fogs. Who are my friends? Who are my enemies?... it was all so clear a moment ago..."); } break; } @@ -1537,7 +1537,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove && caster && (!caster->IsNPC() || (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity))))) { if (caster) - caster->Message_StringID(MT_Shout, IMMUNE_STUN); + caster->Message_StringID(Chat::Shout, IMMUNE_STUN); } else { @@ -1644,12 +1644,12 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove { if(caster == this) { - Message_StringID(MT_Spells, + Message_StringID(Chat::Spells, SENTINEL_TRIG_YOU); } else { - caster->Message_StringID(MT_Spells, + caster->Message_StringID(Chat::Spells, SENTINEL_TRIG_OTHER, GetCleanName()); } } @@ -1757,7 +1757,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove Group* group = entity_list.GetGroupByClient(TargetClient); if(group) { if(!group->IsGroupMember(TargetClient)) { - Message(13, "Your target must be a group member for this spell."); + Message(Chat::Red, "Your target must be a group member for this spell."); break; } } @@ -1770,13 +1770,13 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(gid < 11) { if(r->GetGroup(TargetClient->GetName()) != gid) { - Message(13, "Your target must be a group member for this spell."); + Message(Chat::Red, "Your target must be a group member for this spell."); break; } } } else { if(TargetClient != this->CastToClient()) { - Message(13, "Your target must be a group member for this spell."); + Message(Chat::Red, "Your target must be a group member for this spell."); break; } } @@ -1790,26 +1790,26 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove Corpse *corpse = entity_list.GetCorpseByOwner(TargetClient); if(corpse) { if(TargetClient == this->CastToClient()) - Message_StringID(4, SUMMONING_CORPSE, TargetClient->CastToMob()->GetCleanName()); + Message_StringID(Chat::LightBlue, SUMMONING_CORPSE, TargetClient->CastToMob()->GetCleanName()); else - Message_StringID(4, SUMMONING_CORPSE_OTHER, TargetClient->CastToMob()->GetCleanName()); + Message_StringID(Chat::LightBlue, SUMMONING_CORPSE_OTHER, TargetClient->CastToMob()->GetCleanName()); corpse->Summon(CastToClient(), true, true); } else { // No corpse found in the zone - Message_StringID(4, CORPSE_CANT_SENSE); + Message_StringID(Chat::LightBlue, CORPSE_CANT_SENSE); } } else if (caster) { char level[4]; ConvertArray(effect_value, level); - caster->Message_StringID(MT_SpellFailure, + caster->Message_StringID(Chat::SpellFailure, SPELL_LEVEL_REQ, level); } } else { - Message_StringID(4, TARGET_NOT_FOUND); + Message_StringID(Chat::LightBlue, TARGET_NOT_FOUND); Log(Logs::General, Logs::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id); } } @@ -1937,7 +1937,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove continue; if (effect_value >= static_cast(buffs[j].counters)) { if (caster) { - caster->Message(MT_Spells,"You have cured your target of %s!",spells[buffs[j].spellid].name); + caster->Message(Chat::Spells,"You have cured your target of %s!",spells[buffs[j].spellid].name); caster->CastOnCurer(buffs[j].spellid); CastOnCure(buffs[j].spellid); } @@ -1971,7 +1971,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if (effect_value >= static_cast(buffs[j].counters)) { if (caster) { - caster->Message(MT_Spells,"You have cured your target of %s!",spells[buffs[j].spellid].name); + caster->Message(Chat::Spells,"You have cured your target of %s!",spells[buffs[j].spellid].name); caster->CastOnCurer(buffs[j].spellid); CastOnCure(buffs[j].spellid); } @@ -2007,7 +2007,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if (effect_value >= static_cast(buffs[j].counters)) { if (caster) { - caster->Message(MT_Spells,"You have cured your target of %s!",spells[buffs[j].spellid].name); + caster->Message(Chat::Spells,"You have cured your target of %s!",spells[buffs[j].spellid].name); caster->CastOnCurer(buffs[j].spellid); CastOnCure(buffs[j].spellid); } @@ -2042,7 +2042,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove continue; if (effect_value >= static_cast(buffs[j].counters)) { if (caster) { - caster->Message(MT_Spells,"You have cured your target of %s!",spells[buffs[j].spellid].name); + caster->Message(Chat::Spells,"You have cured your target of %s!",spells[buffs[j].spellid].name); caster->CastOnCurer(buffs[j].spellid); CastOnCure(buffs[j].spellid); } @@ -2068,7 +2068,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(GetLevel() <= 52) CastToNPC()->Depop(true); else - Message(13, "Your target is too high level to be affected by this spell."); + Message(Chat::Red, "Your target is too high level to be affected by this spell."); } break; } @@ -2115,10 +2115,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), caster->GetX(), caster->GetY(), caster->GetZ(), caster->GetHeading(), 2, SummonPC); - Message(15, "You have been summoned!"); + Message(Chat::Yellow, "You have been summoned!"); entity_list.ClearAggro(this); } else - caster->Message(13, "This spell can only be cast on players."); + caster->Message(Chat::Red, "This spell can only be cast on players."); break; } @@ -2725,13 +2725,13 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_MassGroupBuff:{ SetMGB(true); - Message_StringID(MT_Disciplines, MGB_STRING); + Message_StringID(Chat::Disciplines, MGB_STRING); break; } case SE_IllusionOther: { SetProjectIllusion(true); - Message(10, "The power of your next illusion spell will flow to your grouped target in your place."); + Message(Chat::NPCQuestSay, "The power of your next illusion spell will flow to your grouped target in your place."); break; } @@ -3572,7 +3572,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster) if (IsAIControlled()) { WipeHateList(); } - Message(13, "Your mind fogs. Who are my friends? Who are my enemies?... it was all so " + Message(Chat::Red, "Your mind fogs. Who are my friends? Who are my enemies?... it was all so " "clear a moment ago..."); } break; @@ -3643,7 +3643,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster) case SE_Invisibility2: case SE_InvisVsUndead2: { if (buff.ticsremaining <= 3 && buff.ticsremaining > 1) { - Message_StringID(MT_Spells, INVIS_BEGIN_BREAK); + Message_StringID(Chat::Spells, INVIS_BEGIN_BREAK); } break; } @@ -4047,7 +4047,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) if(p->IsPet()) notify = p->GetOwner(); if(p) { - notify->Message_StringID(MT_WornOff, SPELL_WORN_OFF_OF, + notify->Message_StringID(Chat::SpellWornOff, SPELL_WORN_OFF_OF, spells[buffs[slot].spellid].name, GetCleanName()); } } @@ -5406,7 +5406,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) default: break; } - Message_StringID(MT_Spells, string_id, UsedItem->Name); + Message_StringID(Chat::Spells, string_id, UsedItem->Name); } } @@ -5814,9 +5814,9 @@ bool Mob::TryDeathSave() { Message(263, "The gods have healed you for %i points of damage.", HealAmt); if(spellbonuses.DeathSave[0] == 2) - entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, DIVINE_INTERVENTION, GetCleanName()); + entity_list.MessageClose_StringID(this, false, 200, Chat::MeleeCrit, DIVINE_INTERVENTION, GetCleanName()); else - entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, DEATH_PACT, GetCleanName()); + entity_list.MessageClose_StringID(this, false, 200, Chat::MeleeCrit, DEATH_PACT, GetCleanName()); SendHPUpdate(); BuffFadeBySlot(buffSlot); @@ -5847,9 +5847,9 @@ bool Mob::TryDeathSave() { Message(263, "The gods have healed you for %i points of damage.", HealAmt); if(spellbonuses.DeathSave[0] == 2) - entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, DIVINE_INTERVENTION, GetCleanName()); + entity_list.MessageClose_StringID(this, false, 200, Chat::MeleeCrit, DIVINE_INTERVENTION, GetCleanName()); else - entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, DEATH_PACT, GetCleanName()); + entity_list.MessageClose_StringID(this, false, 200, Chat::MeleeCrit, DEATH_PACT, GetCleanName()); SendHPUpdate(); BuffFadeBySlot(buffSlot); @@ -6802,11 +6802,11 @@ void Client::BreakFeignDeathWhenCastOn(bool IsResisted) chance *= 2; if(chance && (zone->random.Roll(chance))){ - Message_StringID(MT_SpellFailure,FD_CAST_ON_NO_BREAK); + Message_StringID(Chat::SpellFailure,FD_CAST_ON_NO_BREAK); return; } SetFeigned(false); - Message_StringID(MT_SpellFailure,FD_CAST_ON); + Message_StringID(Chat::SpellFailure,FD_CAST_ON); } } diff --git a/zone/spells.cpp b/zone/spells.cpp index fa09727a2..2b4056434 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -180,9 +180,9 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, Log(Logs::Detail, Logs::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d, amnesiad? %d", IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced(), IsAmnesiad() ); if(IsSilenced() && !IsDiscipline(spell_id)) - Message_StringID(13, SILENCED_STRING); + Message_StringID(Chat::Red, SILENCED_STRING); if(IsAmnesiad() && IsDiscipline(spell_id)) - Message_StringID(13, MELEE_SILENCE); + Message_StringID(Chat::Red, MELEE_SILENCE); if(IsClient()) CastToClient()->SendSpellBarEnable(spell_id); if(casting_spell_id && IsNPC()) @@ -197,7 +197,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, int chance = CastToClient()->GetFocusEffect(focusFcMute, spell_id);//Client only if (zone->random.Roll(chance)) { - Message_StringID(13, SILENCED_STRING); + Message_StringID(Chat::Red, SILENCED_STRING); if(IsClient()) CastToClient()->SendSpellBarEnable(spell_id); return(false); @@ -205,7 +205,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, } if(IsDetrimentalSpell(spell_id) && !zone->CanDoCombat()){ - Message_StringID(13, SPELL_WOULDNT_HOLD); + Message_StringID(Chat::Red, SPELL_WOULDNT_HOLD); if(IsClient()) CastToClient()->SendSpellBarEnable(spell_id); if(casting_spell_id && IsNPC()) @@ -257,7 +257,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item with an invalid class"); } else { - Message_StringID(13, MUST_EQUIP_ITEM); + Message_StringID(Chat::Red, MUST_EQUIP_ITEM); } return(false); } @@ -272,11 +272,11 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, if (CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::RoF) { // Line 181 in eqstr_us.txt was changed in RoF+ - Message(15, "Your race, class, or deity cannot use this item."); + Message(Chat::Yellow, "Your race, class, or deity cannot use this item."); } else { - Message_StringID(13, CANNOT_USE_ITEM); + Message_StringID(Chat::Red, CANNOT_USE_ITEM); } } return(false); @@ -289,7 +289,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item without equiping it"); } else { - Message_StringID(13, MUST_EQUIP_ITEM); + Message_StringID(Chat::Red, MUST_EQUIP_ITEM); } return(false); } @@ -370,22 +370,24 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, Mob::SetMana(GetMana() - use_mana); // We send StopCasting which will update mana StopCasting(); - Message_StringID(MT_SpellFailure, fizzle_msg); + Message_StringID(Chat::SpellFailure, fizzle_msg); - /* Song Failure Messages */ + /** + * Song Failure message + */ entity_list.FilteredMessageClose_StringID( - this, /* Sender */ - true, /* Skip Sender */ + this, + true, RuleI(Range, SpellMessages), - MT_SpellFailure, /* Type: 289 */ - (IsClient() ? FilterPCSpells : FilterNPCSpells), /* FilterType: 8 or 9 depending on client/npc */ + Chat::SpellFailure, + (IsClient() ? FilterPCSpells : FilterNPCSpells), (fizzle_msg == MISS_NOTE ? MISSED_NOTE_OTHER : SPELL_FIZZLE_OTHER), /* MessageFormat: You miss a note, bringing your song to a close! (if missed note) MessageFormat: A missed note brings %1's song to a close! MessageFormat: %1's spell fizzles! */ - GetName() /* Message1 */ + GetName() ); TryTriggerOnValueAmount(false, true); @@ -426,7 +428,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, Log(Logs::Detail, Logs::Spells, "Spell Error: no target. spell=%d", spell_id); if(IsClient()) { //clients produce messages... npcs should not for this case - Message_StringID(13, SPELL_NEED_TAR); + Message_StringID(Chat::Red, SPELL_NEED_TAR); InterruptSpell(); } else { InterruptSpell(0, 0, 0); //the 0 args should cause no messages @@ -459,7 +461,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, Log(Logs::Detail, Logs::Spells, "Spell Error not enough mana spell=%d mymana=%d cost=%d\n", spell_id, my_curmana, mana_cost); if(IsClient()) { //clients produce messages... npcs should not for this case - Message_StringID(13, INSUFFICIENT_MANA); + Message_StringID(Chat::Red, INSUFFICIENT_MANA); InterruptSpell(); } else { InterruptSpell(0, 0, 0); //the 0 args should cause no messages @@ -516,7 +518,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, if (IsClient() && slot == CastingSlot::Item && item_slot != 0xFFFFFFFF) { auto item = CastToClient()->GetInv().GetItem(item_slot); if (item && item->GetItem()) - Message_StringID(MT_Spells, BEGINS_TO_GLOW, item->GetItem()->Name); + Message_StringID(Chat::Spells, BEGINS_TO_GLOW, item->GetItem()->Name); } if (!DoCastingChecks()) { @@ -573,28 +575,28 @@ bool Mob::DoCastingChecks() if (spell_target && spells[spell_id].targettype != ST_Self && !spell_target->CheckSpellLevelRestriction(spell_id)) { Log(Logs::Detail, Logs::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); if (!IsBardSong(spell_id)) - Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL); + Message_StringID(Chat::SpellFailure, SPELL_TOO_POWERFUL); return false; } } if (spells[spell_id].zonetype == 1 && !zone->CanCastOutdoor()) { - Message_StringID(13, CAST_OUTDOORS); + Message_StringID(Chat::Red, CAST_OUTDOORS); return false; } if (IsEffectInSpell(spell_id, SE_Levitate) && !zone->CanLevitate()) { - Message(13, "You can't levitate in this zone."); + Message(Chat::Red, "You can't levitate in this zone."); return false; } if(zone->IsSpellBlocked(spell_id, glm::vec3(GetPosition()))) { const char *msg = zone->GetSpellBlockedMessage(spell_id, glm::vec3(GetPosition())); if (msg) { - Message(13, msg); + Message(Chat::Red, msg); return false; } else { - Message(13, "You can't cast this spell here."); + Message(Chat::Red, "You can't cast this spell here."); return false; } } @@ -678,7 +680,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){ if (GetRawSkill(EQEmu::skills::SkillPercussionInstruments) > 0) // no skill increases if not trained in the instrument CheckIncreaseSkill(EQEmu::skills::SkillPercussionInstruments, nullptr, -15); else - Message_StringID(13,NO_INSTRUMENT_SKILL); // tell the client that they need instrument training + Message_StringID(Chat::Red,NO_INSTRUMENT_SKILL); // tell the client that they need instrument training } else CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15); @@ -688,7 +690,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){ if (GetRawSkill(EQEmu::skills::SkillStringedInstruments) > 0) CheckIncreaseSkill(EQEmu::skills::SkillStringedInstruments, nullptr, -15); else - Message_StringID(13,NO_INSTRUMENT_SKILL); + Message_StringID(Chat::Red,NO_INSTRUMENT_SKILL); } else CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15); @@ -698,7 +700,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){ if (GetRawSkill(EQEmu::skills::SkillWindInstruments) > 0) CheckIncreaseSkill(EQEmu::skills::SkillWindInstruments, nullptr, -15); else - Message_StringID(13,NO_INSTRUMENT_SKILL); + Message_StringID(Chat::Red,NO_INSTRUMENT_SKILL); } else CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15); @@ -708,7 +710,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){ if (GetRawSkill(EQEmu::skills::SkillBrassInstruments) > 0) CheckIncreaseSkill(EQEmu::skills::SkillBrassInstruments, nullptr, -15); else - Message_StringID(13,NO_INSTRUMENT_SKILL); + Message_StringID(Chat::Red,NO_INSTRUMENT_SKILL); } else CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15); @@ -859,7 +861,7 @@ void Mob::InterruptSpell(uint16 message, uint16 color, uint16 spellid) } if(casting_spell_aa_id && IsClient()) { //Rest AA Timer on failed cast - CastToClient()->Message_StringID(MT_SpellFailure, ABILITY_FAILED); + CastToClient()->Message_StringID(Chat::SpellFailure, ABILITY_FAILED); CastToClient()->ResetAlternateAdvancementTimer(casting_spell_aa_id); } @@ -938,7 +940,7 @@ void Mob::StopCasting() if (IsClient()) { auto c = CastToClient(); if (casting_spell_aa_id) { //Rest AA Timer on failed cast - c->Message_StringID(MT_SpellFailure, ABILITY_FAILED); + c->Message_StringID(Chat::SpellFailure, ABILITY_FAILED); c->ResetAlternateAdvancementTimer(casting_spell_aa_id); } @@ -967,7 +969,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo if(IsClient() && slot != CastingSlot::Item && slot != CastingSlot::PotionBelt && spells[spell_id].recast_time > 1000) { // 10 is item if(!CastToClient()->GetPTimers().Expired(&database, pTimerSpellStart + spell_id, false)) { //should we issue a message or send them a spell gem packet? - Message_StringID(13, SPELL_RECAST); + Message_StringID(Chat::Red, SPELL_RECAST); Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: spell reuse timer not expired", spell_id); StopCasting(); return; @@ -981,7 +983,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo if(itm && itm->GetItem()->RecastDelay > 0) { if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + itm->GetItem()->RecastType), false)) { - Message_StringID(13, SPELL_RECAST); + Message_StringID(Chat::Red, SPELL_RECAST); Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); StopCasting(); return; @@ -1003,7 +1005,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo if(delaytimer) { Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: recast too quickly", spell_id); - Message(13, "You are unable to focus."); + Message(Chat::Red, "You are unable to focus."); InterruptSpell(); return; } @@ -1013,7 +1015,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo if (casting_spell_id != spell_id) { Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: already casting", spell_id); - Message_StringID(13,ALREADY_CASTING); + Message_StringID(Chat::Red,ALREADY_CASTING); InterruptSpell(); return; } @@ -1131,8 +1133,8 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo } // if we got here, we regained concentration regain_conc = true; - Message_StringID(MT_Spells,REGAIN_AND_CONTINUE); - entity_list.MessageClose_StringID(this, true, RuleI(Range, SpellMessages), MT_Spells, OTHER_REGAIN_CAST, this->GetCleanName()); + Message_StringID(Chat::Spells, REGAIN_AND_CONTINUE); + entity_list.MessageClose_StringID(this, true, RuleI(Range, SpellMessages), Chat::Spells, OTHER_REGAIN_CAST, this->GetCleanName()); } } @@ -1168,7 +1170,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo case 13000: if(itembonuses.percussionMod == 0) { // check for the appropriate instrument type HasInstrument = false; - c->Message_StringID(13, SONG_NEEDS_DRUM); // send an error message if missing + c->Message_StringID(Chat::Red, SONG_NEEDS_DRUM); // send an error message if missing } break; @@ -1176,7 +1178,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo case 13001: if(itembonuses.windMod == 0) { HasInstrument = false; - c->Message_StringID(13, SONG_NEEDS_WIND); + c->Message_StringID(Chat::Red, SONG_NEEDS_WIND); } break; @@ -1184,7 +1186,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo case 13011: if(itembonuses.stringedMod == 0) { HasInstrument = false; - c->Message_StringID(13, SONG_NEEDS_STRINGS); + c->Message_StringID(Chat::Red, SONG_NEEDS_STRINGS); } break; @@ -1192,7 +1194,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo case 13012: if(itembonuses.brassMod == 0) { HasInstrument = false; - c->Message_StringID(13, SONG_NEEDS_BRASS); + c->Message_StringID(Chat::Red, SONG_NEEDS_BRASS); } break; @@ -1220,13 +1222,13 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo { if (!missingreags) { - c->Message_StringID(13, MISSING_SPELL_COMP); + c->Message_StringID(Chat::Red, MISSING_SPELL_COMP); missingreags=true; } const EQEmu::ItemData *item = database.GetItem(component); if(item) { - c->Message_StringID(13, MISSING_SPELL_COMP_ITEM, item->Name); + c->Message_StringID(Chat::Red, MISSING_SPELL_COMP_ITEM, item->Name); Log(Logs::Detail, Logs::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component); } else { @@ -1270,7 +1272,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo } else { // some kind of error in the code if this happens - c->Message(13, "ERROR: reagent item disappeared while processing?"); + c->Message(Chat::Red, "ERROR: reagent item disappeared while processing?"); } } } @@ -1322,7 +1324,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo if(IsClient() && fromaug && recastdelay > 0) { if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + recasttype), false)) { - Message_StringID(13, SPELL_RECAST); + Message_StringID(Chat::Red, SPELL_RECAST); Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); StopCasting(); return; @@ -1353,7 +1355,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo else { Log(Logs::Detail, Logs::Spells, "Item used to cast spell %d was missing from inventory slot %d after casting!", spell_id, inventory_slot); - Message(13, "Casting Error: Active casting item not found in inventory slot %i", inventory_slot); + Message(Chat::Red, "Casting Error: Active casting item not found in inventory slot %i", inventory_slot); InterruptSpell(); return; } @@ -1500,7 +1502,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce targetType = ST_Target; if (spell_target && !spell_target->PassCastRestriction(true, spells[spell_id].CastRestriction)){ - Message_StringID(13,SPELL_NEED_TAR); + Message_StringID(Chat::Red,SPELL_NEED_TAR); return false; } @@ -1510,7 +1512,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if (spell_target && ((spell_target->IsNPC() && spell_target->IsEngaged()) || (spell_target->IsClient() && spell_target->CastToClient()->GetAggroCount()))) { - Message_StringID(13, SPELL_NO_EFFECT); // Unsure correct string + Message_StringID(Chat::Red, SPELL_NO_EFFECT); // Unsure correct string return false; } } @@ -1518,9 +1520,9 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce else if (IsBeneficialSpell(spell_id)) { if ((IsNPC() && IsEngaged()) || (IsClient() && CastToClient()->GetAggroCount())) { if (IsDiscipline(spell_id)) - Message_StringID(13, NO_ABILITY_IN_COMBAT); + Message_StringID(Chat::Red, NO_ABILITY_IN_COMBAT); else - Message_StringID(13, NO_CAST_IN_COMBAT); + Message_StringID(Chat::Red, NO_CAST_IN_COMBAT); return false; } @@ -1533,7 +1535,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if (spell_target && ((spell_target->IsNPC() && !spell_target->IsEngaged()) || (spell_target->IsClient() && !spell_target->CastToClient()->GetAggroCount()))) { - Message_StringID(13, SPELL_NO_EFFECT); // Unsure correct string + Message_StringID(Chat::Red, SPELL_NO_EFFECT); // Unsure correct string return false; } } @@ -1541,9 +1543,9 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce else if (IsBeneficialSpell(spell_id)) { if ((IsNPC() && !IsEngaged()) || (IsClient() && !CastToClient()->GetAggroCount())) { if (IsDiscipline(spell_id)) - Message_StringID(13, NO_ABILITY_OUT_OF_COMBAT); + Message_StringID(Chat::Red, NO_ABILITY_OUT_OF_COMBAT); else - Message_StringID(13, NO_CAST_OUT_OF_COMBAT); + Message_StringID(Chat::Red, NO_CAST_OUT_OF_COMBAT); return false; } @@ -1580,9 +1582,9 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce //invalid target Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, mob_body); if(!spell_target) - Message_StringID(13,SPELL_NEED_TAR); + Message_StringID(Chat::Red,SPELL_NEED_TAR); else - Message_StringID(13,CANNOT_AFFECT_NPC); + Message_StringID(Chat::Red,CANNOT_AFFECT_NPC); return false; } CastAction = SingleTarget; @@ -1594,7 +1596,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { //invalid target Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, mob_body); - Message_StringID(13,SPELL_NEED_TAR); + Message_StringID(Chat::Red,SPELL_NEED_TAR); return false; } CastAction = SingleTarget; @@ -1609,7 +1611,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (summoned pet)", spell_id, mob_body); - Message_StringID(13, SPELL_NEED_TAR); + Message_StringID(Chat::Red, SPELL_NEED_TAR); return false; } @@ -1633,9 +1635,9 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce //invalid target Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (want body Type %d)", spell_id, mob_body, target_bt); if(!spell_target) - Message_StringID(13,SPELL_NEED_TAR); + Message_StringID(Chat::Red,SPELL_NEED_TAR); else - Message_StringID(13,CANNOT_AFFECT_NPC); + Message_StringID(Chat::Red,CANNOT_AFFECT_NPC); return false; } CastAction = SingleTarget; @@ -1650,7 +1652,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (ldon object)", spell_id); - Message_StringID(13,SPELL_NEED_TAR); + Message_StringID(Chat::Red,SPELL_NEED_TAR); return false; } else @@ -1658,14 +1660,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target->IsNPC()) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (normal)", spell_id); - Message_StringID(13,SPELL_NEED_TAR); + Message_StringID(Chat::Red,SPELL_NEED_TAR); return false; } if(spell_target->GetClass() != LDON_TREASURE) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (normal)", spell_id); - Message_StringID(13,SPELL_NEED_TAR); + Message_StringID(Chat::Red,SPELL_NEED_TAR); return false; } } @@ -1674,7 +1676,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (normal)", spell_id); - Message_StringID(13,SPELL_NEED_TAR); + Message_StringID(Chat::Red,SPELL_NEED_TAR); return false; // can't cast these unless we have a target } CastAction = SingleTarget; @@ -1690,7 +1692,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) message = SPELL_NEED_TAR; else if(!spell_target->IsCorpse()) message = ONLY_ON_CORPSES; else if(!spell_target->IsPlayerCorpse()) message = CORPSE_NOT_VALID; - Message_StringID(13, message); + Message_StringID(Chat::Red, message); return false; } CastAction = SingleTarget; @@ -1702,7 +1704,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (no pet)", spell_id); - Message_StringID(13,NO_PET); + Message_StringID(Chat::Red,NO_PET); return false; // can't cast these unless we have a target } CastAction = SingleTarget; @@ -1773,7 +1775,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (AOE)", spell_id); - Message_StringID(13,SPELL_NEED_TAR); + Message_StringID(Chat::Red,SPELL_NEED_TAR); return false; } ae_center = spell_target; @@ -1798,7 +1800,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce } if (spell_target && spell_target->IsPet() && spells[spell_id].targettype == ST_GroupNoPets){ - Message_StringID(13,NO_CAST_ON_PET); + Message_StringID(Chat::Red,NO_CAST_ON_PET); return false; } @@ -1810,7 +1812,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (Group Required: Single Target)", spell_id); - Message_StringID(13,SPELL_NEED_TAR); + Message_StringID(Chat::Red,SPELL_NEED_TAR); return false; } @@ -1927,14 +1929,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(group_id_caster == 0 || group_id_target == 0) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); - Message_StringID(13, TARGET_GROUP_MEMBER); + Message_StringID(Chat::Red, TARGET_GROUP_MEMBER); return false; } if(group_id_caster != group_id_target) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); - Message_StringID(13, TARGET_GROUP_MEMBER); + Message_StringID(Chat::Red, TARGET_GROUP_MEMBER); return false; } @@ -2028,7 +2030,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui if( spells[spell_id].zonetype == 1 && !zone->CanCastOutdoor()){ if(IsClient()){ if(!CastToClient()->GetGM()){ - Message_StringID(13, CAST_OUTDOORS); + Message_StringID(Chat::Red, CAST_OUTDOORS); return false; } } @@ -2037,7 +2039,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui if(IsEffectInSpell(spell_id, SE_Levitate) && !zone->CanLevitate()){ if(IsClient()){ if(!CastToClient()->GetGM()){ - Message(13, "You can't levitate in this zone."); + Message(Chat::Red, "You can't levitate in this zone."); return false; } } @@ -2048,11 +2050,11 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui if(zone->IsSpellBlocked(spell_id, glm::vec3(GetPosition()))){ const char *msg = zone->GetSpellBlockedMessage(spell_id, glm::vec3(GetPosition())); if(msg){ - Message(13, msg); + Message(Chat::Red, msg); return false; } else{ - Message(13, "You can't cast this spell here."); + Message(Chat::Red, "You can't cast this spell here."); return false; } @@ -2110,14 +2112,14 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui if(!spells[spell_id].npc_no_los && spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target) && !IsHarmonySpell(spell_id) && spells[spell_id].targettype != ST_TargetOptional) { Log(Logs::Detail, Logs::Spells, "Spell %d: cannot see target %s", spell_id, spell_target->GetName()); - Message_StringID(13,CANT_SEE_TARGET); + Message_StringID(Chat::Red,CANT_SEE_TARGET); return false; } // check to see if target is a caster mob before performing a mana tap if(spell_target && IsManaTapSpell(spell_id)) { if(spell_target->GetCasterClass() == 'N') { - Message_StringID(13, TARGET_NO_MANA); + Message_StringID(Chat::Red, TARGET_NO_MANA); return false; } } @@ -2141,13 +2143,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui if(dist2 > range2) { //target is out of range. Log(Logs::Detail, Logs::Spells, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); - Message_StringID(13, TARGET_OUT_OF_RANGE); + Message_StringID(Chat::Red, TARGET_OUT_OF_RANGE); return(false); } else if (dist2 < min_range2){ //target is too close range. Log(Logs::Detail, Logs::Spells, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2); - Message_StringID(13, TARGET_TOO_CLOSE); + Message_StringID(Chat::Red, TARGET_TOO_CLOSE); return(false); } @@ -2162,13 +2164,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui if(dist2 > range2) { //target is out of range. Log(Logs::Detail, Logs::Spells, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); - Message_StringID(13, TARGET_OUT_OF_RANGE); + Message_StringID(Chat::Red, TARGET_OUT_OF_RANGE); return(false); } else if (dist2 < min_range2){ //target is too close range. Log(Logs::Detail, Logs::Spells, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2); - Message_StringID(13, TARGET_TOO_CLOSE); + Message_StringID(Chat::Red, TARGET_TOO_CLOSE); return(false); } @@ -2518,7 +2520,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, CastingSlot slo if(spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target)) { Log(Logs::Detail, Logs::Spells, "Bard Song Pulse %d: cannot see target %s", spell_target->GetName()); - Message_StringID(13, CANT_SEE_TARGET); + Message_StringID(Chat::Red, CANT_SEE_TARGET); return(false); } @@ -2533,7 +2535,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, CastingSlot slo if(dist2 > range2) { //target is out of range. Log(Logs::Detail, Logs::Spells, "Bard Song Pulse %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); - Message_StringID(13, TARGET_OUT_OF_RANGE); + Message_StringID(Chat::Red, TARGET_OUT_OF_RANGE); return(false); } } @@ -2892,7 +2894,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, if (spellbonuses.Screech == 1) { if (effect2 == SE_Screech && sp2.base[i] == -1) { - Message_StringID(MT_SpellFailure, SCREECH_BUFF_BLOCK, sp2.name); + Message_StringID(Chat::SpellFailure, SCREECH_BUFF_BLOCK, sp2.name); return -1; } } @@ -3213,7 +3215,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid Log(Logs::Detail, Logs::Spells, "Adding buff %d failed: stacking prevented by spell %d in slot %d with caster level %d", spell_id, curbuf.spellid, buffslot, curbuf.casterlevel); if (caster && caster->IsClient() && RuleB(Client, UseLiveBlockedMessage)) { - caster->Message(13, "Your %s did not take hold on %s. (Blocked by %s.)", spells[spell_id].name, this->GetName(), spells[curbuf.spellid].name); + caster->Message(Chat::Red, "Your %s did not take hold on %s. (Blocked by %s.)", spells[spell_id].name, this->GetName(), spells[curbuf.spellid].name); } return -1; } @@ -3414,7 +3416,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r if(!spelltar) { Log(Logs::Detail, Logs::Spells, "Unable to apply spell %d without a target", spell_id); - Message(13, "SOT: You must have a target for this spell."); + Message(Chat::Red, "SOT: You must have a target for this spell."); return false; } @@ -3423,7 +3425,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r if(IsDetrimentalSpell(spell_id) && !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id)) { if(!IsClient() || !CastToClient()->GetGM()) { - Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); + Message_StringID(Chat::SpellFailure, SPELL_NO_HOLD); return false; } } @@ -3588,7 +3590,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r { if(spelltar->invisible) { - spelltar->Message_StringID(MT_SpellFailure, ALREADY_INVIS, GetCleanName()); + spelltar->Message_StringID(Chat::SpellFailure, ALREADY_INVIS, GetCleanName()); safe_delete(action_packet); return false; } @@ -3598,7 +3600,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r { if(spelltar->invisible_undead) { - spelltar->Message_StringID(MT_SpellFailure, ALREADY_INVIS, GetCleanName()); + spelltar->Message_StringID(Chat::SpellFailure, ALREADY_INVIS, GetCleanName()); safe_delete(action_packet); return false; } @@ -3608,7 +3610,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r { if(spelltar->invisible_animals) { - spelltar->Message_StringID(MT_SpellFailure, ALREADY_INVIS, GetCleanName()); + spelltar->Message_StringID(Chat::SpellFailure, ALREADY_INVIS, GetCleanName()); safe_delete(action_packet); return false; } @@ -3688,7 +3690,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r Log(Logs::Detail, Logs::Spells, "Beneficial ae bard song %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); } else { Log(Logs::Detail, Logs::Spells, "Beneficial spell %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); - Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); + Message_StringID(Chat::SpellFailure, SPELL_NO_HOLD); } safe_delete(action_packet); return false; @@ -3698,7 +3700,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r else if ( !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id)) // Detrimental spells - PVP check { Log(Logs::Detail, Logs::Spells, "Detrimental spell %d can't take hold %s -> %s", spell_id, GetName(), spelltar->GetName()); - spelltar->Message_StringID(MT_SpellFailure, YOU_ARE_PROTECTED, GetCleanName()); + spelltar->Message_StringID(Chat::SpellFailure, YOU_ARE_PROTECTED, GetCleanName()); safe_delete(action_packet); return false; } @@ -3735,7 +3737,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r focus = CalcFocusEffect(focusBlockNextSpell, buffs[b].spellid, spell_id); if(focus) { CheckNumHitsRemaining(NumHit::MatchingSpells, b); - Message_StringID(MT_SpellFailure, SPELL_WOULDNT_HOLD); + Message_StringID(Chat::SpellFailure, SPELL_WOULDNT_HOLD); safe_delete(action_packet); return false; } @@ -3788,14 +3790,14 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r this, /* Sender */ false, /* Skip Sender */ RuleI(Range, SpellMessages), /* Range */ - MT_Spells, /* Type */ + Chat::Spells, /* Type */ SPELL_REFLECT, /* String ID */ GetCleanName(), /* Message 1 */ spelltar->GetCleanName() /* Message 2 */ ); } else { - Message_StringID(MT_Spells, SPELL_REFLECT, GetCleanName(), spelltar->GetCleanName()); + Message_StringID(Chat::Spells, SPELL_REFLECT, GetCleanName(), spelltar->GetCleanName()); } CheckNumHitsRemaining(NumHit::ReflectSpell); @@ -3827,12 +3829,12 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r Log(Logs::Detail, Logs::Spells, "Spell %d was completely resisted by %s", spell_id, spelltar->GetName()); if (spells[spell_id].resisttype == RESIST_PHYSICAL){ - Message_StringID(MT_SpellFailure, PHYSICAL_RESIST_FAIL,spells[spell_id].name); - spelltar->Message_StringID(MT_SpellFailure, YOU_RESIST, spells[spell_id].name); + Message_StringID(Chat::SpellFailure, PHYSICAL_RESIST_FAIL,spells[spell_id].name); + spelltar->Message_StringID(Chat::SpellFailure, YOU_RESIST, spells[spell_id].name); } else { - Message_StringID(MT_SpellFailure, TARGET_RESISTED, spells[spell_id].name); - spelltar->Message_StringID(MT_SpellFailure, YOU_RESIST, spells[spell_id].name); + Message_StringID(Chat::SpellFailure, TARGET_RESISTED, spells[spell_id].name); + spelltar->Message_StringID(Chat::SpellFailure, YOU_RESIST, spells[spell_id].name); } if (spelltar->IsAIControlled()) { @@ -3897,7 +3899,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r { Log(Logs::Detail, Logs::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); if(!IsBardSong(spell_id)) - Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL); + Message_StringID(Chat::SpellFailure, SPELL_TOO_POWERFUL); safe_delete(action_packet); return false; } @@ -3909,7 +3911,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r // spell. It's most likely a buff that can't stack. Log(Logs::Detail, Logs::Spells, "Spell %d could not apply its effects %s -> %s\n", spell_id, GetName(), spelltar->GetName()); if(casting_spell_aa_id) - Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); + Message_StringID(Chat::SpellFailure, SPELL_NO_HOLD); safe_delete(action_packet); return false; } @@ -3989,14 +3991,14 @@ void Corpse::CastRezz(uint16 spellid, Mob* Caster) if(IsRezzed()){ if(Caster && Caster->IsClient()) - Caster->Message(13,"This character has already been resurrected."); + Caster->Message(Chat::Red,"This character has already been resurrected."); return; } /* if(!can_rez) { if(Caster && Caster->IsClient()) - Caster->Message_StringID(0, CORPSE_TOO_OLD); + Caster->Message_StringID(Chat::WhiteSmoke, CORPSE_TOO_OLD); return; } */ @@ -4224,7 +4226,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(GetSpecialAbility(UNMEZABLE)) { Log(Logs::Detail, Logs::Spells, "We are immune to Mez spells."); - caster->Message_StringID(MT_SpellFailure, CANNOT_MEZ); + caster->Message_StringID(Chat::SpellFailure, CANNOT_MEZ); int32 aggro = caster->CheckAggroAmount(spell_id, this); if(aggro > 0) { AddToHateList(caster, aggro); @@ -4242,7 +4244,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) (!caster->IsNPC() || (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity)))) { Log(Logs::Detail, Logs::Spells, "Our level (%d) is higher than the limit of this Mez spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); - caster->Message_StringID(MT_SpellFailure, CANNOT_MEZ_WITH_SPELL); + caster->Message_StringID(Chat::SpellFailure, CANNOT_MEZ_WITH_SPELL); AddToHateList(caster, 1,0,true,false,false,spell_id); return true; } @@ -4252,7 +4254,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(GetSpecialAbility(UNSLOWABLE) && IsEffectInSpell(spell_id, SE_AttackSpeed)) { Log(Logs::Detail, Logs::Spells, "We are immune to Slow spells."); - caster->Message_StringID(CC_Red, IMMUNE_ATKSPEED); + caster->Message_StringID(Chat::Red, IMMUNE_ATKSPEED); int32 aggro = caster->CheckAggroAmount(spell_id, this); if(aggro > 0) { AddToHateList(caster, aggro); @@ -4268,7 +4270,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) effect_index = GetSpellEffectIndex(spell_id, SE_Fear); if(GetSpecialAbility(UNFEARABLE)) { Log(Logs::Detail, Logs::Spells, "We are immune to Fear spells."); - caster->Message_StringID(CC_Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up + caster->Message_StringID(Chat::Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up int32 aggro = caster->CheckAggroAmount(spell_id, this); if(aggro > 0) { AddToHateList(caster, aggro); @@ -4279,13 +4281,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) } else if(IsClient() && caster->IsClient() && (caster->CastToClient()->GetGM() == false)) { Log(Logs::Detail, Logs::Spells, "Clients cannot fear eachother!"); - caster->Message_StringID(CC_Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up + caster->Message_StringID(Chat::Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up return true; } else if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) { Log(Logs::Detail, Logs::Spells, "Level is %d, cannot be feared by this spell.", GetLevel()); - caster->Message_StringID(MT_Shout, FEAR_TOO_HIGH); + caster->Message_StringID(Chat::Shout, FEAR_TOO_HIGH); int32 aggro = caster->CheckAggroAmount(spell_id, this); if (aggro > 0) { AddToHateList(caster, aggro); @@ -4296,9 +4298,9 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) } else if (CheckAATimer(aaTimerWarcry)) { - Message(13, "Your are immune to fear."); + Message(Chat::Red, "Your are immune to fear."); Log(Logs::Detail, Logs::Spells, "Clients has WarCry effect, immune to fear!"); - caster->Message_StringID(CC_Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up + caster->Message_StringID(Chat::Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up return true; } } @@ -4308,7 +4310,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(GetSpecialAbility(UNCHARMABLE)) { Log(Logs::Detail, Logs::Spells, "We are immune to Charm spells."); - caster->Message_StringID(CC_Red, CANNOT_CHARM); // need to verify message type, not in MQ2Cast for easy look up + caster->Message_StringID(Chat::Red, CANNOT_CHARM); // need to verify message type, not in MQ2Cast for easy look up int32 aggro = caster->CheckAggroAmount(spell_id, this); if(aggro > 0) { AddToHateList(caster, aggro); @@ -4321,7 +4323,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(this == caster) { Log(Logs::Detail, Logs::Spells, "You are immune to your own charms."); - caster->Message(CC_Red, "You cannot charm yourself."); // need to look up message? + caster->Message(Chat::Red, "You cannot charm yourself."); // need to look up message? return true; } @@ -4334,7 +4336,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) { Log(Logs::Detail, Logs::Spells, "Our level (%d) is higher than the limit of this Charm spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); - caster->Message_StringID(CC_Red, CANNOT_CHARM_YET); // need to verify message type, not in MQ2Cast for easy look up + caster->Message_StringID(Chat::Red, CANNOT_CHARM_YET); // need to verify message type, not in MQ2Cast for easy look up AddToHateList(caster, 1,0,true,false,false,spell_id); return true; } @@ -4349,7 +4351,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(GetSpecialAbility(UNSNAREABLE)) { Log(Logs::Detail, Logs::Spells, "We are immune to Snare spells."); - caster->Message_StringID(CC_Red, IMMUNE_MOVEMENT); + caster->Message_StringID(Chat::Red, IMMUNE_MOVEMENT); int32 aggro = caster->CheckAggroAmount(spell_id, this); if(aggro > 0) { AddToHateList(caster, aggro); @@ -4365,7 +4367,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(this == caster) { Log(Logs::Detail, Logs::Spells, "You cannot lifetap yourself."); - caster->Message_StringID(MT_SpellFailure, CANT_DRAIN_SELF); + caster->Message_StringID(Chat::SpellFailure, CANT_DRAIN_SELF); return true; } } @@ -4375,7 +4377,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(this == caster) { Log(Logs::Detail, Logs::Spells, "You cannot sacrifice yourself."); - caster->Message_StringID(MT_SpellFailure, CANNOT_SAC_SELF); + caster->Message_StringID(Chat::SpellFailure, CANNOT_SAC_SELF); return true; } } @@ -4993,7 +4995,7 @@ void Client::MakeBuffFadePacket(uint16 spell_id, int slot_id, bool send_message) const char *fadetext = spells[spell_id].spell_fades; outapp = new EQApplicationPacket(OP_ColoredText, sizeof(ColoredText_Struct) + strlen(fadetext)); ColoredText_Struct *bfm = (ColoredText_Struct *) outapp->pBuffer; - bfm->color = MT_Spells; + bfm->color = Chat::Spells; memcpy(bfm->msg, fadetext, strlen(fadetext)); QueuePacket(outapp); safe_delete(outapp); diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 7761747f9..40d301e7d 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -678,7 +678,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) if (taskID == TASKSLOTEMPTY) continue; if (!Tasks[taskID]) { - c->Message(13, + c->Message(Chat::Red, "Active Task Slot %i, references a task (%i), that does not exist. " "Removing from memory. Contact a GM to resolve this.", i, taskID); @@ -691,7 +691,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) for (int j = 0; j < Tasks[taskID]->ActivityCount; j++) { if (state->ActiveTasks[i].Activity[j].ActivityID != j) { - c->Message(13, + c->Message(Chat::Red, "Active Task %i, %s. Activity count does not match expected value." "Removing from memory. Contact a GM to resolve this.", taskID, Tasks[taskID]->Title.c_str()); @@ -1001,7 +1001,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i return; if (TaskSets[TaskSetID].empty()) { - mob->SayTo_StringID(c, CC_Yellow, MAX_ACTIVE_TASKS, c->GetName()); // I think this is suppose to be yellow + mob->SayTo_StringID(c, Chat::Yellow, MAX_ACTIVE_TASKS, c->GetName()); // I think this is suppose to be yellow return; } @@ -1033,7 +1033,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i if (TaskListIndex > 0) { SendTaskSelector(c, mob, TaskListIndex, TaskList); } else { - mob->SayTo_StringID(c, CC_Yellow, MAX_ACTIVE_TASKS, c->GetName()); // check color, I think this might be only for (Shared) Tasks, w/e -- think should be yellow + mob->SayTo_StringID(c, Chat::Yellow, MAX_ACTIVE_TASKS, c->GetName()); // check color, I think this might be only for (Shared) Tasks, w/e -- think should be yellow } return; @@ -1065,7 +1065,7 @@ void TaskManager::TaskQuestSetSelector(Client *c, ClientTaskState *state, Mob *m if (TaskListIndex > 0) { SendTaskSelector(c, mob, TaskListIndex, TaskList); } else { - mob->SayTo_StringID(c, CC_Yellow, MAX_ACTIVE_TASKS, c->GetName()); // check color, I think this might be only for (Shared) Tasks, w/e -- think should be yellow + mob->SayTo_StringID(c, Chat::Yellow, MAX_ACTIVE_TASKS, c->GetName()); // check color, I think this might be only for (Shared) Tasks, w/e -- think should be yellow } return; @@ -2001,7 +2001,7 @@ void ClientTaskState::RewardTask(Client *c, TaskInformation *Task) { c->SummonItem(Task->RewardID); Item = database.GetItem(Task->RewardID); if(Item) - c->Message(15, "You receive %s as a reward.", Item->Name); + c->Message(Chat::Yellow, "You receive %s as a reward.", Item->Name); } break; } @@ -2012,7 +2012,7 @@ void ClientTaskState::RewardTask(Client *c, TaskInformation *Task) { c->SummonItem(RewardList[i]); Item = database.GetItem(RewardList[i]); if(Item) - c->Message(15, "You receive %s as a reward.", Item->Name); + c->Message(Chat::Yellow, "You receive %s as a reward.", Item->Name); } break; } @@ -2024,7 +2024,7 @@ void ClientTaskState::RewardTask(Client *c, TaskInformation *Task) { } if (!Task->completion_emote.empty()) - c->SendColoredText(CC_Yellow, Task->completion_emote); // unsure if they use this packet or color, should work + c->SendColoredText(Chat::Yellow, Task->completion_emote); // unsure if they use this packet or color, should work // just use normal NPC faction ID stuff if (Task->faction_reward) @@ -2081,7 +2081,7 @@ void ClientTaskState::RewardTask(Client *c, TaskInformation *Task) { CashMessage += " copper"; } CashMessage += " pieces."; - c->Message(15,CashMessage.c_str()); + c->Message(Chat::Yellow,CashMessage.c_str()); } int32 EXPReward = Task->XPReward; if(EXPReward > 0) { @@ -3204,14 +3204,14 @@ void ClientTaskState::RemoveTask(Client *c, int sequenceNumber, TaskType type) void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID, bool enforce_level_requirement) { if (!taskmanager || TaskID < 0 || TaskID >= MAXTASKS) { - c->Message(13, "Task system not functioning, or TaskID %i out of range.", TaskID); + c->Message(Chat::Red, "Task system not functioning, or TaskID %i out of range.", TaskID); return; } auto task = taskmanager->Tasks[TaskID]; if (task == nullptr) { - c->Message(13, "Invalid TaskID %i", TaskID); + c->Message(Chat::Red, "Invalid TaskID %i", TaskID); return; } @@ -3235,7 +3235,7 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID, bool enfor } if (max_tasks) { - c->Message(13, "You already have the maximum allowable number of active tasks (%i)", MAXACTIVEQUESTS); + c->Message(Chat::Red, "You already have the maximum allowable number of active tasks (%i)", MAXACTIVEQUESTS); return; } @@ -3243,14 +3243,14 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID, bool enfor if (task->type == TaskType::Quest) { for (int i = 0; i < MAXACTIVEQUESTS; i++) { if (ActiveQuests[i].TaskID == TaskID) { - c->Message(13, "You have already been assigned this task."); + c->Message(Chat::Red, "You have already been assigned this task."); return; } } } if (enforce_level_requirement && !taskmanager->AppropriateLevel(TaskID, c->GetLevel())) { - c->Message(13, "You are outside the level range of this task."); + c->Message(Chat::Red, "You are outside the level range of this task."); return; } @@ -3287,7 +3287,7 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID, bool enfor // This shouldn't happen unless there is a bug in the handling of ActiveTaskCount somewhere if (active_slot == nullptr) { - c->Message(13, "You already have the maximum allowable number of active tasks (%i)", MAXACTIVEQUESTS); + c->Message(Chat::Red, "You already have the maximum allowable number of active tasks (%i)", MAXACTIVEQUESTS); return; } @@ -3315,8 +3315,8 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID, bool enfor NPC *npc = entity_list.GetID(NPCID)->CastToNPC(); if(!npc) { - c->Message(clientMessageYellow, "Task Giver ID is %i", NPCID); - c->Message(clientMessageError, "Unable to find NPC to send EVENT_TASKACCEPTED to. Report this bug."); + c->Message(Chat::Yellow, "Task Giver ID is %i", NPCID); + c->Message(Chat::Red, "Unable to find NPC to send EVENT_TASKACCEPTED to. Report this bug."); return; } diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 72cb51795..07e6da7fb 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -80,7 +80,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme if (itemsFound != 2) { - user->Message(13, "Error: Too many/few items in augmentation container."); + user->Message(Chat::Red, "Error: Too many/few items in augmentation container."); return; } } @@ -90,7 +90,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme if(!container) { Log(Logs::General, Logs::Error, "Player tried to augment an item without a container set."); - user->Message(13, "Error: This item is not a container!"); + user->Message(Chat::Red, "Error: This item is not a container!"); return; } @@ -115,7 +115,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme { // Either 2 augmentable items found or none found // This should never occur due to client restrictions, but prevent in case of a hack - user->Message(13, "Error: Must be 1 augmentable item in the sealer"); + user->Message(Chat::Red, "Error: Must be 1 augmentable item in the sealer"); return; } } @@ -124,11 +124,11 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme // This happens if the augment button is clicked more than once quickly while augmenting if (!container->GetItem(0)) { - user->Message(13, "Error: No item in slot 0 of sealer"); + user->Message(Chat::Red, "Error: No item in slot 0 of sealer"); } if (!container->GetItem(1)) { - user->Message(13, "Error: No item in slot 1 of sealer"); + user->Message(Chat::Red, "Error: No item in slot 1 of sealer"); } return; } @@ -160,7 +160,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme } else { - user->Message(13, "Error: No available slot for augment"); + user->Message(Chat::Red, "Error: No available slot for augment"); } } else @@ -170,7 +170,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme if (!isSolvent && auged_with->GetItem()->ItemType != EQEmu::item::ItemTypeAugmentationDistiller) { Log(Logs::General, Logs::Error, "Player tried to remove an augment without a solvent or distiller."); - user->Message(13, "Error: Missing an augmentation solvent or distiller for removing this augment."); + user->Message(Chat::Red, "Error: Missing an augmentation solvent or distiller for removing this augment."); return; } @@ -180,7 +180,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme if (!isSolvent && auged_with->GetItem()->ID != aug->GetItem()->AugDistiller) { Log(Logs::General, Logs::Error, "Player tried to safely remove an augment with the wrong distiller (item %u vs expected %u).", auged_with->GetItem()->ID, aug->GetItem()->AugDistiller); - user->Message(13, "Error: Wrong augmentation distiller for safely removing this augment."); + user->Message(Chat::Red, "Error: Wrong augmentation distiller for safely removing this augment."); return; } std::vector args; @@ -266,7 +266,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob if (in_combine->container_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) { if(!worldo) { - user->Message(13, "Error: Server is not aware of the tradeskill container you are attempting to use"); + user->Message(Chat::Red, "Error: Server is not aware of the tradeskill container you are attempting to use"); return; } c_type = worldo->m_type; @@ -291,7 +291,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob } if (!inst || !inst->IsType(EQEmu::item::ItemClassBag)) { - user->Message(13, "Error: Server does not recognize specified tradeskill container"); + user->Message(Chat::Red, "Error: Server does not recognize specified tradeskill container"); return; } @@ -304,12 +304,12 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob user->DeleteItemInInventory(EQEmu::InventoryProfile::CalcSlotId(in_combine->container_slot, 0), 0, true); container->Clear(); user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), EQEmu::invslot::slotCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2)); - user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name); + user->Message_StringID(Chat::LightBlue, TRANSFORM_COMPLETE, inst->GetItem()->Name); if (RuleB(Inventory, DeleteTransformationMold)) user->DeleteItemInInventory(in_combine->container_slot, 0, true); } else if (inst) { - user->Message_StringID(4, TRANSFORM_FAILED, inst->GetItem()->Name); + user->Message_StringID(Chat::LightBlue, TRANSFORM_FAILED, inst->GetItem()->Name); } auto outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0); user->QueuePacket(outapp); @@ -324,10 +324,10 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob user->DeleteItemInInventory(EQEmu::InventoryProfile::CalcSlotId(in_combine->container_slot, 0), 0, true); container->Clear(); user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), EQEmu::invslot::slotCursor, 0, 0); - user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name); + user->Message_StringID(Chat::LightBlue, TRANSFORM_COMPLETE, inst->GetItem()->Name); } else if (inst) { - user->Message_StringID(4, DETRANSFORM_FAILED, inst->GetItem()->Name); + user->Message_StringID(Chat::LightBlue, DETRANSFORM_FAILED, inst->GetItem()->Name); } auto outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0); user->QueuePacket(outapp); @@ -337,7 +337,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob DBTradeskillRecipe_Struct spec; if (!database.GetTradeRecipe(container, c_type, some_id, user->CharacterID(), &spec)) { - user->Message_StringID(MT_Emote,TRADESKILL_NOCOMBINE); + user->Message_StringID(Chat::Emote,TRADESKILL_NOCOMBINE); auto outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0); user->QueuePacket(outapp); safe_delete(outapp); @@ -352,7 +352,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob // bit 6 (0x20): unlisted recipe flag if ((spec.must_learn&0xF) == 1 && !spec.has_learnt) { // Made up message for the client. Just giving a DNC is the other option. - user->Message(4, "You need to learn how to combine these first."); + user->Message(Chat::LightBlue, "You need to learn how to combine these first."); auto outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0); user->QueuePacket(outapp); safe_delete(outapp); @@ -361,7 +361,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob // Character does not have the required skill. if(spec.skill_needed > 0 && user->GetSkill(spec.tradeskill) < spec.skill_needed ) { // Notify client. - user->Message(4, "You are not skilled enough."); + user->Message(Chat::LightBlue, "You are not skilled enough."); auto outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0); user->QueuePacket(outapp); safe_delete(outapp); @@ -371,23 +371,23 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob //changing from a switch to string of if's since we don't need to iterate through all of the skills in the SkillType enum if (spec.tradeskill == EQEmu::skills::SkillAlchemy) { if (user_pp.class_ != SHAMAN) { - user->Message(13, "This tradeskill can only be performed by a shaman."); + user->Message(Chat::Red, "This tradeskill can only be performed by a shaman."); return; } else if (user_pp.level < MIN_LEVEL_ALCHEMY) { - user->Message(13, "You cannot perform alchemy until you reach level %i.", MIN_LEVEL_ALCHEMY); + user->Message(Chat::Red, "You cannot perform alchemy until you reach level %i.", MIN_LEVEL_ALCHEMY); return; } } else if (spec.tradeskill == EQEmu::skills::SkillTinkering) { if (user_pp.race != GNOME) { - user->Message(13, "Only gnomes can tinker."); + user->Message(Chat::Red, "Only gnomes can tinker."); return; } } else if (spec.tradeskill == EQEmu::skills::SkillMakePoison) { if (user_pp.class_ != ROGUE) { - user->Message(13, "Only rogues can mix poisons."); + user->Message(Chat::Red, "Only rogues can mix poisons."); return; } } @@ -422,7 +422,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob // Update Made count if (success) { if (!spec.has_learnt && ((spec.must_learn&0x10) != 0x10)) { - user->Message_StringID(4, TRADESKILL_LEARN_RECIPE, spec.name.c_str()); + user->Message_StringID(Chat::LightBlue, TRADESKILL_LEARN_RECIPE, spec.name.c_str()); } database.UpdateRecipeMadecount(spec.recipe_id, user->CharacterID(), spec.madecount+1); } @@ -469,7 +469,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac // This shouldn't happen. if ((spec.must_learn&0xf) && !spec.has_learnt) { // Made up message for the client. Just giving a DNC is the other option. - user->Message(4, "You need to learn how to combine these first."); + user->Message(Chat::LightBlue, "You need to learn how to combine these first."); user->QueuePacket(outapp); safe_delete(outapp); return; @@ -540,13 +540,13 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac safe_delete(outapp); - user->Message_StringID(MT_Skills, TRADESKILL_MISSING_COMPONENTS); + user->Message_StringID(Chat::Skills, TRADESKILL_MISSING_COMPONENTS); for (auto it = MissingItems.begin(); it != MissingItems.end(); ++it) { const EQEmu::ItemData* item = database.GetItem(*it); if(item) - user->Message_StringID(MT_Skills, TRADESKILL_MISSING_ITEM, item->Name); + user->Message_StringID(Chat::Skills, TRADESKILL_MISSING_ITEM, item->Name); } return; @@ -593,7 +593,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac if (success) { if (!spec.has_learnt && ((spec.must_learn & 0x10) != 0x10)) { - user->Message_StringID(4, TRADESKILL_LEARN_RECIPE, spec.name.c_str()); + user->Message_StringID(Chat::LightBlue, TRADESKILL_LEARN_RECIPE, spec.name.c_str()); } database.UpdateRecipeMadecount(spec.recipe_id, user->CharacterID(), spec.madecount+1); } @@ -951,7 +951,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { // above critical still stands. // Mastery modifier is: 10%/25%/50% for rank one/two/three chance = 95.0f + (float(user_skill - spec->trivial) / 40.0f); - Message_StringID(MT_Emote, TRADESKILL_TRIVIAL); + Message_StringID(Chat::Emote, TRADESKILL_TRIVIAL); } else if(chance < 5) { // Minimum chance is always 5 chance = 5; @@ -978,7 +978,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { if(over_trivial < 0) CheckIncreaseTradeskill(bonusstat, stat_modifier, skillup_modifier, success_modifier, spec->tradeskill); - Message_StringID(4, TRADESKILL_SUCCEED, spec->name.c_str()); + Message_StringID(Chat::LightBlue, TRADESKILL_SUCCEED, spec->name.c_str()); Log(Logs::Detail, Logs::Tradeskills, "Tradeskill success"); @@ -988,7 +988,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { SummonItem(itr->first, itr->second); item = database.GetItem(itr->first); if (this->GetGroup()) { - entity_list.MessageGroup(this, true, MT_Skills, "%s has successfully fashioned %s!", GetName(), item->Name); + entity_list.MessageGroup(this, true, Chat::Skills, "%s has successfully fashioned %s!", GetName(), item->Name); } /* QS: Player_Log_Trade_Skill_Events */ @@ -1010,12 +1010,12 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { if(over_trivial < 0) CheckIncreaseTradeskill(bonusstat, stat_modifier, skillup_modifier, success_modifier, spec->tradeskill); - Message_StringID(MT_Emote,TRADESKILL_FAILED); + Message_StringID(Chat::Emote,TRADESKILL_FAILED); Log(Logs::Detail, Logs::Tradeskills, "Tradeskill failed"); if (this->GetGroup()) { - entity_list.MessageGroup(this,true,MT_Skills,"%s was unsuccessful in %s tradeskill attempt.",GetName(),this->GetGender() == 0 ? "his" : this->GetGender() == 1 ? "her" : "its"); + entity_list.MessageGroup(this, true, Chat::Skills,"%s was unsuccessful in %s tradeskill attempt.",GetName(),this->GetGender() == 0 ? "his" : this->GetGender() == 1 ? "her" : "its"); } @@ -1404,7 +1404,7 @@ void Client::LearnRecipe(uint32 recipeID) if (row[1] != nullptr) return; - Message_StringID(4, TRADESKILL_LEARN_RECIPE, row[0]); + Message_StringID(Chat::LightBlue, TRADESKILL_LEARN_RECIPE, row[0]); // Actually learn the recipe now query = StringFormat("INSERT INTO char_recipe_list " "SET recipe_id = %u, char_id = %u, madecount = 0 " diff --git a/zone/trading.cpp b/zone/trading.cpp index fe9a72daa..80e5dc851 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -102,7 +102,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { EQEmu::ItemInstance* inst = client->GetInv().GetItem(EQEmu::invslot::slotCursor); if (!inst) { - client->Message(13, "Error: Could not find item on your cursor!"); + client->Message(Chat::Red, "Error: Could not find item on your cursor!"); return; } @@ -1110,7 +1110,7 @@ void Client::Trader_EndTrader() { tdis->Unknown000 = 0; tdis->TraderID = Customer->GetID(); tdis->Unknown012 = 0; - Customer->Message(13, "The Trader is no longer open for business"); + Customer->Message(Chat::Red, "The Trader is no longer open for business"); for(int i = 0; i < 80; i++) { if(gis->Items[i] != 0) { @@ -1628,8 +1628,8 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs, Client* Trader, const EQApplic Log(Logs::Detail, Logs::Trading, "Actual quantity that will be traded is %i", outtbs->Quantity); if((tbs->Price * outtbs->Quantity) <= 0) { - Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); - Trader->Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); + Message(Chat::Red, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); + Trader->Message(Chat::Red, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); Log(Logs::General, Logs::Error, "Bazaar: Zero price transaction between %s and %s aborted." "Item: %s, Charges: %i, TBS: Qty %i, Price: %i", GetName(), Trader->GetName(), @@ -1642,7 +1642,7 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs, Client* Trader, const EQApplic uint64 TotalTransactionValue = static_cast(tbs->Price) * static_cast(outtbs->Quantity); if(TotalTransactionValue > MAX_TRANSACTION_VALUE) { - Message(13, "That would exceed the single transaction limit of %u platinum.", MAX_TRANSACTION_VALUE / 1000); + Message(Chat::Red, "That would exceed the single transaction limit of %u platinum.", MAX_TRANSACTION_VALUE / 1000); TradeRequestFailed(app); safe_delete(outapp); return; @@ -1754,7 +1754,7 @@ void Client::SendBazaarWelcome() return; auto row = results.begin(); - Message(10, "There are %i Buyers waiting to purchase your loot. Type /barter to search for them, " + Message(Chat::NPCQuestSay, "There are %i Buyers waiting to purchase your loot. Type /barter to search for them, " "or use /buyer to set up your own Buy Lines.", atoi(row[0])); } @@ -1945,7 +1945,7 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint uint32 ID = 0; if (results.RowCount() == static_cast(RuleI(Bazaar, MaxSearchResults))) - Message(15, "Your search reached the limit of %i results. Please narrow your search down by selecting more options.", + Message(Chat::Yellow, "Your search reached the limit of %i results. Please narrow your search down by selecting more options.", RuleI(Bazaar, MaxSearchResults)); if(results.RowCount() == 0) { @@ -2057,7 +2057,7 @@ static void UpdateTraderCustomerItemsAdded(uint32 CustomerID, TraderCharges_Stru if(!inst) return; - Customer->Message(13, "The Trader has put up %s for sale.", item->Name); + Customer->Message(Chat::Red, "The Trader has put up %s for sale.", item->Name); for(int i = 0; i < 80; i++) { @@ -2105,7 +2105,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St tdis->Unknown000 = 0; tdis->TraderID = Customer->GetID(); tdis->Unknown012 = 0; - Customer->Message(13, "The Trader has withdrawn the %s from sale.", item->Name); + Customer->Message(Chat::Red, "The Trader has withdrawn the %s from sale.", item->Name); for(int i = 0; i < 80; i++) { @@ -2147,7 +2147,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St inst->SetMerchantCount(Charges); // Let the customer know the price in the window has suddenly just changed on them. - Customer->Message(13, "The Trader has changed the price of %s.", item->Name); + Customer->Message(Chat::Red, "The Trader has changed the price of %s.", item->Name); for(int i = 0; i < 80; i++) { if((gis->ItemID[i] != ItemID) || @@ -2286,7 +2286,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { } if(SameItemWithDifferingCharges) - Message(13, "Warning: You have more than one %s with different charges. They have all been added for sale " + Message(Chat::Red, "Warning: You have more than one %s with different charges. They have all been added for sale " "at the same price.", item->Name); } @@ -2333,8 +2333,8 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { tpus->SubAction = BazaarPriceChange_Fail; QueuePacket(app); Trader_EndTrader(); - Message(13, "You must remove the item from sale before you can increase the price while a customer is browsing."); - Message(13, "Click 'Begin Trader' to restart Trader mode with the increased price for this item."); + Message(Chat::Red, "You must remove the item from sale before you can increase the price while a customer is browsing."); + Message(Chat::Red, "Click 'Begin Trader' to restart Trader mode with the increased price for this item."); safe_delete(gis); return; } @@ -2387,11 +2387,11 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) { int numberOfRows = results.RowCount(); if(numberOfRows == RuleI(Bazaar, MaxBarterSearchResults)) - Message(15, "Your search found too many results; some are not displayed."); + Message(Chat::Yellow, "Your search found too many results; some are not displayed."); else if(strlen(searchString) == 0) - Message(10, "There are %i Buy Lines.", numberOfRows); + Message(Chat::NPCQuestSay, "There are %i Buy Lines.", numberOfRows); else - Message(10, "There are %i Buy Lines that match the search string '%s'.", numberOfRows, searchString); + Message(Chat::NPCQuestSay, "There are %i Buy Lines that match the search string '%s'.", numberOfRows, searchString); if(numberOfRows == 0) return; @@ -2466,7 +2466,7 @@ void Client::ShowBuyLines(const EQApplicationPacket *app) { if(!Buyer) { bir->Approval = 0; // Tell the client that the Buyer is unavailable QueuePacket(app); - Message(13, "The Buyer has gone away."); + Message(Chat::Red, "The Buyer has gone away."); return; } @@ -2475,14 +2475,14 @@ void Client::ShowBuyLines(const EQApplicationPacket *app) { QueuePacket(app); if(bir->Approval == 0) { - Message_StringID(clientMessageYellow, TRADER_BUSY); + Message_StringID(Chat::Yellow, TRADER_BUSY); return; } const char *WelcomeMessagePointer = Buyer->GetBuyerWelcomeMessage(); if(strlen(WelcomeMessagePointer) > 0) - Message(10, "%s greets you, '%s'.", Buyer->GetName(), WelcomeMessagePointer); + Message(Chat::NPCQuestSay, "%s greets you, '%s'.", Buyer->GetName(), WelcomeMessagePointer); auto outapp = new EQApplicationPacket(OP_Barter, sizeof(BuyerBrowsing_Struct)); @@ -2563,7 +2563,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { if(!item || !Quantity || !Price || !QtyBuyerWants) return; if (m_inv.HasItem(ItemID, Quantity, invWhereWorn | invWherePersonal | invWhereCursor) == INVALID_INDEX) { - Message(13, "You do not have %i %s on you.", Quantity, item->Name); + Message(Chat::Red, "You do not have %i %s on you.", Quantity, item->Name); return; } @@ -2571,37 +2571,37 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { Client *Buyer = entity_list.GetClientByID(BuyerID); if(!Buyer || !Buyer->IsBuyer()) { - Message(13, "The Buyer has gone away."); + Message(Chat::Red, "The Buyer has gone away."); return; } // For Stackable items, HasSpaceForItem will try check if there is space to stack with existing stacks in // the buyer inventory. if(!(Buyer->GetInv().HasSpaceForItem(item, Quantity))) { - Message(13, "The Buyer does not have space for %i %s", Quantity, item->Name); + Message(Chat::Red, "The Buyer does not have space for %i %s", Quantity, item->Name); return; } if((static_cast(Quantity) * static_cast(Price)) > MAX_TRANSACTION_VALUE) { - Message(13, "That would exceed the single transaction limit of %u platinum.", MAX_TRANSACTION_VALUE / 1000); + Message(Chat::Red, "That would exceed the single transaction limit of %u platinum.", MAX_TRANSACTION_VALUE / 1000); return; } if(!Buyer->HasMoney(Quantity * Price)) { - Message(13, "The Buyer does not have sufficient money to purchase that quantity of %s.", item->Name); - Buyer->Message(13, "%s tried to sell you %i %s, but you have insufficient funds.", GetName(), Quantity, item->Name); + Message(Chat::Red, "The Buyer does not have sufficient money to purchase that quantity of %s.", item->Name); + Buyer->Message(Chat::Red, "%s tried to sell you %i %s, but you have insufficient funds.", GetName(), Quantity, item->Name); return; } if(Buyer->CheckLoreConflict(item)) { - Message(13, "That item is LORE and the Buyer already has one."); - Buyer->Message(13, "%s tried to sell you %s but this item is LORE and you already have one.", + Message(Chat::Red, "That item is LORE and the Buyer already has one."); + Buyer->Message(Chat::Red, "%s tried to sell you %s but this item is LORE and you already have one.", GetName(), item->Name); return; } if(item->NoDrop == 0) { - Message(13, "That item is NODROP."); + Message(Chat::Red, "That item is NODROP."); return; } @@ -2620,7 +2620,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { break; } Log(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); - Message(13, "Internal error while processing transaction."); + Message(Chat::Red, "Internal error while processing transaction."); return; } @@ -2628,7 +2628,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { if(!ItemToTransfer || !Buyer->MoveItemToInventory(ItemToTransfer, true)) { Log(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); - Message(13, "Internal error while processing transaction."); + Message(Chat::Red, "Internal error while processing transaction."); if(ItemToTransfer) safe_delete(ItemToTransfer); @@ -2666,7 +2666,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { if (SellerSlot == INVALID_INDEX) { Log(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); - Message(13, "Internal error while processing transaction."); + Message(Chat::Red, "Internal error while processing transaction."); return; } @@ -2674,7 +2674,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { if(!ItemToTransfer) { Log(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); - Message(13, "Internal error while processing transaction."); + Message(Chat::Red, "Internal error while processing transaction."); return; } @@ -2686,7 +2686,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) { Log(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); - Message(13, "Internal error while processing transaction."); + Message(Chat::Red, "Internal error while processing transaction."); safe_delete(ItemToTransfer); return; } @@ -2721,7 +2721,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) { Log(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); - Message(13, "Internal error while processing transaction."); + Message(Chat::Red, "Internal error while processing transaction."); safe_delete(ItemToTransfer); return; } @@ -2965,19 +2965,19 @@ void Client::UpdateBuyLine(const EQApplicationPacket *app) { } else { if(ItemCount > 0) - Message(13, "Buy line %s disabled as Item Compensation is not currently supported.", ItemName); + Message(Chat::Red, "Buy line %s disabled as Item Compensation is not currently supported.", ItemName); else if(Quantity <= 0) - Message(13, "Buy line %s disabled as the quantity is invalid.", ItemName); + Message(Chat::Red, "Buy line %s disabled as the quantity is invalid.", ItemName); else if(LoreConflict) - Message(13, "Buy line %s disabled as the item is LORE and you have one already.", ItemName); + Message(Chat::Red, "Buy line %s disabled as the item is LORE and you have one already.", ItemName); else if(item->NoDrop == 0) - Message(13, "Buy line %s disabled as the item is NODROP.", ItemName); + Message(Chat::Red, "Buy line %s disabled as the item is NODROP.", ItemName); else if(ToggleOnOff) - Message(13, "Buy line %s disabled due to insufficient funds.", ItemName); + Message(Chat::Red, "Buy line %s disabled due to insufficient funds.", ItemName); else database.RemoveBuyLine(CharacterID(), BuySlot); @@ -3047,7 +3047,7 @@ void Client::BuyerItemSearch(const EQApplicationPacket *app) { break; } if (Count == MAX_BUYER_ITEMSEARCH_RESULTS) - Message(15, "Your search returned more than %i results. Only the first %i are displayed.", + Message(Chat::Yellow, "Your search returned more than %i results. Only the first %i are displayed.", MAX_BUYER_ITEMSEARCH_RESULTS, MAX_BUYER_ITEMSEARCH_RESULTS); bisr->Action = Barter_BuyerSearch; diff --git a/zone/trap.cpp b/zone/trap.cpp index 29314f568..7027f3e28 100644 --- a/zone/trap.cpp +++ b/zone/trap.cpp @@ -373,13 +373,13 @@ void EntityList::GetTrapInfo(Client* client) if (cur->IsTrap()) { bool isset = (cur->chkarea_timer.Enabled() && !cur->reset_timer.Enabled()); - client->Message(CC_Default, " Trap: (%d) found at %0.2f,%0.2f,%0.2f. Times Triggered: %d Is Active: %d Group: %d Message: %s", cur->trap_id, cur->m_Position.x, cur->m_Position.y, cur->m_Position.z, cur->times_triggered, isset, cur->group, cur->message.c_str()); + client->Message(Chat::Default, " Trap: (%d) found at %0.2f,%0.2f,%0.2f. Times Triggered: %d Is Active: %d Group: %d Message: %s", cur->trap_id, cur->m_Position.x, cur->m_Position.y, cur->m_Position.z, cur->times_triggered, isset, cur->group, cur->message.c_str()); ++count; } ++it; } - client->Message(CC_Default, "%d traps found.", count); + client->Message(Chat::Default, "%d traps found.", count); } void EntityList::ClearTrapPointers() diff --git a/zone/tribute.cpp b/zone/tribute.cpp index ce1eb5f6d..a52d5d1d6 100644 --- a/zone/tribute.cpp +++ b/zone/tribute.cpp @@ -93,7 +93,7 @@ void Client::ToggleTribute(bool enabled) { } if(cost > m_pp.tribute_points) { - Message(13, "You do not have enough tribute points to activate your tribute!"); + Message(Chat::Red, "You do not have enough tribute points to activate your tribute!"); ToggleTribute(false); return; } @@ -250,7 +250,7 @@ int32 Client::TributeItem(uint32 slot, uint32 quantity) { pts = mod_tribute_item_value(pts, m_inv[slot]); if(pts < 1) { - Message(13, "This item is worthless for favor."); + Message(Chat::Red, "This item is worthless for favor."); return(0); } @@ -277,7 +277,7 @@ int32 Client::TributeItem(uint32 slot, uint32 quantity) { //returns the number of points received from the tribute int32 Client::TributeMoney(uint32 platinum) { if(!TakeMoneyFromPP(platinum * 1000)) { - Message(13, "You do not have that much money!"); + Message(Chat::Red, "You do not have that much money!"); return(0); } diff --git a/zone/tune.cpp b/zone/tune.cpp index c0510f94a..e4d730abc 100644 --- a/zone/tune.cpp +++ b/zone/tune.cpp @@ -203,11 +203,11 @@ void Mob::Tune_FindACByPctMitigation(Mob* defender, Mob *attacker, float pct_mit Message(0, "#Tune - [WARNING] Mitigation can not be further decreased due to minium hit value (%i).",minhit); if (defender->IsNPC()){ - Message(7, "#Tune - Recommended NPC AC ADJUSTMENT ( %i ) on ' %s ' for an average mitigation of (+ %.0f) pct from attacker ' %s '.",add_ac,defender->GetCleanName(), pct_mitigation, attacker->GetCleanName()); + Message(Chat::LightGray, "#Tune - Recommended NPC AC ADJUSTMENT ( %i ) on ' %s ' for an average mitigation of (+ %.0f) pct from attacker ' %s '.",add_ac,defender->GetCleanName(), pct_mitigation, attacker->GetCleanName()); Message(0, "#SET: [NPC Attack STAT] = [%i]",add_ac + defender->CastToNPC()->GetRawAC()); } if (defender->IsClient()){ - Message(7, "#Tune - Recommended CLIENT AC ADJUSTMENT ( %i ) on ' %s ' for an average mitigation of (+ %.0f) pct from attacker ' %s '.",add_ac,defender->GetCleanName(), pct_mitigation, attacker->GetCleanName()); + Message(Chat::LightGray, "#Tune - Recommended CLIENT AC ADJUSTMENT ( %i ) on ' %s ' for an average mitigation of (+ %.0f) pct from attacker ' %s '.",add_ac,defender->GetCleanName(), pct_mitigation, attacker->GetCleanName()); Message(0, "#Modify (+/-): [Client AC STAT/SE_AC(1)] [%i]",add_ac); } @@ -693,7 +693,7 @@ void Mob::Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_ch tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::invslot::slotPrimary, 0, false, 0, avoid_override, add_acc); if (Msg >= 3) - Message(15, "#Tune - Processing... [%i] [ACCURACY %i] Hit Chance %.2f ",j,add_acc,tmp_hit_chance); + Message(Chat::Yellow, "#Tune - Processing... [%i] [ACCURACY %i] Hit Chance %.2f ",j,add_acc,tmp_hit_chance); if (interval > 0 && tmp_hit_chance >= hit_chance){ end = true; @@ -727,8 +727,8 @@ void Mob::Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_ch add_acc = add_acc + interval; } - Message(7, "#Tune - Error: Unable to find desired result for (%.0f) pct - Increase interval (%i) AND/OR max loop value (%i) and run again.", hit_chance, interval, max_loop); - Message(7, "#Tune - Parse ended at ACCURACY ADJUSTMENTT ( %i ) at hit chance of (%.0f) / (%.0f) pct.",add_acc,tmp_hit_chance / hit_chance); + Message(Chat::LightGray, "#Tune - Error: Unable to find desired result for (%.0f) pct - Increase interval (%i) AND/OR max loop value (%i) and run again.", hit_chance, interval, max_loop); + Message(Chat::LightGray, "#Tune - Parse ended at ACCURACY ADJUSTMENTT ( %i ) at hit chance of (%.0f) / (%.0f) pct.",add_acc,tmp_hit_chance / hit_chance); } void Mob::Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_chance, int interval, int max_loop, int acc_override, int Msg) diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index ffe777808..6493188bf 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -211,7 +211,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) else if (scm->queued == 2) // tell queue was full client->Tell_StringID(QUEUE_TELL_FULL, scm->to, scm->message); else if (scm->queued == 3) // person was offline - client->Message_StringID(MT_TellEcho, TOLD_NOT_ONLINE, scm->to); + client->Message_StringID(Chat::EchoTell, TOLD_NOT_ONLINE, scm->to); else // normal tell echo "You told Soanso, 'something'" // tell echo doesn't use language, so it looks normal to you even if nobody can understand your tells client->ChannelMessageSend(scm->from, scm->to, scm->chan_num, 0, 100, scm->message); @@ -374,15 +374,15 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) switch (ztz->response) { case -2: { - entity->CastToClient()->Message(13, "You do not own the required locations to enter this zone."); + entity->CastToClient()->Message(Chat::Red, "You do not own the required locations to enter this zone."); break; } case -1: { - entity->CastToClient()->Message(13, "The zone is currently full, please try again later."); + entity->CastToClient()->Message(Chat::Red, "The zone is currently full, please try again later."); break; } case 0: { - entity->CastToClient()->Message(13, "All zone servers are taken at this time, please try again later."); + entity->CastToClient()->Message(Chat::Red, "All zone servers are taken at this time, please try again later."); break; } } @@ -414,7 +414,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) Client* client = entity_list.GetClientByID(wars->id); if (client) { if (pack->size == 64)//no results - client->Message_StringID(0, WHOALL_NO_RESULTS); + client->Message_StringID(Chat::White, WHOALL_NO_RESULTS); else { auto outapp = new EQApplicationPacket(OP_WhoAllResponse, pack->size); memcpy(outapp->pBuffer, pack->pBuffer, pack->size); @@ -783,7 +783,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) Client* c = entity_list.GetClientByName(Rezzer); if (c) - c->Message_StringID(MT_WornOff, REZZ_ALREADY_PENDING); + c->Message_StringID(Chat::SpellWornOff, REZZ_ALREADY_PENDING); break; } @@ -910,7 +910,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) entity_list.AddGroup(group); if (group->GetID() == 0) { - Inviter->Message(13, "Unable to get new group id. Cannot create group."); + Inviter->Message(Chat::Red, "Unable to get new group id. Cannot create group."); break; } @@ -1485,7 +1485,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) ServerOP_Consent_Struct* s = (ServerOP_Consent_Struct*)pack->pBuffer; Client* client = entity_list.GetClientByName(s->ownername); if (client) { - client->Message_StringID(0, s->message_string_id); + client->Message_StringID(Chat::White, s->message_string_id); } break; } @@ -1729,7 +1729,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) if (c) { c->ClearPendingAdventureDoorClick(); - c->Message_StringID(13, 5141); + c->Message_StringID(Chat::Red, 5141); } break; } @@ -1751,7 +1751,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) if (c) { c->ClearPendingAdventureLeave(); - c->Message(13, "You cannot leave this adventure at this time."); + c->Message(Chat::Red, "You cannot leave this adventure at this time."); } break; } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index e2825da5a..7c90bcc11 100755 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -3061,10 +3061,10 @@ bool ZoneDatabase::SaveMerc(Merc *merc) { auto results = database.QueryDatabase(query); if(!results.Success()) { - owner->Message(13, results.ErrorMessage().c_str()); + owner->Message(Chat::Red, results.ErrorMessage().c_str()); return false; } else if (results.RowsAffected() != 1) { - owner->Message(13, "Unable to save merc to the database."); + owner->Message(Chat::Red, "Unable to save merc to the database."); return false; } @@ -3095,10 +3095,10 @@ bool ZoneDatabase::SaveMerc(Merc *merc) { auto results = database.QueryDatabase(query); if (!results.Success()) { - owner->Message(13, results.ErrorMessage().c_str()); + owner->Message(Chat::Red, results.ErrorMessage().c_str()); return false; } else if (results.RowsAffected() != 1) { - owner->Message(13, "Unable to save merc to the database."); + owner->Message(Chat::Red, "Unable to save merc to the database."); return false; } diff --git a/zone/zoning.cpp b/zone/zoning.cpp index dbe9346b7..869ef4eb4 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -96,7 +96,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //that can be a valid un-zolicited zone request? //Todo cheat detection - Message(13, "Invalid unsolicited zone request."); + Message(Chat::Red, "Invalid unsolicited zone request."); Log(Logs::General, Logs::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); SendZoneCancel(zc); return; @@ -142,14 +142,14 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //make sure we are in it and it's unexpired. if(!database.VerifyInstanceAlive(target_instance_id, CharacterID())) { - Message(13, "Instance ID was expired or you were not in it."); + Message(Chat::Red, "Instance ID was expired or you were not in it."); SendZoneCancel(zc); return; } if(!database.VerifyZoneInstance(target_zone_id, target_instance_id)) { - Message(13, "Instance ID was %u does not go with zone id %u", target_instance_id, target_zone_id); + Message(Chat::Red, "Instance ID was %u does not go with zone id %u", target_instance_id, target_zone_id); SendZoneCancel(zc); return; } @@ -159,7 +159,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { const char *target_zone_name = database.GetZoneName(target_zone_id); if(target_zone_name == nullptr) { //invalid zone... - Message(13, "Invalid target zone ID."); + Message(Chat::Red, "Invalid target zone ID."); Log(Logs::General, Logs::Error, "Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id); SendZoneCancel(zc); return; @@ -172,7 +172,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { char flag_needed[128]; if(!database.GetSafePoints(target_zone_name, database.GetInstanceVersion(target_instance_id), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) { //invalid zone... - Message(13, "Invalid target zone while getting safe points."); + Message(Chat::Red, "Invalid target zone while getting safe points."); Log(Logs::General, Logs::Error, "Zoning %s: Unable to get safe coordinates for zone '%s'.", GetName(), target_zone_name); SendZoneCancel(zc); return; @@ -277,7 +277,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //the flag needed string is not empty, meaning a flag is required. if(Admin() < minStatusToIgnoreZoneFlags && !HasZoneFlag(target_zone_id)) { - Message(13, "You do not have the flag to enter %s.", target_zone_name); + Message(Chat::Red, "You do not have the flag to enter %s.", target_zone_name); myerror = ZONE_ERROR_NOEXPERIENCE; } } @@ -453,7 +453,7 @@ void Client::ProcessMovePC(uint32 zoneID, uint32 instance_id, float x, float y, ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm); break; case GMSummon: - Message(15, "You have been summoned by a GM!"); + Message(Chat::Yellow, "You have been summoned by a GM!"); ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm); break; case ZoneToBindPoint: @@ -463,11 +463,11 @@ void Client::ProcessMovePC(uint32 zoneID, uint32 instance_id, float x, float y, ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm); break; case SummonPC: - Message(15, "You have been summoned!"); + Message(Chat::Yellow, "You have been summoned!"); ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm); break; case Rewind: - Message(15, "Rewinding to previous location."); + Message(Chat::Yellow, "Rewinding to previous location."); ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm); break; default: @@ -486,7 +486,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z database.GetZoneLongName(pShortZoneName, &pZoneName); if(!pZoneName) { - Message(13, "Invalid zone number specified"); + Message(Chat::Red, "Invalid zone number specified"); safe_delete_array(pZoneName); return; } @@ -560,7 +560,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z Entity* entity = entity_list.GetID(entity_id_being_looted); if (entity == 0) { - Message(13, "Error: OP_EndLootRequest: Corpse not found (ent = 0)"); + Message(Chat::Red, "Error: OP_EndLootRequest: Corpse not found (ent = 0)"); if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD) Corpse::SendEndLootErrorPacket(this); else @@ -568,7 +568,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z } else if (!entity->IsCorpse()) { - Message(13, "Error: OP_EndLootRequest: Corpse not found (!entity->IsCorpse())"); + Message(Chat::Red, "Error: OP_EndLootRequest: Corpse not found (!entity->IsCorpse())"); Corpse::SendLootReqErrorPacket(this); } else @@ -723,7 +723,7 @@ void Client::Gate(uint8 bindnum) { } void NPC::Gate(uint8 bindnum) { - entity_list.MessageClose_StringID(this, true, RuleI(Range, SpellMessages), MT_Spells, GATES, GetCleanName()); + entity_list.MessageClose_StringID(this, true, RuleI(Range, SpellMessages), Chat::Spells, GATES, GetCleanName()); Mob::Gate(bindnum); } From 9f25c9070c1aec1b197099f73b6e1b0ed1094371 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 11 Aug 2019 00:14:02 -0500 Subject: [PATCH 2/7] Refactor message functions --- utils/deprecated/perlxs/mob.h | 2 +- zone/aa.cpp | 8 +- zone/attack.cpp | 98 ++++++------- zone/aura.cpp | 4 +- zone/bot.cpp | 8 +- zone/bot_command.cpp | 6 +- zone/client.cpp | 108 +++++++------- zone/client.h | 8 +- zone/client_packet.cpp | 230 +++++++++++++++--------------- zone/client_process.cpp | 53 +++---- zone/corpse.cpp | 12 +- zone/doors.cpp | 14 +- zone/effects.cpp | 20 +-- zone/entity.cpp | 256 +++++++++++++++++++++++++++------- zone/entity.h | 37 ++++- zone/exp.cpp | 40 +++--- zone/forage.cpp | 36 ++--- zone/groups.cpp | 4 +- zone/groups.h | 2 +- zone/inventory.cpp | 4 +- zone/lua_mob.cpp | 7 +- zone/lua_mob.h | 2 +- zone/merc.cpp | 4 +- zone/mob.cpp | 28 ++-- zone/mob.h | 8 +- zone/mob_ai.cpp | 32 +++-- zone/npc.cpp | 8 +- zone/oldcode.cpp | 2 +- zone/perl_mob.cpp | 2 +- zone/raids.cpp | 4 +- zone/raids.h | 2 +- zone/special_attacks.cpp | 32 +++-- zone/spell_effects.cpp | 74 ++++++---- zone/spells.cpp | 198 +++++++++++++------------- zone/tradeskills.cpp | 26 ++-- zone/trading.cpp | 2 +- zone/worldserver.cpp | 10 +- zone/zoning.cpp | 2 +- 38 files changed, 814 insertions(+), 579 deletions(-) diff --git a/utils/deprecated/perlxs/mob.h b/utils/deprecated/perlxs/mob.h index 0485e299d..7dc85b2a3 100644 --- a/utils/deprecated/perlxs/mob.h +++ b/utils/deprecated/perlxs/mob.h @@ -130,7 +130,7 @@ int32 GetFollowID(); virtual void Message(int32 type, const char* message, ...); - virtual void Message_StringID(int32 type, int32 string_id, int32 distance = 0); + virtual void MessageString(int32 type, int32 string_id, int32 distance = 0); void Say(const char *format, ...); void Shout(const char *format, ...); void Emote(const char *format, ...); diff --git a/zone/aa.cpp b/zone/aa.cpp index 5696bd445..1712dd7a0 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1091,7 +1091,7 @@ void Client::FinishAlternateAdvancementPurchase(AA::Rank *rank, bool ignore_cost SendAlternateAdvancementStats(); if(rank->prev) { - Message_StringID(Chat::Yellow, AA_IMPROVE, + MessageString(Chat::Yellow, AA_IMPROVE, std::to_string(rank->title_sid).c_str(), std::to_string(rank->prev->current_value).c_str(), std::to_string(cost).c_str(), @@ -1104,7 +1104,7 @@ void Client::FinishAlternateAdvancementPurchase(AA::Rank *rank, bool ignore_cost } } else { - Message_StringID(Chat::Yellow, AA_GAIN_ABILITY, + MessageString(Chat::Yellow, AA_GAIN_ABILITY, std::to_string(rank->title_sid).c_str(), std::to_string(cost).c_str(), cost == 1 ? std::to_string(AA_POINT).c_str() : std::to_string(AA_POINTS).c_str()); @@ -1200,7 +1200,7 @@ void Client::ActivateAlternateAdvancementAbility(int rank_id, int target_id) { CommonBreakInvisible(); if (spells[rank->spell].sneak && (!hidden || (hidden && (Timer::GetCurrentTime() - tmHidden) < 4000))) { - Message_StringID(Chat::SpellFailure, SNEAK_RESTRICT); + MessageString(Chat::SpellFailure, SNEAK_RESTRICT); return; } // @@ -1214,7 +1214,7 @@ void Client::ActivateAlternateAdvancementAbility(int rank_id, int target_id) { SetAppearance(eaStanding, false); if (GetAppearance() != eaStanding) { - Message_StringID(Chat::SpellFailure, STAND_TO_CAST); + MessageString(Chat::SpellFailure, STAND_TO_CAST); return; } } diff --git a/zone/attack.cpp b/zone/attack.cpp index d555e4458..58a661969 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1319,7 +1319,7 @@ void Mob::DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts) if (other->AvoidDamage(this, hit)) { int strike_through = itembonuses.StrikeThrough + spellbonuses.StrikeThrough + aabonuses.StrikeThrough; if (strike_through && zone->random.Roll(strike_through)) { - Message_StringID(Chat::StrikeThrough, + MessageString(Chat::StrikeThrough, STRIKETHROUGH_STRING); // You strike through your opponents defenses! hit.damage_done = 1; // set to one, we will check this to continue } @@ -1340,9 +1340,9 @@ void Mob::DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts) int stun_resist2 = other->spellbonuses.FrontalStunResist + other->itembonuses.FrontalStunResist + other->aabonuses.FrontalStunResist; int stun_resist = other->spellbonuses.StunResist + other->itembonuses.StunResist + other->aabonuses.StunResist; if (zone->random.Roll(stun_resist2)) { - other->Message_StringID(Chat::Stun, AVOID_STUNNING_BLOW); + other->MessageString(Chat::Stun, AVOID_STUNNING_BLOW); } else if (zone->random.Roll(stun_resist)) { - other->Message_StringID(Chat::Stun, SHAKE_OFF_STUN); + other->MessageString(Chat::Stun, SHAKE_OFF_STUN); } else { other->Stun(3000); // yuck -- 3 seconds } @@ -1392,7 +1392,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if (DivineAura() && !GetGM()) {//cant attack while invulnerable unless your a gm Log(Logs::Detail, Logs::Combat, "Attack canceled, Divine Aura is in effect."); - Message_StringID(Chat::DefaultText, DIVINE_AURA_NO_ATK); //You can't attack while invulnerable! + MessageString(Chat::DefaultText, DIVINE_AURA_NO_ATK); //You can't attack while invulnerable! return false; } @@ -1615,7 +1615,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, EQEmu::skills::Sk if (killerMob && killerMob->IsClient() && (spell != SPELL_UNKNOWN) && damage > 0) { char val1[20] = { 0 }; - entity_list.MessageClose_StringID( + entity_list.MessageCloseString( this, /* Sender */ false, /* Skip Sender */ RuleI(Range, DamageMessages), @@ -1624,7 +1624,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, EQEmu::skills::Sk killerMob->GetCleanName(), /* Message1 */ GetCleanName(), /* Message2 */ ConvertArray(damage, val1)/* Message3 */ - ); + ); } int exploss = 0; @@ -2129,7 +2129,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, EQEmu::skills::Skill { if (IsLDoNTrapped()) { - Message_StringID(Chat::Red, LDON_ACCIDENT_SETOFF2); + MessageString(Chat::Red, LDON_ACCIDENT_SETOFF2); SpellFinished(GetLDoNTrapSpellID(), other, EQEmu::spells::CastingSlot::Item, 0, -1, spells[GetLDoNTrapSpellID()].ResistDiff, false); SetLDoNTrapSpellID(0); SetLDoNTrapped(false); @@ -2169,7 +2169,7 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQEmu::skills::Skil if (killer_mob->IsClient() && (spell != SPELL_UNKNOWN) && damage > 0) { char val1[20] = { 0 }; - entity_list.MessageClose_StringID( + entity_list.MessageCloseString( this, /* Sender */ false, /* Skip Sender */ RuleI(Range, DamageMessages), @@ -2178,7 +2178,7 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQEmu::skills::Skil killer_mob->GetCleanName(), /* Message1 */ GetCleanName(), /* Message2 */ ConvertArray(damage, val1) /* Message3 */ - ); + ); } } else { @@ -3439,7 +3439,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const Log(Logs::Detail, Logs::Aggro, "Sending pet %s into battle due to attack.", pet->GetName()); pet->AddToHateList(attacker, 1, 0, true, false, false, spell_id); pet->SetTarget(attacker); - Message_StringID(Chat::NPCQuestSay, PET_ATTACKING, pet->GetCleanName(), attacker->GetCleanName()); + MessageString(Chat::NPCQuestSay, PET_ATTACKING, pet->GetCleanName(), attacker->GetCleanName()); } } @@ -3507,7 +3507,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const //fade mez if we are mezzed if (IsMezzed() && attacker) { Log(Logs::Detail, Logs::Combat, "Breaking mez due to attack."); - entity_list.MessageClose_StringID( + entity_list.MessageCloseString( this, /* Sender */ true, /* Skip Sender */ RuleI(Range, SpellMessages), @@ -3515,7 +3515,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const HAS_BEEN_AWAKENED, // %1 has been awakened by %2. GetCleanName(), /* Message1 */ attacker->GetCleanName() /* Message2 */ - ); + ); BuffFadeByEffect(SE_Mez); } @@ -3564,13 +3564,13 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const else { // stun resist passed! if (IsClient()) - Message_StringID(Chat::Stun, SHAKE_OFF_STUN); + MessageString(Chat::Stun, SHAKE_OFF_STUN); } } else { // stun resist 2 passed! if (IsClient()) - Message_StringID(Chat::Stun, AVOID_STUNNING_BLOW); + MessageString(Chat::Stun, AVOID_STUNNING_BLOW); } } else { @@ -3650,7 +3650,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const if (((spell_id != SPELL_UNKNOWN) || (FromDamageShield)) && damage>0) { //special crap for spell damage, looks hackish to me char val1[20] = { 0 }; - owner->Message_StringID(Chat::NonMelee, OTHER_HIT_NONMELEE, GetCleanName(), ConvertArray(damage, val1)); + owner->MessageString(Chat::NonMelee, OTHER_HIT_NONMELEE, GetCleanName(), ConvertArray(damage, val1)); } else { if (damage > 0) { @@ -3680,10 +3680,10 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const char val1[20] = { 0 }; if (FromDamageShield) { if (attacker->CastToClient()->GetFilter(FilterDamageShields) != FilterHide) - attacker->Message_StringID(Chat::DamageShield, OTHER_HIT_NONMELEE, GetCleanName(), ConvertArray(damage, val1)); + attacker->MessageString(Chat::DamageShield, OTHER_HIT_NONMELEE, GetCleanName(), ConvertArray(damage, val1)); } else { - entity_list.MessageClose_StringID( + entity_list.MessageCloseString( this, /* Sender */ true, /* Skip Sender */ RuleI(Range, SpellMessages), @@ -3692,7 +3692,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const attacker->GetCleanName(), /* Message1 */ GetCleanName(), /* Message2 */ ConvertArray(damage, val1) /* Message3 */ - ); + ); } } else { @@ -3754,11 +3754,11 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const // So we can see our dot dmg like live shows it. if (spell_id != SPELL_UNKNOWN && damage > 0 && attacker && attacker != this && attacker->IsClient()) { //might filter on (attack_skill>200 && attack_skill<250), but I dont think we need it - attacker->FilteredMessage_StringID(attacker, Chat::DotDamage, FilterDOT, + attacker->FilteredMessageString(attacker, Chat::DotDamage, FilterDOT, YOUR_HIT_DOT, GetCleanName(), itoa(damage), spells[spell_id].name); /* older clients don't have the below String ID, but it will be filtered */ - entity_list.FilteredMessageClose_StringID( + entity_list.FilteredMessageCloseString( attacker, /* Sender */ true, /* Skip Sender */ RuleI(Range, SpellMessages), @@ -3792,37 +3792,37 @@ void Mob::HealDamage(uint32 amount, Mob *caster, uint16 spell_id) // message to caster if (caster->IsClient() && caster == this) { if (caster->CastToClient()->ClientVersionBit() & EQEmu::versions::maskSoFAndLater) - FilteredMessage_StringID(caster, Chat::NonMelee, FilterHealOverTime, + FilteredMessageString(caster, Chat::NonMelee, FilterHealOverTime, HOT_HEAL_SELF, itoa(acthealed), spells[spell_id].name); else - FilteredMessage_StringID(caster, Chat::NonMelee, FilterHealOverTime, + FilteredMessageString(caster, Chat::NonMelee, FilterHealOverTime, YOU_HEALED, GetCleanName(), itoa(acthealed)); } else if (caster->IsClient() && caster != this) { if (caster->CastToClient()->ClientVersionBit() & EQEmu::versions::maskSoFAndLater) - caster->FilteredMessage_StringID(caster, Chat::NonMelee, FilterHealOverTime, + caster->FilteredMessageString(caster, Chat::NonMelee, FilterHealOverTime, HOT_HEAL_OTHER, GetCleanName(), itoa(acthealed), spells[spell_id].name); else - caster->FilteredMessage_StringID(caster, Chat::NonMelee, FilterHealOverTime, + caster->FilteredMessageString(caster, Chat::NonMelee, FilterHealOverTime, YOU_HEAL, GetCleanName(), itoa(acthealed)); } // message to target if (IsClient() && caster != this) { if (CastToClient()->ClientVersionBit() & EQEmu::versions::maskSoFAndLater) - FilteredMessage_StringID(this, Chat::NonMelee, FilterHealOverTime, + FilteredMessageString(this, Chat::NonMelee, FilterHealOverTime, HOT_HEALED_OTHER, caster->GetCleanName(), itoa(acthealed), spells[spell_id].name); else - FilteredMessage_StringID(this, Chat::NonMelee, FilterHealOverTime, + FilteredMessageString(this, Chat::NonMelee, FilterHealOverTime, YOU_HEALED, caster->GetCleanName(), itoa(acthealed)); } } else { // normal heals - FilteredMessage_StringID(caster, Chat::NonMelee, FilterSpellDamage, + FilteredMessageString(caster, Chat::NonMelee, FilterSpellDamage, YOU_HEALED, caster->GetCleanName(), itoa(acthealed)); if (caster != this) - caster->FilteredMessage_StringID(caster, Chat::NonMelee, FilterSpellDamage, + caster->FilteredMessageString(caster, Chat::NonMelee, FilterSpellDamage, YOU_HEAL, GetCleanName(), itoa(acthealed)); } } @@ -3993,10 +3993,10 @@ void Mob::TryWeaponProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData * if (IsPet()) { Mob *own = GetOwner(); if (own) - own->Message_StringID(Chat::Red, PROC_PETTOOLOW); + own->MessageString(Chat::Red, PROC_PETTOOLOW); } else { - Message_StringID(Chat::Red, PROC_TOOLOW); + MessageString(Chat::Red, PROC_TOOLOW); } } else { @@ -4030,10 +4030,10 @@ void Mob::TryWeaponProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData * if (IsPet()) { Mob *own = GetOwner(); if (own) - own->Message_StringID(Chat::Red, PROC_PETTOOLOW); + own->MessageString(Chat::Red, PROC_PETTOOLOW); } else { - Message_StringID(Chat::Red, PROC_TOOLOW); + MessageString(Chat::Red, PROC_TOOLOW); } } else { @@ -4183,7 +4183,7 @@ void Mob::TryPetCriticalHit(Mob *defender, DamageHitInfo &hit) hit.damage_done += 5; hit.damage_done = (hit.damage_done * critMod) / 100; - entity_list.FilteredMessageClose_StringID( + entity_list.FilteredMessageCloseString( this, /* Sender */ false, /* Skip Sender */ RuleI(Range, CriticalDamage), @@ -4192,7 +4192,7 @@ void Mob::TryPetCriticalHit(Mob *defender, DamageHitInfo &hit) CRITICAL_HIT, /* MessageFormat: %1 scores a critical hit! (%2) */ GetCleanName(), /* Message1 */ itoa(hit.damage_done + hit.min_damage) /* Message2 */ - ); + ); } } @@ -4243,7 +4243,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions * /* Female */ if (GetGender() == 1) { - entity_list.FilteredMessageClose_StringID( + entity_list.FilteredMessageCloseString( this, /* Sender */ false, /* Skip Sender */ RuleI(Range, CriticalDamage), @@ -4252,11 +4252,11 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions * FEMALE_SLAYUNDEAD, /* MessageFormat: %1's holy blade cleanses her target!(%2) */ GetCleanName(), /* Message1 */ itoa(hit.damage_done + hit.min_damage) /* Message2 */ - ); + ); } /* Males and Neuter */ else { - entity_list.FilteredMessageClose_StringID( + entity_list.FilteredMessageCloseString( this, /* Sender */ false, /* Skip Sender */ RuleI(Range, CriticalDamage), @@ -4265,7 +4265,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions * MALE_SLAYUNDEAD, /* MessageFormat: %1's holy blade cleanses his target!(%2) */ GetCleanName(), /* Message1 */ itoa(hit.damage_done + hit.min_damage) /* Message2 */ - ); + ); } return; } @@ -4340,7 +4340,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions * } hit.damage_done = hit.damage_done * 200 / 100; - entity_list.FilteredMessageClose_StringID( + entity_list.FilteredMessageCloseString( this, /* Sender */ false, /* Skip Sender */ RuleI(Range, CriticalDamage), @@ -4349,7 +4349,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions * DEADLY_STRIKE, /* MessageFormat: %1 scores a Deadly Strike!(%2) */ GetCleanName(), /* Message1 */ itoa(hit.damage_done + hit.min_damage) /* Message2 */ - ); + ); return; } } @@ -4368,7 +4368,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions * hit.damage_done += og_damage * 119 / 100; Log(Logs::Detail, Logs::Combat, "Crip damage %d", hit.damage_done); - entity_list.FilteredMessageClose_StringID( + entity_list.FilteredMessageCloseString( this, /* Sender */ false, /* Skip Sender */ RuleI(Range, CriticalDamage), @@ -4377,7 +4377,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions * CRIPPLING_BLOW, /* MessageFormat: %1 lands a Crippling Blow!(%2) */ GetCleanName(), /* Message1 */ itoa(hit.damage_done + hit.min_damage) /* Message2 */ - ); + ); // Crippling blows also have a chance to stun // Kayen: Crippling Blow would cause a chance to interrupt for npcs < 55, with a @@ -4390,7 +4390,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions * } /* Normal Critical hit message */ - entity_list.FilteredMessageClose_StringID( + entity_list.FilteredMessageCloseString( this, /* Sender */ false, /* Skip Sender */ RuleI(Range, CriticalDamage), @@ -4399,7 +4399,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions * CRITICAL_HIT, /* MessageFormat: %1 scores a critical hit! (%2) */ GetCleanName(), /* Message1 */ itoa(hit.damage_done + hit.min_damage) /* Message2 */ - ); + ); } } } @@ -4427,7 +4427,7 @@ bool Mob::TryFinishingBlow(Mob *defender, int &damage) (ProcChance >= zone->random.Int(1, 1000))) { /* Finishing Blow Critical Message */ - entity_list.FilteredMessageClose_StringID( + entity_list.FilteredMessageCloseString( this, /* Sender */ false, /* Skip Sender */ RuleI(Range, CriticalDamage), @@ -4435,7 +4435,7 @@ bool Mob::TryFinishingBlow(Mob *defender, int &damage) FilterMeleeCrits, /* FilterType: 12 */ FINISHING_BLOW, /* MessageFormat: %1 scores a Finishing Blow!!) */ GetCleanName() /* Message1 */ - ); + ); damage = FB_Dmg; return true; @@ -4453,7 +4453,7 @@ void Mob::DoRiposte(Mob *defender) // so ahhh the angle you can riposte is larger than the angle you can hit :P if (!defender->IsFacingMob(this)) { - defender->Message_StringID(Chat::TooFarAway, CANT_SEE_TARGET); + defender->MessageString(Chat::TooFarAway, CANT_SEE_TARGET); return; } @@ -5042,7 +5042,7 @@ void Mob::CommonOutgoingHitSuccess(Mob* defender, DamageHitInfo &hit, ExtraAttac else if (GetClass() == RANGER && GetLevel() > 50) { // no double dmg on headshot if ((defender->IsNPC() && !defender->IsMoving() && !defender->IsRooted()) || !RuleB(Combat, ArcheryBonusRequiresStationary)) { hit.damage_done *= 2; - Message_StringID(Chat::MeleeCrit, BOW_DOUBLE_DAMAGE); + MessageString(Chat::MeleeCrit, BOW_DOUBLE_DAMAGE); } } } @@ -5347,7 +5347,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell) Attack(target, hand, false, false, IsFromSpell); if (zone->random.Roll(flurrychance)) Attack(target, hand, false, false, IsFromSpell); - Message_StringID(Chat::NPCFlurry, YOU_FLURRY); + MessageString(Chat::NPCFlurry, YOU_FLURRY); } } } diff --git a/zone/aura.cpp b/zone/aura.cpp index 223b5dcb4..adedb3f56 100644 --- a/zone/aura.cpp +++ b/zone/aura.cpp @@ -841,10 +841,10 @@ void Mob::AddTrap(Aura *aura, AuraRecord &record) bool Mob::CanSpawnAura(bool trap) { if (trap && !HasFreeTrapSlots()) { - Message_StringID(Chat::SpellFailure, NO_MORE_TRAPS); + MessageString(Chat::SpellFailure, NO_MORE_TRAPS); return false; } else if (!trap && !HasFreeAuraSlots()) { - Message_StringID(Chat::SpellFailure, NO_MORE_AURAS); + MessageString(Chat::SpellFailure, NO_MORE_AURAS); return false; } diff --git a/zone/bot.cpp b/zone/bot.cpp index 7265492aa..daef58a9a 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -2808,7 +2808,7 @@ void Bot::AI_Process() { int32 flurrychance = (aabonuses.FlurryChance + spellbonuses.FlurryChance + itembonuses.FlurryChance); if (flurrychance) { if (zone->random.Int(0, 100) < flurrychance) { - Message_StringID(Chat::NPCFlurry, YOU_FLURRY); + MessageString(Chat::NPCFlurry, YOU_FLURRY); Attack(tar, EQEmu::invslot::slotPrimary, false); TEST_TARGET(); @@ -6444,11 +6444,11 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, EQEmu::spells::CastingSlo if(!IsValidSpell(spell_id) || casting_spell_id || delaytimer || spellend_timer.Enabled() || IsStunned() || IsFeared() || IsMezzed() || (IsSilenced() && !IsDiscipline(spell_id)) || (IsAmnesiad() && IsDiscipline(spell_id))) { Log(Logs::Detail, Logs::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d", IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced() ); if(IsSilenced() && !IsDiscipline(spell_id)) - Message_StringID(Chat::Red, SILENCED_STRING); + MessageString(Chat::Red, SILENCED_STRING); if(IsAmnesiad() && IsDiscipline(spell_id)) - Message_StringID(Chat::Red, MELEE_SILENCE); + MessageString(Chat::Red, MELEE_SILENCE); if(casting_spell_id) AI_Event_SpellCastFinished(false, static_cast(casting_spell_slot)); @@ -6458,7 +6458,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, EQEmu::spells::CastingSlo } if(IsDetrimentalSpell(spell_id) && !zone->CanDoCombat()){ - Message_StringID(Chat::Red, SPELL_WOULDNT_HOLD); + MessageString(Chat::Red, SPELL_WOULDNT_HOLD); if(casting_spell_id) AI_Event_SpellCastFinished(false, static_cast(casting_spell_slot)); diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index da17b78d8..90d694004 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -7284,7 +7284,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) int ab_mask = (ActionableBots::ABM_Target | ActionableBots::ABM_ByName); if (c->GetTradeskillObject() || (c->trade->state == Trading)) { - c->Message_StringID(Chat::Tell, MERCHANT_BUSY); + c->MessageString(Chat::Tell, MERCHANT_BUSY); return; } @@ -7310,7 +7310,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) itm = itminst->GetItem(); if (itminst && itm && c->CheckLoreConflict(itm)) { - c->Message_StringID(Chat::WhiteSmoke, PICK_LORE); + c->MessageString(Chat::WhiteSmoke, PICK_LORE); return; } @@ -7324,7 +7324,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) if (!c->CheckLoreConflict(itma->GetItem())) continue; - c->Message_StringID(Chat::WhiteSmoke, PICK_LORE); + c->MessageString(Chat::WhiteSmoke, PICK_LORE); return; } diff --git a/zone/client.cpp b/zone/client.cpp index 18385fe30..dfee9a340 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -914,7 +914,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s { case ChatChannel_Guild: { /* Guild Chat */ if (!IsInAGuild()) - Message_StringID(Chat::DefaultText, GUILD_NOT_MEMBER2); //You are not a member of any guild. + MessageString(Chat::DefaultText, GUILD_NOT_MEMBER2); //You are not a member of any guild. else if (!guild_mgr.CheckPermission(GuildID(), GuildRank(), GUILD_SPEAK)) Message(0, "Error: You dont have permission to speak to the guild."); else if (!worldserver.SendChannelMessage(this, targetname, chan_num, GuildID(), language, lang_skill, message)) @@ -1509,7 +1509,7 @@ void Client::IncreaseLanguageSkill(int skill_id, int value) { QueuePacket(outapp); safe_delete(outapp); - Message_StringID( Chat::Skills, LANG_SKILL_IMPROVED ); //Notify client + MessageString( Chat::Skills, LANG_SKILL_IMPROVED ); //Notify client } void Client::AddSkill(EQEmu::skills::SkillType skillid, uint16 value) { @@ -2578,7 +2578,7 @@ void Client::SetPVP(bool toggle, bool message) { if (message) { if(GetPVP()) - this->Message_StringID(Chat::Shout,PVP_ON); + this->MessageString(Chat::Shout,PVP_ON); else Message(Chat::Red, "You no longer follow the ways of discord."); } @@ -2714,22 +2714,22 @@ void Client::Disarm(Client* disarmer, int chance) { if (matslot != EQEmu::textures::materialInvalid) SendWearChange(matslot); } - Message_StringID(Chat::Skills, DISARMED); + MessageString(Chat::Skills, DISARMED); if (disarmer != this) - disarmer->Message_StringID(Chat::Skills, DISARM_SUCCESS, this->GetCleanName()); + disarmer->MessageString(Chat::Skills, DISARM_SUCCESS, this->GetCleanName()); if (chance != 1000) disarmer->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 4); CalcBonuses(); // CalcEnduranceWeightFactor(); return; } - disarmer->Message_StringID(Chat::Skills, DISARM_FAILED); + disarmer->MessageString(Chat::Skills, DISARM_FAILED); if (chance != 1000) disarmer->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 2); return; } } - disarmer->Message_StringID(Chat::Skills, DISARM_FAILED); + disarmer->MessageString(Chat::Skills, DISARM_FAILED); } bool Client::BindWound(Mob *bindmob, bool start, bool fail) @@ -2771,7 +2771,7 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail) } else { // send bindmob "stand still" if (!bindmob->IsAIControlled() && bindmob != this) { - bindmob->CastToClient()->Message_StringID(Chat::Yellow, + bindmob->CastToClient()->MessageString(Chat::Yellow, YOU_ARE_BEING_BANDAGED); } else if (bindmob->IsAIControlled() && bindmob != this) { ; // Tell IPC to stand still? @@ -3075,7 +3075,7 @@ void Client::ServerFilter(SetServerFilter_Struct* filter){ } // this version is for messages with no parameters -void Client::Message_StringID(uint32 type, uint32 string_id, uint32 distance) +void Client::MessageString(uint32 type, uint32 string_id, uint32 distance) { if (GetFilter(FilterSpellDamage) == FilterHide && type == Chat::NonMelee) return; @@ -3103,7 +3103,7 @@ void Client::Message_StringID(uint32 type, uint32 string_id, uint32 distance) // to load the eqstr file and count them in the string. // This hack sucks but it's gonna work for now. // -void Client::Message_StringID(uint32 type, uint32 string_id, const char* message1, +void Client::MessageString(uint32 type, uint32 string_id, const char* message1, const char* message2,const char* message3,const char* message4, const char* message5,const char* message6,const char* message7, const char* message8,const char* message9, uint32 distance) @@ -3126,7 +3126,7 @@ void Client::Message_StringID(uint32 type, uint32 string_id, const char* message if(!message1) { - Message_StringID(type, string_id); // use the simple message instead + MessageString(type, string_id); // use the simple message instead return; } @@ -3205,7 +3205,7 @@ bool Client::FilteredMessageCheck(Mob *sender, eqFilterType filter) return true; } -void Client::FilteredMessage_StringID(Mob *sender, uint32 type, +void Client::FilteredMessageString(Mob *sender, uint32 type, eqFilterType filter, uint32 string_id) { if (!FilteredMessageCheck(sender, filter)) @@ -3224,7 +3224,7 @@ void Client::FilteredMessage_StringID(Mob *sender, uint32 type, return; } -void Client::FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType filter, uint32 string_id, +void Client::FilteredMessageString(Mob *sender, uint32 type, eqFilterType filter, uint32 string_id, const char *message1, const char *message2, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9) @@ -3240,7 +3240,7 @@ void Client::FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType fil type = 4; if (!message1) { - FilteredMessage_StringID(sender, type, filter, string_id); // use the simple message instead + FilteredMessageString(sender, type, filter, string_id); // use the simple message instead return; } @@ -3281,7 +3281,7 @@ void Client::Tell_StringID(uint32 string_id, const char *who, const char *messag char string_id_str[10]; snprintf(string_id_str, 10, "%d", string_id); - Message_StringID(Chat::EchoTell, TELL_QUEUED_MESSAGE, who, string_id_str, message); + MessageString(Chat::EchoTell, TELL_QUEUED_MESSAGE, who, string_id_str, message); } void Client::SetTint(int16 in_slot, uint32 color) { @@ -3344,7 +3344,7 @@ void Client::SetLanguageSkill(int langid, int value) QueuePacket(outapp); safe_delete(outapp); - Message_StringID( Chat::Skills, LANG_SKILL_IMPROVED ); //Notify the client + MessageString( Chat::Skills, LANG_SKILL_IMPROVED ); //Notify the client } void Client::LinkDead() @@ -3432,7 +3432,7 @@ void Client::Escape() entity_list.RemoveFromTargets(this, true); SetInvisible(1); - Message_StringID(Chat::Skills, ESCAPE); + MessageString(Chat::Skills, ESCAPE); } float Client::CalcPriceMod(Mob* other, bool reverse) @@ -3872,13 +3872,13 @@ void Client::SacrificeConfirm(Client *caster) } if (GetLevel() < RuleI(Spells, SacrificeMinLevel)) { - caster->Message_StringID(Chat::Red, SAC_TOO_LOW); // This being is not a worthy sacrifice. + caster->MessageString(Chat::Red, SAC_TOO_LOW); // This being is not a worthy sacrifice. safe_delete(outapp); return; } if (GetLevel() > RuleI(Spells, SacrificeMaxLevel)) { - caster->Message_StringID(Chat::Red, SAC_TOO_HIGH); + caster->MessageString(Chat::Red, SAC_TOO_HIGH); safe_delete(outapp); return; } @@ -3947,7 +3947,7 @@ void Client::Sacrifice(Client *caster) caster->SummonItem(RuleI(Spells, SacrificeItemID)); } } else { - caster->Message_StringID(Chat::Red, SAC_TOO_LOW); // This being is not a worthy sacrifice. + caster->MessageString(Chat::Red, SAC_TOO_LOW); // This being is not a worthy sacrifice. } } @@ -4932,7 +4932,7 @@ void Client::HandleLDoNOpen(NPC *target) { if(target->GetLDoNTrapSpellID() != 0) { - Message_StringID(Chat::Red, LDON_ACCIDENT_SETOFF2); + MessageString(Chat::Red, LDON_ACCIDENT_SETOFF2); target->SpellFinished(target->GetLDoNTrapSpellID(), this, EQEmu::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].ResistDiff); target->SetLDoNTrapSpellID(0); target->SetLDoNTrapped(false); @@ -4948,7 +4948,7 @@ void Client::HandleLDoNOpen(NPC *target) if(target->IsLDoNLocked()) { - Message_StringID(Chat::Skills, LDON_STILL_LOCKED, target->GetCleanName()); + MessageString(Chat::Skills, LDON_STILL_LOCKED, target->GetCleanName()); return; } else @@ -4982,13 +4982,13 @@ void Client::HandleLDoNSenseTraps(NPC *target, uint16 skill, uint8 type) { if((target->GetLDoNTrapType() == LDoNTypeCursed || target->GetLDoNTrapType() == LDoNTypeMagical) && type != target->GetLDoNTrapType()) { - Message_StringID(Chat::Skills, LDON_CANT_DETERMINE_TRAP, target->GetCleanName()); + MessageString(Chat::Skills, LDON_CANT_DETERMINE_TRAP, target->GetCleanName()); return; } if(target->IsLDoNTrapDetected()) { - Message_StringID(Chat::Skills, LDON_CERTAIN_TRAP, target->GetCleanName()); + MessageString(Chat::Skills, LDON_CERTAIN_TRAP, target->GetCleanName()); } else { @@ -4997,10 +4997,10 @@ void Client::HandleLDoNSenseTraps(NPC *target, uint16 skill, uint8 type) { case -1: case 0: - Message_StringID(Chat::Skills, LDON_DONT_KNOW_TRAPPED, target->GetCleanName()); + MessageString(Chat::Skills, LDON_DONT_KNOW_TRAPPED, target->GetCleanName()); break; case 1: - Message_StringID(Chat::Skills, LDON_CERTAIN_TRAP, target->GetCleanName()); + MessageString(Chat::Skills, LDON_CERTAIN_TRAP, target->GetCleanName()); target->SetLDoNTrapDetected(true); break; default: @@ -5010,7 +5010,7 @@ void Client::HandleLDoNSenseTraps(NPC *target, uint16 skill, uint8 type) } else { - Message_StringID(Chat::Skills, LDON_CERTAIN_NOT_TRAP, target->GetCleanName()); + MessageString(Chat::Skills, LDON_CERTAIN_NOT_TRAP, target->GetCleanName()); } } } @@ -5023,13 +5023,13 @@ void Client::HandleLDoNDisarm(NPC *target, uint16 skill, uint8 type) { if(!target->IsLDoNTrapped()) { - Message_StringID(Chat::Skills, LDON_WAS_NOT_TRAPPED, target->GetCleanName()); + MessageString(Chat::Skills, LDON_WAS_NOT_TRAPPED, target->GetCleanName()); return; } if((target->GetLDoNTrapType() == LDoNTypeCursed || target->GetLDoNTrapType() == LDoNTypeMagical) && type != target->GetLDoNTrapType()) { - Message_StringID(Chat::Skills, LDON_HAVE_NOT_DISARMED, target->GetCleanName()); + MessageString(Chat::Skills, LDON_HAVE_NOT_DISARMED, target->GetCleanName()); return; } @@ -5048,13 +5048,13 @@ void Client::HandleLDoNDisarm(NPC *target, uint16 skill, uint8 type) target->SetLDoNTrapDetected(false); target->SetLDoNTrapped(false); target->SetLDoNTrapSpellID(0); - Message_StringID(Chat::Skills, LDON_HAVE_DISARMED, target->GetCleanName()); + MessageString(Chat::Skills, LDON_HAVE_DISARMED, target->GetCleanName()); break; case 0: - Message_StringID(Chat::Skills, LDON_HAVE_NOT_DISARMED, target->GetCleanName()); + MessageString(Chat::Skills, LDON_HAVE_NOT_DISARMED, target->GetCleanName()); break; case -1: - Message_StringID(Chat::Red, LDON_ACCIDENT_SETOFF2); + MessageString(Chat::Red, LDON_ACCIDENT_SETOFF2); target->SpellFinished(target->GetLDoNTrapSpellID(), this, EQEmu::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].ResistDiff); target->SetLDoNTrapSpellID(0); target->SetLDoNTrapped(false); @@ -5073,7 +5073,7 @@ void Client::HandleLDoNPickLock(NPC *target, uint16 skill, uint8 type) { if(target->IsLDoNTrapped()) { - Message_StringID(Chat::Red, LDON_ACCIDENT_SETOFF2); + MessageString(Chat::Red, LDON_ACCIDENT_SETOFF2); target->SpellFinished(target->GetLDoNTrapSpellID(), this, EQEmu::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].ResistDiff); target->SetLDoNTrapSpellID(0); target->SetLDoNTrapped(false); @@ -5082,7 +5082,7 @@ void Client::HandleLDoNPickLock(NPC *target, uint16 skill, uint8 type) if(!target->IsLDoNLocked()) { - Message_StringID(Chat::Skills, LDON_WAS_NOT_LOCKED, target->GetCleanName()); + MessageString(Chat::Skills, LDON_WAS_NOT_LOCKED, target->GetCleanName()); return; } @@ -5098,11 +5098,11 @@ void Client::HandleLDoNPickLock(NPC *target, uint16 skill, uint8 type) { case 0: case -1: - Message_StringID(Chat::Skills, LDON_PICKLOCK_FAILURE, target->GetCleanName()); + MessageString(Chat::Skills, LDON_PICKLOCK_FAILURE, target->GetCleanName()); break; case 1: target->SetLDoNLocked(false); - Message_StringID(Chat::Skills, LDON_PICKLOCK_SUCCESS, target->GetCleanName()); + MessageString(Chat::Skills, LDON_PICKLOCK_SUCCESS, target->GetCleanName()); break; } } @@ -5607,7 +5607,7 @@ void Client::SuspendMinion() CurrentPet->SetMana(m_suspendedminion.Mana); - Message_StringID(Chat::Magenta, SUSPEND_MINION_UNSUSPEND, CurrentPet->GetCleanName()); + MessageString(Chat::Magenta, SUSPEND_MINION_UNSUSPEND, CurrentPet->GetCleanName()); memset(&m_suspendedminion, 0, sizeof(struct PetInfo)); // TODO: These pet command states need to be synced ... @@ -5637,19 +5637,19 @@ void Client::SuspendMinion() { if(m_suspendedminion.SpellID > 0) { - Message_StringID(Chat::Red,ONLY_ONE_PET); + MessageString(Chat::Red,ONLY_ONE_PET); return; } else if(CurrentPet->IsEngaged()) { - Message_StringID(Chat::Red,SUSPEND_MINION_FIGHTING); + MessageString(Chat::Red,SUSPEND_MINION_FIGHTING); return; } else if(entity_list.Fighting(CurrentPet)) { - Message_StringID(Chat::Blue,SUSPEND_MINION_HAS_AGGRO); + MessageString(Chat::Blue,SUSPEND_MINION_HAS_AGGRO); } else { @@ -5666,7 +5666,7 @@ void Client::SuspendMinion() else strn0cpy(m_suspendedminion.Name, CurrentPet->GetName(), 64); // Name stays even at rank 1 - Message_StringID(Chat::Magenta, SUSPEND_MINION_SUSPEND, CurrentPet->GetCleanName()); + MessageString(Chat::Magenta, SUSPEND_MINION_SUSPEND, CurrentPet->GetCleanName()); CurrentPet->Depop(false); @@ -5675,7 +5675,7 @@ void Client::SuspendMinion() } else { - Message_StringID(Chat::Red, ONLY_SUMMONED_PETS); + MessageString(Chat::Red, ONLY_SUMMONED_PETS); return; } @@ -6149,16 +6149,16 @@ void Client::LocateCorpse() if(ClosestCorpse) { - Message_StringID(Chat::Spells, SENSE_CORPSE_DIRECTION); + MessageString(Chat::Spells, SENSE_CORPSE_DIRECTION); SetHeading(CalculateHeadingToTarget(ClosestCorpse->GetX(), ClosestCorpse->GetY())); SetTarget(ClosestCorpse); SendTargetCommand(ClosestCorpse->GetID()); SentPositionPacket(0.0f, 0.0f, 0.0f, 0.0f, 0, true); } else if(!GetTarget()) - Message_StringID(Chat::Red, SENSE_CORPSE_NONE); + MessageString(Chat::Red, SENSE_CORPSE_NONE); else - Message_StringID(Chat::Red, SENSE_CORPSE_NOT_NAME); + MessageString(Chat::Red, SENSE_CORPSE_NOT_NAME); } void Client::NPCSpawn(NPC *target_npc, const char *identifier, uint32 extra) @@ -6218,7 +6218,7 @@ void Client::DragCorpses() if (!corpse || !corpse->IsPlayerCorpse() || corpse->CastToCorpse()->IsBeingLooted() || !corpse->CastToCorpse()->Summon(this, false, false)) { - Message_StringID(Chat::DefaultText, CORPSEDRAG_STOP); + MessageString(Chat::DefaultText, CORPSEDRAG_STOP); It = DraggedCorpses.erase(It); if (It == DraggedCorpses.end()) break; @@ -7623,7 +7623,7 @@ void Client::DuplicateLoreMessage(uint32 ItemID) { if (!(m_ClientVersionBit & EQEmu::versions::maskRoFAndLater)) { - Message_StringID(Chat::White, PICK_LORE); + MessageString(Chat::White, PICK_LORE); return; } @@ -7632,7 +7632,7 @@ void Client::DuplicateLoreMessage(uint32 ItemID) if(!item) return; - Message_StringID(Chat::White, PICK_LORE, item->Name); + MessageString(Chat::White, PICK_LORE, item->Name); } void Client::GarbleMessage(char *message, uint8 variance) @@ -8031,13 +8031,13 @@ void Client::SendFactionMessage(int32 tmpvalue, int32 faction_id, int32 faction_ if (tmpvalue == 0 || temp == 1 || temp == 2) return; else if (faction_value >= this_faction_max) - Message_StringID(Chat::Yellow, FACTION_BEST, name); + MessageString(Chat::Yellow, FACTION_BEST, name); else if (faction_value <= this_faction_min) - Message_StringID(Chat::Yellow, FACTION_WORST, name); + MessageString(Chat::Yellow, FACTION_WORST, name); else if (tmpvalue > 0 && faction_value < this_faction_max && !RuleB(Client, UseLiveFactionMessage)) - Message_StringID(Chat::Yellow, FACTION_BETTER, name); + MessageString(Chat::Yellow, FACTION_BETTER, name); else if (tmpvalue < 0 && faction_value > this_faction_min && !RuleB(Client, UseLiveFactionMessage)) - Message_StringID(Chat::Yellow, FACTION_WORSE, name); + MessageString(Chat::Yellow, FACTION_WORSE, name); else if (RuleB(Client, UseLiveFactionMessage)) Message(Chat::Yellow, "Your faction standing with %s has been adjusted by %i.", name, tmpvalue); //New Live faction message (14261) @@ -8365,7 +8365,7 @@ void Client::Consume(const EQEmu::ItemData *item, uint8 type, int16 slot, bool a DeleteItemInInventory(slot, 1, false); if (!auto_consume) // no message if the client consumed for us - entity_list.MessageClose_StringID(this, true, 50, 0, EATING_MESSAGE, GetName(), item->Name); + entity_list.MessageCloseString(this, true, 50, 0, EATING_MESSAGE, GetName(), item->Name); Log(Logs::General, Logs::Food, "Eating from slot: %i", (int)slot); @@ -8383,7 +8383,7 @@ void Client::Consume(const EQEmu::ItemData *item, uint8 type, int16 slot, bool a increase, m_pp.thirst_level); if (!auto_consume) // no message if the client consumed for us - entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name); + entity_list.MessageCloseString(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name); Log(Logs::General, Logs::Food, "Drinking from slot: %i", (int)slot); } diff --git a/zone/client.h b/zone/client.h index c22f18419..bb80e7ffc 100644 --- a/zone/client.h +++ b/zone/client.h @@ -278,11 +278,11 @@ public: void SendBazaarWelcome(); void DyeArmor(EQEmu::TintProfile* dye); uint8 SlotConvert(uint8 slot,bool bracer=false); - void Message_StringID(uint32 type, uint32 string_id, uint32 distance = 0); - void Message_StringID(uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0); + void MessageString(uint32 type, uint32 string_id, uint32 distance = 0); + void MessageString(uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0); bool FilteredMessageCheck(Mob *sender, eqFilterType filter); - void FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType filter, uint32 string_id); - void FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType filter, + void FilteredMessageString(Mob *sender, uint32 type, eqFilterType filter, uint32 string_id); + void FilteredMessageString(Mob *sender, uint32 type, eqFilterType filter, uint32 string_id, const char *message1, const char *message2 = nullptr, const char *message3 = nullptr, const char *message4 = nullptr, const char *message5 = nullptr, const char *message6 = nullptr, diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index cf0633033..67c766597 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -1752,14 +1752,14 @@ void Client::Handle_OP_AAAction(const EQApplicationPacket *app) } else if (action->action == aaActionDisableEXP) { //Turn Off AA Exp if (m_epp.perAA > 0) - Message_StringID(Chat::White, AA_OFF); + MessageString(Chat::White, AA_OFF); m_epp.perAA = 0; SendAlternateAdvancementStats(); } else if (action->action == aaActionSetEXP) { if (m_epp.perAA == 0) - Message_StringID(Chat::White, AA_ON); + MessageString(Chat::White, AA_ON); m_epp.perAA = action->exp_value; if (m_epp.perAA < 0 || m_epp.perAA > 100) m_epp.perAA = 0; // stop exploit with sanity check @@ -2834,7 +2834,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) if (poison->Proc.Level2 > GetLevel()) { // Poison is too high to apply. - Message_StringID(Chat::LightBlue, POISON_TOO_HIGH); + MessageString(Chat::LightBlue, POISON_TOO_HIGH); } else if ((primary && primary->ItemType == EQEmu::item::ItemType1HPiercing) || @@ -4023,7 +4023,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) return; } if (IsAIControlled()) { - this->Message_StringID(Chat::Red, NOT_IN_CONTROL); + this->MessageString(Chat::Red, NOT_IN_CONTROL); //Message(Chat::Red, "You cant cast right now, you arent in control of yourself!"); return; } @@ -4625,7 +4625,7 @@ void Client::Handle_OP_Consent(const EQApplicationPacket *app) safe_delete(pack); } else { - Message_StringID(Chat::White, CONSENT_YOURSELF); + MessageString(Chat::White, CONSENT_YOURSELF); } } return; @@ -4765,10 +4765,10 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app) // this could be done better, but this is only called when you con so w/e // Shroud of Stealth has a special message if (improved_hidden && (!tmob->see_improved_hide && (tmob->see_invis || tmob->see_hide))) - Message_StringID(Chat::NPCQuestSay, SOS_KEEPS_HIDDEN); + MessageString(Chat::NPCQuestSay, SOS_KEEPS_HIDDEN); // we are trying to hide but they can see us else if ((invisible || invisible_undead || hidden || invisible_animals) && !IsInvisible(tmob)) - Message_StringID(Chat::NPCQuestSay, SUSPECT_SEES_YOU); + MessageString(Chat::NPCQuestSay, SUSPECT_SEES_YOU); safe_delete(outapp); @@ -4791,10 +4791,10 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app) min = (ttime / 60000) % 60; // Total seconds / 60 drop .00 char val1[20] = { 0 }; char val2[20] = { 0 }; - Message_StringID(Chat::NPCQuestSay, CORPSE_DECAY1, ConvertArray(min, val1), ConvertArray(sec, val2)); + MessageString(Chat::NPCQuestSay, CORPSE_DECAY1, ConvertArray(min, val1), ConvertArray(sec, val2)); } else { - Message_StringID(Chat::NPCQuestSay, CORPSE_DECAY_NOW); + MessageString(Chat::NPCQuestSay, CORPSE_DECAY_NOW); } } else if (tcorpse && tcorpse->IsPlayerCorpse()) { @@ -4825,12 +4825,12 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app) Message(0, "This corpse can be resurrected for %i minutes and %i seconds.", min, sec); } else { - Message_StringID(Chat::WhiteSmoke, CORPSE_TOO_OLD); + MessageString(Chat::WhiteSmoke, CORPSE_TOO_OLD); } */ } else { - Message_StringID(Chat::NPCQuestSay, CORPSE_DECAY_NOW); + MessageString(Chat::NPCQuestSay, CORPSE_DECAY_NOW); } } } @@ -4932,7 +4932,7 @@ void Client::Handle_OP_ControlBoat(const EQApplicationPacket *app) boat->SetTarget(this); } else { - this->Message_StringID(Chat::Red, IN_USE); + this->MessageString(Chat::Red, IN_USE); return; } } @@ -4950,7 +4950,7 @@ void Client::Handle_OP_CorpseDrag(const EQApplicationPacket *app) { if (DraggedCorpses.size() >= (unsigned int)RuleI(Character, MaxDraggedCorpses)) { - Message_StringID(Chat::Red, CORPSEDRAG_LIMIT); + MessageString(Chat::Red, CORPSEDRAG_LIMIT); return; } @@ -4968,9 +4968,9 @@ void Client::Handle_OP_CorpseDrag(const EQApplicationPacket *app) if (c) { if (c == this) - Message_StringID(Chat::DefaultText, CORPSEDRAG_ALREADY, corpse->GetCleanName()); + MessageString(Chat::DefaultText, CORPSEDRAG_ALREADY, corpse->GetCleanName()); else - Message_StringID(Chat::DefaultText, CORPSEDRAG_SOMEONE_ELSE, corpse->GetCleanName()); + MessageString(Chat::DefaultText, CORPSEDRAG_SOMEONE_ELSE, corpse->GetCleanName()); return; } @@ -4980,14 +4980,14 @@ void Client::Handle_OP_CorpseDrag(const EQApplicationPacket *app) DraggedCorpses.push_back(std::pair(cds->CorpseName, corpse->GetID())); - Message_StringID(Chat::DefaultText, CORPSEDRAG_BEGIN, cds->CorpseName); + MessageString(Chat::DefaultText, CORPSEDRAG_BEGIN, cds->CorpseName); } void Client::Handle_OP_CorpseDrop(const EQApplicationPacket *app) { if (app->size == 1) { - Message_StringID(Chat::DefaultText, CORPSEDRAG_STOPALL); + MessageString(Chat::DefaultText, CORPSEDRAG_STOPALL); ClearDraggedCorpses(); return; } @@ -4996,7 +4996,7 @@ void Client::Handle_OP_CorpseDrop(const EQApplicationPacket *app) { if (!strcasecmp(Iterator->first.c_str(), (const char *)app->pBuffer)) { - Message_StringID(Chat::DefaultText, CORPSEDRAG_STOP); + MessageString(Chat::DefaultText, CORPSEDRAG_STOP); Iterator = DraggedCorpses.erase(Iterator); return; } @@ -5168,7 +5168,7 @@ void Client::Handle_OP_DeleteItem(const EQApplicationPacket *app) DeleteItem_Struct* alc = (DeleteItem_Struct*)app->pBuffer; const EQEmu::ItemInstance *inst = GetInv().GetItem(alc->from_slot); if (inst && inst->GetItem()->ItemType == EQEmu::item::ItemTypeAlcohol) { - entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), inst->GetItem()->Name); + entity_list.MessageCloseString(this, true, 50, 0, DRINKING_MESSAGE, GetName(), inst->GetItem()->Name); CheckIncreaseSkill(EQEmu::skills::SkillAlcoholTolerance, nullptr, 25); int16 AlcoholTolerance = GetSkill(EQEmu::skills::SkillAlcoholTolerance); @@ -5300,7 +5300,7 @@ void Client::Handle_OP_Disarm(const EQApplicationPacket *app) { return; } // Trying to disarm something we can't disarm - Message_StringID(Chat::Skills, DISARM_NO_TARGET); + MessageString(Chat::Skills, DISARM_NO_TARGET); return; } @@ -5358,14 +5358,14 @@ void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app) if ((zone->random.Int(0, 49) + uskill) >= (zone->random.Int(0, 49) + trap->skill)) { success = SKILLUP_SUCCESS; - Message_StringID(Chat::Skills, DISARMED_TRAP); + MessageString(Chat::Skills, DISARMED_TRAP); trap->disarmed = true; Log(Logs::General, Logs::Traps, "Trap %d is disarmed.", trap->trap_id); trap->UpdateTrap(); } else { - Message_StringID(Chat::Skills, FAIL_DISARM_DETECTED_TRAP); + MessageString(Chat::Skills, FAIL_DISARM_DETECTED_TRAP); if (zone->random.Int(0, 99) < 25) { trap->Trigger(this); } @@ -5375,12 +5375,12 @@ void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app) } else { - Message_StringID(Chat::Skills, TRAP_TOO_FAR); + MessageString(Chat::Skills, TRAP_TOO_FAR); } } else { - Message_StringID(Chat::Skills, LDON_SENSE_TRAP2); + MessageString(Chat::Skills, LDON_SENSE_TRAP2); } return; @@ -5464,9 +5464,9 @@ void Client::Handle_OP_DuelResponse(const EQApplicationPacket *app) initiator->CastToClient()->SetDuelTarget(0); initiator->CastToClient()->SetDueling(false); if (GetID() == initiator->GetID()) - entity->CastToClient()->Message_StringID(Chat::NPCQuestSay, DUEL_DECLINE, initiator->GetName()); + entity->CastToClient()->MessageString(Chat::NPCQuestSay, DUEL_DECLINE, initiator->GetName()); else - initiator->CastToClient()->Message_StringID(Chat::NPCQuestSay, DUEL_DECLINE, entity->GetName()); + initiator->CastToClient()->MessageString(Chat::NPCQuestSay, DUEL_DECLINE, entity->GetName()); return; } @@ -5690,7 +5690,7 @@ void Client::Handle_OP_FaceChange(const EQApplicationPacket *app) m_pp.drakkin_tattoo = fc->drakkin_tattoo; m_pp.drakkin_details = fc->drakkin_details; Save(); - Message_StringID(Chat::Red, FACE_ACCEPTED); + MessageString(Chat::Red, FACE_ACCEPTED); //Message(Chat::Red, "Facial features updated."); return; } @@ -5727,7 +5727,7 @@ void Client::Handle_OP_FeignDeath(const EQApplicationPacket *app) uint16 totalfeign = primfeign + secfeign; if (zone->random.Real(0, 160) > totalfeign) { SetFeigned(false); - entity_list.MessageClose_StringID(this, false, 200, 10, STRING_FEIGNFAILED, GetName()); + entity_list.MessageCloseString(this, false, 200, 10, STRING_FEIGNFAILED, GetName()); } else { SetFeigned(true); @@ -5929,7 +5929,7 @@ void Client::Handle_OP_GMBecomeNPC(const EQApplicationPacket *app) cli->SendAppearancePacket(AT_NPCName, 1, true); cli->CastToClient()->SetBecomeNPC(true); cli->CastToClient()->SetBecomeNPCLevel(bnpc->maxlevel); - cli->Message_StringID(Chat::White, TOGGLE_OFF); + cli->MessageString(Chat::White, TOGGLE_OFF); cli->CastToClient()->tellsoff = true; //TODO: Make this toggle a BecomeNPC flag so that it gets updated when people zone in as well; Make combat work with this. return; @@ -6336,13 +6336,13 @@ void Client::Handle_OP_GMToggle(const EQApplicationPacket *app) } GMToggle_Struct *ts = (GMToggle_Struct *)app->pBuffer; if (ts->toggle == 0) { - this->Message_StringID(Chat::White, TOGGLE_OFF); + this->MessageString(Chat::White, TOGGLE_OFF); //Message(0, "Turning tells OFF"); tellsoff = true; } else if (ts->toggle == 1) { //Message(0, "Turning tells ON"); - this->Message_StringID(Chat::White, TOGGLE_ON); + this->MessageString(Chat::White, TOGGLE_ON); tellsoff = false; } else { @@ -6736,7 +6736,7 @@ void Client::Handle_OP_GroupInvite2(const EQApplicationPacket *app) if (Invitee == this) { - Message_StringID(Chat::LightGray, GROUP_INVITEE_SELF); + MessageString(Chat::LightGray, GROUP_INVITEE_SELF); return; } @@ -6974,7 +6974,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { if (GuildBanks->IsAreaFull(GuildID(), GuildBankMainArea)) { - Message_StringID(Chat::Red, GUILD_BANK_FULL); + MessageString(Chat::Red, GUILD_BANK_FULL); GuildBankDepositAck(true, sentAction); @@ -6991,7 +6991,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) if (inst) { - Message_StringID(Chat::LightGray, GUILD_BANK_TRANSFERRED, inst->GetItem()->Name); + MessageString(Chat::LightGray, GUILD_BANK_TRANSFERRED, inst->GetItem()->Name); safe_delete(inst); } } @@ -7023,7 +7023,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { if (GuildBanks->IsAreaFull(GuildID(), GuildBankDepositArea)) { - Message_StringID(Chat::Red, GUILD_BANK_FULL); + MessageString(Chat::Red, GUILD_BANK_FULL); GuildBankDepositAck(true, sentAction); @@ -7068,7 +7068,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) if (!Allowed) { - Message_StringID(Chat::Red, GUILD_BANK_CANNOT_DEPOSIT); + MessageString(Chat::Red, GUILD_BANK_CANNOT_DEPOSIT); GuildBankDepositAck(true, sentAction); return; @@ -7101,7 +7101,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { if (GetInv()[EQEmu::invslot::slotCursor]) { - Message_StringID(Chat::Red, GUILD_BANK_EMPTY_HANDS); + MessageString(Chat::Red, GUILD_BANK_EMPTY_HANDS); GuildBankAck(); @@ -7132,7 +7132,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) if (CheckLoreConflict(inst->GetItem())) { - Message_StringID(Chat::Red, DUP_LORE); + MessageString(Chat::Red, DUP_LORE); GuildBankAck(); @@ -7164,7 +7164,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) case GuildBankSplitStacks: { if (GuildBanks->IsAreaFull(GuildID(), GuildBankMainArea)) - Message_StringID(Chat::Red, GUILD_BANK_FULL); + MessageString(Chat::Red, GUILD_BANK_FULL); else { GuildBankWithdrawItem_Struct *gbwis = (GuildBankWithdrawItem_Struct*)app->pBuffer; @@ -7257,7 +7257,7 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) if (guild_mgr.GetGuildIDByName(GuildName) != GUILD_NONE) { - Message_StringID(Chat::Red, GUILD_NAME_IN_USE); + MessageString(Chat::Red, GUILD_NAME_IN_USE); return; } @@ -7897,7 +7897,7 @@ void Client::Handle_OP_GuildStatus(const EQApplicationPacket *app) if (!c) { - Message_StringID(Chat::LightGray, TARGET_PLAYER_FOR_GUILD_STATUS); + MessageString(Chat::LightGray, TARGET_PLAYER_FOR_GUILD_STATUS); return; } @@ -7905,7 +7905,7 @@ void Client::Handle_OP_GuildStatus(const EQApplicationPacket *app) if (TargetGuildID == GUILD_NONE) { - Message_StringID(Chat::LightGray, NOT_IN_A_GUILD, c->GetName()); + MessageString(Chat::LightGray, NOT_IN_A_GUILD, c->GetName()); return; } @@ -7920,21 +7920,21 @@ void Client::Handle_OP_GuildStatus(const EQApplicationPacket *app) if ((TargetGuildID == GuildID()) && (c != this)) { if (IsLeader) - Message_StringID(Chat::LightGray, LEADER_OF_YOUR_GUILD, c->GetName()); + MessageString(Chat::LightGray, LEADER_OF_YOUR_GUILD, c->GetName()); else if (IsOfficer) - Message_StringID(Chat::LightGray, OFFICER_OF_YOUR_GUILD, c->GetName()); + MessageString(Chat::LightGray, OFFICER_OF_YOUR_GUILD, c->GetName()); else - Message_StringID(Chat::LightGray, MEMBER_OF_YOUR_GUILD, c->GetName()); + MessageString(Chat::LightGray, MEMBER_OF_YOUR_GUILD, c->GetName()); return; } if (IsLeader) - Message_StringID(Chat::LightGray, LEADER_OF_X_GUILD, c->GetName(), GuildName); + MessageString(Chat::LightGray, LEADER_OF_X_GUILD, c->GetName(), GuildName); else if (IsOfficer) - Message_StringID(Chat::LightGray, OFFICER_OF_X_GUILD, c->GetName(), GuildName); + MessageString(Chat::LightGray, OFFICER_OF_X_GUILD, c->GetName(), GuildName); else - Message_StringID(Chat::LightGray, MEMBER_OF_X_GUILD, c->GetName(), GuildName); + MessageString(Chat::LightGray, MEMBER_OF_X_GUILD, c->GetName(), GuildName); } void Client::Handle_OP_GuildUpdateURLAndChannel(const EQApplicationPacket *app) @@ -8537,7 +8537,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) if (IsAIControlled()) { - this->Message_StringID(Chat::Red, NOT_IN_CONTROL); + this->MessageString(Chat::Red, NOT_IN_CONTROL); return; } @@ -8646,7 +8646,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) if (inst->GetCharges() == 0) { //Message(0, "This item is out of charges."); - Message_StringID(Chat::Red, ITEM_OUT_OF_CHARGES); + MessageString(Chat::Red, ITEM_OUT_OF_CHARGES); return; } if (GetLevel() >= item->Click.Level2) @@ -8666,7 +8666,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } else { - Message_StringID(Chat::Red, ITEMS_INSUFFICIENT_LEVEL); + MessageString(Chat::Red, ITEMS_INSUFFICIENT_LEVEL); return; } } @@ -8675,7 +8675,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) if (clickaug->GetCharges() == 0) { //Message(0, "This item is out of charges."); - Message_StringID(Chat::Red, ITEM_OUT_OF_CHARGES); + MessageString(Chat::Red, ITEM_OUT_OF_CHARGES); return; } if (GetLevel() >= augitem->Click.Level2) @@ -8695,7 +8695,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } else { - Message_StringID(Chat::Red, ITEMS_INSUFFICIENT_LEVEL); + MessageString(Chat::Red, ITEMS_INSUFFICIENT_LEVEL); return; } } @@ -8902,12 +8902,12 @@ void Client::Handle_OP_LeadershipExpToggle(const EQApplicationPacket *app) if (*mode) { m_pp.leadAAActive = 1; Save(); - Message_StringID(Chat::Yellow, LEADERSHIP_EXP_ON); + MessageString(Chat::Yellow, LEADERSHIP_EXP_ON); } else { m_pp.leadAAActive = 0; Save(); - Message_StringID(Chat::Yellow, LEADERSHIP_EXP_OFF); + MessageString(Chat::Yellow, LEADERSHIP_EXP_OFF); } } @@ -9372,11 +9372,11 @@ void Client::Handle_OP_Mend(const EQApplicationPacket *app) if (zone->random.Int(0, 99) < criticalchance) { mendhp *= 2; - Message_StringID(Chat::LightBlue, MEND_CRITICAL); + MessageString(Chat::LightBlue, MEND_CRITICAL); } SetHP(GetHP() + mendhp); SendHPUpdate(); - Message_StringID(Chat::LightBlue, MEND_SUCCESS); + MessageString(Chat::LightBlue, MEND_SUCCESS); } else { /* the purpose of the following is to make the chance to worsen wounds much less common, @@ -9389,10 +9389,10 @@ void Client::Handle_OP_Mend(const EQApplicationPacket *app) { SetHP(currenthp > mendhp ? (GetHP() - mendhp) : 1); SendHPUpdate(); - Message_StringID(Chat::LightBlue, MEND_WORSEN); + MessageString(Chat::LightBlue, MEND_WORSEN); } else - Message_StringID(Chat::LightBlue, MEND_FAIL); + MessageString(Chat::LightBlue, MEND_FAIL); } CheckIncreaseSkill(EQEmu::skills::SkillMend, nullptr, 10); @@ -9930,9 +9930,9 @@ void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app) return; } if (petition_list.DeletePetitionByCharName((char*)app->pBuffer)) - Message_StringID(Chat::White, PETITION_DELETED); + MessageString(Chat::White, PETITION_DELETED); else - Message_StringID(Chat::White, PETITION_NO_DELETE); + MessageString(Chat::White, PETITION_NO_DELETE); return; } @@ -9989,7 +9989,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (!target) break; if (target->IsMezzed()) { - Message_StringID(Chat::NPCQuestSay, CANNOT_WAKE, mypet->GetCleanName(), target->GetCleanName()); + MessageString(Chat::NPCQuestSay, CANNOT_WAKE, mypet->GetCleanName(), target->GetCleanName()); break; } if (mypet->IsFeared()) @@ -10027,7 +10027,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) hate += mypet->GetHateAmount(top) - mypet->GetHateAmount(target) + 100; // should be enough to cause target change } mypet->AddToHateList(target, hate, 0, true, false, false, SPELL_UNKNOWN, true); - Message_StringID(Chat::PetResponse, PET_ATTACKING, mypet->GetCleanName(), target->GetCleanName()); + MessageString(Chat::PetResponse, PET_ATTACKING, mypet->GetCleanName(), target->GetCleanName()); SetTarget(target); } } @@ -10040,7 +10040,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (!GetTarget()) break; if (GetTarget()->IsMezzed()) { - Message_StringID(Chat::NPCQuestSay, CANNOT_WAKE, mypet->GetCleanName(), GetTarget()->GetCleanName()); + MessageString(Chat::NPCQuestSay, CANNOT_WAKE, mypet->GetCleanName(), GetTarget()->GetCleanName()); break; } @@ -10061,7 +10061,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) } zone->AddAggroMob(); mypet->AddToHateList(GetTarget(), 1, 0, true, false, false, SPELL_UNKNOWN, true); - Message_StringID(Chat::PetResponse, PET_ATTACKING, mypet->GetCleanName(), GetTarget()->GetCleanName()); + MessageString(Chat::PetResponse, PET_ATTACKING, mypet->GetCleanName(), GetTarget()->GetCleanName()); } } break; @@ -10082,7 +10082,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) } case PET_HEALTHREPORT: { if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { - Message_StringID(Chat::PetResponse, PET_REPORT_HP, ConvertArrayF(mypet->GetHPRatio(), val1)); + MessageString(Chat::PetResponse, PET_REPORT_HP, ConvertArrayF(mypet->GetHPRatio(), val1)); mypet->ShowBuffList(this); } break; @@ -10150,12 +10150,12 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { if (mypet->CastToNPC()->IsTaunting()) { - Message_StringID(Chat::PetResponse, PET_NO_TAUNT); + MessageString(Chat::PetResponse, PET_NO_TAUNT); mypet->CastToNPC()->SetTaunting(false); } else { - Message_StringID(Chat::PetResponse, PET_DO_TAUNT); + MessageString(Chat::PetResponse, PET_DO_TAUNT); mypet->CastToNPC()->SetTaunting(true); } } @@ -10163,14 +10163,14 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) } case PET_TAUNT_ON: { if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { - Message_StringID(Chat::PetResponse, PET_DO_TAUNT); + MessageString(Chat::PetResponse, PET_DO_TAUNT); mypet->CastToNPC()->SetTaunting(true); } break; } case PET_TAUNT_OFF: { if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { - Message_StringID(Chat::PetResponse, PET_NO_TAUNT); + MessageString(Chat::PetResponse, PET_NO_TAUNT); mypet->CastToNPC()->SetTaunting(false); } break; @@ -10239,13 +10239,13 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsHeld()) { if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(Chat::PetResponse, PET_HOLD_SET_OFF); + MessageString(Chat::PetResponse, PET_HOLD_SET_OFF); mypet->SetHeld(false); } else { if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(Chat::PetResponse, PET_HOLD_SET_ON); + MessageString(Chat::PetResponse, PET_HOLD_SET_ON); if (m_ClientVersionBit & EQEmu::versions::maskUFAndLater) mypet->SayTo_StringID(this, Chat::PetResponse, PET_NOW_HOLDING); @@ -10262,7 +10262,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) case PET_HOLD_ON: { if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC() && !mypet->IsHeld()) { if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(Chat::PetResponse, PET_HOLD_SET_ON); + MessageString(Chat::PetResponse, PET_HOLD_SET_ON); if (m_ClientVersionBit & EQEmu::versions::maskUFAndLater) mypet->SayTo_StringID(this, Chat::PetResponse, PET_NOW_HOLDING); @@ -10277,7 +10277,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) case PET_HOLD_OFF: { if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC() && mypet->IsHeld()) { if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(Chat::PetResponse, PET_HOLD_SET_OFF); + MessageString(Chat::PetResponse, PET_HOLD_SET_OFF); mypet->SetHeld(false); } break; @@ -10287,13 +10287,13 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsGHeld()) { if (m_ClientVersionBit & EQEmu::versions::maskUFAndLater) - Message_StringID(Chat::PetResponse, PET_OFF_GHOLD); + MessageString(Chat::PetResponse, PET_OFF_GHOLD); mypet->SetGHeld(false); } else { if (m_ClientVersionBit & EQEmu::versions::maskUFAndLater) { - Message_StringID(Chat::PetResponse, PET_ON_GHOLD); + MessageString(Chat::PetResponse, PET_ON_GHOLD); mypet->SayTo_StringID(this, Chat::PetResponse, PET_GHOLD_ON_MSG); } else { mypet->SayTo_StringID(this, Chat::PetResponse, PET_ON_HOLD); @@ -10308,7 +10308,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) case PET_GHOLD_ON: { if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) { if (m_ClientVersionBit & EQEmu::versions::maskUFAndLater) { - Message_StringID(Chat::PetResponse, PET_ON_GHOLD); + MessageString(Chat::PetResponse, PET_ON_GHOLD); mypet->SayTo_StringID(this, Chat::PetResponse, PET_GHOLD_ON_MSG); } else { mypet->SayTo_StringID(this, Chat::PetResponse, PET_ON_HOLD); @@ -10322,7 +10322,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) case PET_GHOLD_OFF: { if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC() && mypet->IsGHeld()) { if (m_ClientVersionBit & EQEmu::versions::maskUFAndLater) - Message_StringID(Chat::PetResponse, PET_OFF_GHOLD); + MessageString(Chat::PetResponse, PET_OFF_GHOLD); mypet->SetGHeld(false); } break; @@ -10332,15 +10332,15 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; if (mypet->IsNoCast()) { - Message_StringID(Chat::PetResponse, PET_CASTING); + MessageString(Chat::PetResponse, PET_CASTING); if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(Chat::PetResponse, PET_SPELLHOLD_SET_OFF); + MessageString(Chat::PetResponse, PET_SPELLHOLD_SET_OFF); mypet->SetNoCast(false); } else { - Message_StringID(Chat::PetResponse, PET_NOT_CASTING); + MessageString(Chat::PetResponse, PET_NOT_CASTING); if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(Chat::PetResponse, PET_SPELLHOLD_SET_ON); + MessageString(Chat::PetResponse, PET_SPELLHOLD_SET_ON); mypet->SetNoCast(true); } } @@ -10351,9 +10351,9 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; if (!mypet->IsNoCast()) { - Message_StringID(Chat::PetResponse, PET_NOT_CASTING); + MessageString(Chat::PetResponse, PET_NOT_CASTING); if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(Chat::PetResponse, PET_SPELLHOLD_SET_ON); + MessageString(Chat::PetResponse, PET_SPELLHOLD_SET_ON); mypet->SetNoCast(true); } } @@ -10364,9 +10364,9 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; if (mypet->IsNoCast()) { - Message_StringID(Chat::PetResponse, PET_CASTING); + MessageString(Chat::PetResponse, PET_CASTING); if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(Chat::PetResponse, PET_SPELLHOLD_SET_OFF); + MessageString(Chat::PetResponse, PET_SPELLHOLD_SET_OFF); mypet->SetNoCast(false); } } @@ -10377,15 +10377,15 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; if (mypet->IsFocused()) { - Message_StringID(Chat::PetResponse, PET_NOT_FOCUSING); + MessageString(Chat::PetResponse, PET_NOT_FOCUSING); if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(Chat::PetResponse, PET_FOCUS_SET_OFF); + MessageString(Chat::PetResponse, PET_FOCUS_SET_OFF); mypet->SetFocused(false); } else { - Message_StringID(Chat::PetResponse, PET_NOW_FOCUSING); + MessageString(Chat::PetResponse, PET_NOW_FOCUSING); if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(Chat::PetResponse, PET_FOCUS_SET_ON); + MessageString(Chat::PetResponse, PET_FOCUS_SET_ON); mypet->SetFocused(true); } } @@ -10396,9 +10396,9 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; if (!mypet->IsFocused()) { - Message_StringID(Chat::PetResponse, PET_NOW_FOCUSING); + MessageString(Chat::PetResponse, PET_NOW_FOCUSING); if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(Chat::PetResponse, PET_FOCUS_SET_ON); + MessageString(Chat::PetResponse, PET_FOCUS_SET_ON); mypet->SetFocused(true); } } @@ -10409,9 +10409,9 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; if (mypet->IsFocused()) { - Message_StringID(Chat::PetResponse, PET_NOT_FOCUSING); + MessageString(Chat::PetResponse, PET_NOT_FOCUSING); if (m_ClientVersionBit & EQEmu::versions::maskSoDAndLater) - Message_StringID(Chat::PetResponse, PET_FOCUS_SET_OFF); + MessageString(Chat::PetResponse, PET_FOCUS_SET_OFF); mypet->SetFocused(false); } } @@ -11111,7 +11111,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) Client *player_accepting_invite = entity_list.GetClientByName(raid_command_packet->player_name); if (player_accepting_invite) { if (IsRaidGrouped()) { - player_accepting_invite->Message_StringID(Chat::White, ALREADY_IN_RAID, GetName()); //group failed, must invite members not in raid... + player_accepting_invite->MessageString(Chat::White, ALREADY_IN_RAID, GetName()); //group failed, must invite members not in raid... return; } Raid *raid = entity_list.GetRaidByClient(player_accepting_invite); @@ -11983,14 +11983,14 @@ void Client::Handle_OP_RemoveTrap(const EQApplicationPacket *app) if (good) RemoveAura(id); else - Message_StringID(Chat::SpellFailure, NOT_YOUR_TRAP); // pretty sure this was red + MessageString(Chat::SpellFailure, NOT_YOUR_TRAP); // pretty sure this was red } void Client::Handle_OP_Report(const EQApplicationPacket *app) { if (!CanUseReport) { - Message_StringID(Chat::System, REPORT_ONCE); + MessageString(Chat::System, REPORT_ONCE); return; } @@ -12057,11 +12057,11 @@ void Client::Handle_OP_RequestDuel(const EQApplicationPacket *app) ds->duel_target = duel; Entity* entity = entity_list.GetID(ds->duel_target); if (GetID() != ds->duel_target && entity->IsClient() && (entity->CastToClient()->IsDueling() && entity->CastToClient()->GetDuelTarget() != 0)) { - Message_StringID(Chat::NPCQuestSay, DUEL_CONSIDERING, entity->GetName()); + MessageString(Chat::NPCQuestSay, DUEL_CONSIDERING, entity->GetName()); return; } if (IsDueling()) { - Message_StringID(Chat::NPCQuestSay, DUEL_INPROGRESS); + MessageString(Chat::NPCQuestSay, DUEL_INPROGRESS); return; } @@ -12108,7 +12108,7 @@ void Client::Handle_OP_RespawnWindow(const EQApplicationPacket *app) void Client::Handle_OP_Rewind(const EQApplicationPacket *app) { if ((rewind_timer.GetRemainingTime() > 1 && rewind_timer.Enabled())) { - Message_StringID(Chat::System, REWIND_WAIT); + MessageString(Chat::System, REWIND_WAIT); } else { CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), m_RewindLocation.x, m_RewindLocation.y, m_RewindLocation.z, 0, 2, Rewind); @@ -12445,7 +12445,8 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app) if (shield_target) { - entity_list.MessageClose_StringID(this, false, 100, 0, + entity_list.MessageCloseString( + this, false, 100, 0, END_SHIELDING, GetName(), shield_target->GetName()); for (int y = 0; y < 2; y++) { @@ -12471,7 +12472,8 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app) { if (shield_target->shielder[x].shielder_id == 0) { - entity_list.MessageClose_StringID(this, false, 100, 0, + entity_list.MessageCloseString( + this, false, 100, 0, START_SHIELDING, GetName(), shield_target->GetName()); shield_target->shielder[x].shielder_id = GetID(); int shieldbonus = shield->AC * 2; @@ -12509,7 +12511,7 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app) } if (!ack) { - Message_StringID(Chat::White, ALREADY_SHIELDED); + MessageString(Chat::White, ALREADY_SHIELDED); shield_target = 0; return; } @@ -13021,7 +13023,7 @@ void Client::Handle_OP_ShopRequest(const EQApplicationPacket *app) return; } if (tmp->IsEngaged()) { - this->Message_StringID(Chat::White, MERCHANT_BUSY); + this->MessageString(Chat::White, MERCHANT_BUSY); action = 0; } if (GetFeigned() || IsInvisible()) @@ -13334,7 +13336,7 @@ void Client::Handle_OP_Surname(const EQApplicationPacket *app) if (GetLevel() < 20) { - Message_StringID(Chat::Yellow, SURNAME_LEVEL); + MessageString(Chat::Yellow, SURNAME_LEVEL); return; } @@ -13356,13 +13358,13 @@ void Client::Handle_OP_Surname(const EQApplicationPacket *app) } if (strlen(surname->lastname) >= 20) { - Message_StringID(Chat::Yellow, SURNAME_TOO_LONG); + MessageString(Chat::Yellow, SURNAME_TOO_LONG); return; } if (!database.CheckNameFilter(surname->lastname, true)) { - Message_StringID(Chat::Yellow, SURNAME_REJECTED); + MessageString(Chat::Yellow, SURNAME_REJECTED); return; } @@ -13742,16 +13744,16 @@ void Client::Handle_OP_TradeAcceptClick(const EQApplicationPacket *app) trade->state = TradeCompleting; if (CheckTradeLoreConflict(other) || other->CheckTradeLoreConflict(this)) { - Message_StringID(Chat::Red, TRADE_CANCEL_LORE); - other->Message_StringID(Chat::Red, TRADE_CANCEL_LORE); + MessageString(Chat::Red, TRADE_CANCEL_LORE); + other->MessageString(Chat::Red, TRADE_CANCEL_LORE); this->FinishTrade(this); other->FinishTrade(other); other->trade->Reset(); trade->Reset(); } else if (CheckTradeNonDroppable()) { - Message_StringID(Chat::Red, TRADE_HAS_BEEN_CANCELLED); - other->Message_StringID(Chat::Red, TRADE_HAS_BEEN_CANCELLED); + MessageString(Chat::Red, TRADE_HAS_BEEN_CANCELLED); + other->MessageString(Chat::Red, TRADE_HAS_BEEN_CANCELLED); this->FinishTrade(this); other->FinishTrade(other); other->trade->Reset(); @@ -13760,8 +13762,8 @@ void Client::Handle_OP_TradeAcceptClick(const EQApplicationPacket *app) // TODO: query (this) as a hacker } else if (other->CheckTradeNonDroppable()) { - Message_StringID(Chat::Red, TRADE_HAS_BEEN_CANCELLED); - other->Message_StringID(Chat::Red, TRADE_HAS_BEEN_CANCELLED); + MessageString(Chat::Red, TRADE_HAS_BEEN_CANCELLED); + other->MessageString(Chat::Red, TRADE_HAS_BEEN_CANCELLED); this->FinishTrade(this); other->FinishTrade(other); other->trade->Reset(); @@ -14209,7 +14211,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) } else { - Message_StringID(Chat::Yellow, TRADER_BUSY); + MessageString(Chat::Yellow, TRADER_BUSY); Log(Logs::Detail, Logs::Trading, "Client::Handle_OP_TraderShop: Trader Busy"); } diff --git a/zone/client_process.cpp b/zone/client_process.cpp index ecbf90d1e..7e08054d8 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -378,10 +378,10 @@ bool Client::Process() { } if (!CombatRange(auto_attack_target)) { - Message_StringID(Chat::TooFarAway, TARGET_TOO_FAR); + MessageString(Chat::TooFarAway, TARGET_TOO_FAR); } else if (auto_attack_target == this) { - Message_StringID(Chat::TooFarAway, TRY_ATTACKING_SOMEONE); + MessageString(Chat::TooFarAway, TRY_ATTACKING_SOMEONE); } else if (!los_status || !los_status_facing) { //you can't see your target @@ -401,11 +401,11 @@ bool Client::Process() { if (GetClass() == WARRIOR || GetClass() == BERSERKER) { if (!dead && !IsBerserk() && GetHPRatio() < RuleI(Combat, BerserkerFrenzyStart)) { - entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_START, GetName()); + entity_list.MessageCloseString(this, false, 200, 0, BERSERK_START, GetName()); berserk = true; } if (IsBerserk() && GetHPRatio() > RuleI(Combat, BerserkerFrenzyEnd)) { - entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_END, GetName()); + entity_list.MessageCloseString(this, false, 200, 0, BERSERK_END, GetName()); berserk = false; } } @@ -416,11 +416,11 @@ bool Client::Process() { // Range check if (!CombatRange(auto_attack_target)) { // this is a duplicate message don't use it. - //Message_StringID(Chat::TooFarAway,TARGET_TOO_FAR); + //MessageString(Chat::TooFarAway,TARGET_TOO_FAR); } // Don't attack yourself else if (auto_attack_target == this) { - //Message_StringID(Chat::TooFarAway,TRY_ATTACKING_SOMEONE); + //MessageString(Chat::TooFarAway,TRY_ATTACKING_SOMEONE); } else if (!los_status || !los_status_facing) { @@ -465,7 +465,8 @@ bool Client::Process() { { if (!CombatRange(shield_target)) { - entity_list.MessageClose_StringID(this, false, 100, 0, + entity_list.MessageCloseString( + this, false, 100, 0, END_SHIELDING, GetCleanName(), shield_target->GetCleanName()); for (int y = 0; y < 2; y++) { @@ -951,9 +952,9 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) { sprintf(handy_id, "%i", greet_id); if (greet_id != MERCHANT_GREETING) - Message_StringID(Chat::NPCQuestSay, GENERIC_STRINGID_SAY, merch->GetCleanName(), handy_id, this->GetName(), handyitem->Name); + MessageString(Chat::NPCQuestSay, GENERIC_STRINGID_SAY, merch->GetCleanName(), handy_id, this->GetName(), handyitem->Name); else - Message_StringID(Chat::NPCQuestSay, GENERIC_STRINGID_SAY, merch->GetCleanName(), handy_id, this->GetName()); + MessageString(Chat::NPCQuestSay, GENERIC_STRINGID_SAY, merch->GetCleanName(), handy_id, this->GetName()); } // safe_delete_array(cpi); @@ -1043,7 +1044,7 @@ void Client::OPTGB(const EQApplicationPacket *app) uint32 tgb_flag = *(uint32 *)app->pBuffer; if(tgb_flag == 2) - Message_StringID(Chat::White, TGB() ? TGB_ON : TGB_OFF); + MessageString(Chat::White, TGB() ? TGB_ON : TGB_OFF); else tgb = tgb_flag; } @@ -1072,7 +1073,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app) ) { char val1[20]={0}; - Message_StringID(Chat::Red,SPELL_LEVEL_TO_LOW,ConvertArray(spells[memspell->spell_id].classes[GetClass()-1],val1),spells[memspell->spell_id].name); + MessageString(Chat::Red,SPELL_LEVEL_TO_LOW,ConvertArray(spells[memspell->spell_id].classes[GetClass()-1],val1),spells[memspell->spell_id].name); //Message(Chat::Red, "Unexpected error: Class cant use this spell at your level!"); return; } @@ -1087,7 +1088,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app) const EQEmu::ItemData* item = inst->GetItem(); if (RuleB(Character, RestrictSpellScribing) && !item->IsEquipable(GetRace(), GetClass())) { - Message_StringID(Chat::Red, CANNOT_USE_ITEM); + MessageString(Chat::Red, CANNOT_USE_ITEM); break; } @@ -1645,7 +1646,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app) case EQEmu::skills::SkillJewelryMaking: case EQEmu::skills::SkillPottery: if(skilllevel >= RuleI(Skills, MaxTrainTradeskills)) { - Message_StringID(Chat::Red, MORE_SKILLED_THAN_I, pTrainer->GetCleanName()); + MessageString(Chat::Red, MORE_SKILLED_THAN_I, pTrainer->GetCleanName()); return; } break; @@ -1655,7 +1656,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app) case EQEmu::skills::SkillSpecializeDivination: case EQEmu::skills::SkillSpecializeEvocation: if(skilllevel >= RuleI(Skills, MaxTrainSpecializations)) { - Message_StringID(Chat::Red, MORE_SKILLED_THAN_I, pTrainer->GetCleanName()); + MessageString(Chat::Red, MORE_SKILLED_THAN_I, pTrainer->GetCleanName()); return; } default: @@ -1666,7 +1667,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app) if (skilllevel >= MaxSkillValue) { // Don't allow training over max skill level - Message_StringID(Chat::Red, MORE_SKILLED_THAN_I, pTrainer->GetCleanName()); + MessageString(Chat::Red, MORE_SKILLED_THAN_I, pTrainer->GetCleanName()); return; } @@ -1676,7 +1677,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app) if (skilllevel >= MaxSpecSkill) { // Restrict specialization training to follow the rules - Message_StringID(Chat::Red, MORE_SKILLED_THAN_I, pTrainer->GetCleanName()); + MessageString(Chat::Red, MORE_SKILLED_THAN_I, pTrainer->GetCleanName()); return; } } @@ -1919,7 +1920,7 @@ void Client::DoTracking() Mob *m = entity_list.GetMob(TrackingID); if (!m || m->IsCorpse()) { - Message_StringID(Chat::Skills, TRACK_LOST_TARGET); + MessageString(Chat::Skills, TRACK_LOST_TARGET); TrackingID = 0; return; } @@ -1930,23 +1931,23 @@ void Client::DoTracking() RelativeHeading += 512; if (RelativeHeading > 480) - Message_StringID(Chat::Skills, TRACK_STRAIGHT_AHEAD, m->GetCleanName()); + MessageString(Chat::Skills, TRACK_STRAIGHT_AHEAD, m->GetCleanName()); else if (RelativeHeading > 416) - Message_StringID(Chat::Skills, TRACK_AHEAD_AND_TO, m->GetCleanName(), "left"); + MessageString(Chat::Skills, TRACK_AHEAD_AND_TO, m->GetCleanName(), "left"); else if (RelativeHeading > 352) - Message_StringID(Chat::Skills, TRACK_TO_THE, m->GetCleanName(), "left"); + MessageString(Chat::Skills, TRACK_TO_THE, m->GetCleanName(), "left"); else if (RelativeHeading > 288) - Message_StringID(Chat::Skills, TRACK_BEHIND_AND_TO, m->GetCleanName(), "left"); + MessageString(Chat::Skills, TRACK_BEHIND_AND_TO, m->GetCleanName(), "left"); else if (RelativeHeading > 224) - Message_StringID(Chat::Skills, TRACK_BEHIND_YOU, m->GetCleanName()); + MessageString(Chat::Skills, TRACK_BEHIND_YOU, m->GetCleanName()); else if (RelativeHeading > 160) - Message_StringID(Chat::Skills, TRACK_BEHIND_AND_TO, m->GetCleanName(), "right"); + MessageString(Chat::Skills, TRACK_BEHIND_AND_TO, m->GetCleanName(), "right"); else if (RelativeHeading > 96) - Message_StringID(Chat::Skills, TRACK_TO_THE, m->GetCleanName(), "right"); + MessageString(Chat::Skills, TRACK_TO_THE, m->GetCleanName(), "right"); else if (RelativeHeading > 32) - Message_StringID(Chat::Skills, TRACK_AHEAD_AND_TO, m->GetCleanName(), "right"); + MessageString(Chat::Skills, TRACK_AHEAD_AND_TO, m->GetCleanName(), "right"); else if (RelativeHeading >= 0) - Message_StringID(Chat::Skills, TRACK_STRAIGHT_AHEAD, m->GetCleanName()); + MessageString(Chat::Skills, TRACK_STRAIGHT_AHEAD, m->GetCleanName()); } void Client::HandleRespawnFromHover(uint32 Option) diff --git a/zone/corpse.cpp b/zone/corpse.cpp index 942c3374b..2dc2872ec 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -1201,7 +1201,7 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app) if (client && inst) { if (client->CheckLoreConflict(item)) { - client->Message_StringID(Chat::White, LOOT_LORE_ERROR); + client->MessageString(Chat::White, LOOT_LORE_ERROR); client->QueuePacket(app); SendEndLootErrorPacket(client); ResetLooter(); @@ -1214,7 +1214,7 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app) EQEmu::ItemInstance *itm = inst->GetAugment(i); if (itm) { if (client->CheckLoreConflict(itm->GetItem())) { - client->Message_StringID(Chat::White, LOOT_LORE_ERROR); + client->MessageString(Chat::White, LOOT_LORE_ERROR); client->QueuePacket(app); SendEndLootErrorPacket(client); ResetLooter(); @@ -1236,7 +1236,7 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app) args.push_back(this); if (parse->EventPlayer(EVENT_LOOT, client, buf, 0, &args) != 0) { lootitem->auto_loot = -1; - client->Message_StringID(Chat::Red, LOOT_NOT_ALLOWED, inst->GetItem()->Name); + client->MessageString(Chat::Red, LOOT_NOT_ALLOWED, inst->GetItem()->Name); client->QueuePacket(app); delete inst; return; @@ -1312,18 +1312,18 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app) linker.GenerateLink(); - client->Message_StringID(Chat::Loot, LOOTED_MESSAGE, linker.Link().c_str()); + client->MessageString(Chat::Loot, LOOTED_MESSAGE, linker.Link().c_str()); if (!IsPlayerCorpse()) { Group *g = client->GetGroup(); if (g != nullptr) { - g->GroupMessage_StringID(client, Chat::Loot, OTHER_LOOTED_MESSAGE, + g->GroupMessageString(client, Chat::Loot, OTHER_LOOTED_MESSAGE, client->GetName(), linker.Link().c_str()); } else { Raid *r = client->GetRaid(); if (r != nullptr) { - r->RaidMessage_StringID(client, Chat::Loot, OTHER_LOOTED_MESSAGE, + r->RaidMessageString(client, Chat::Loot, OTHER_LOOTED_MESSAGE, client->GetName(), linker.Link().c_str()); } } diff --git a/zone/doors.cpp b/zone/doors.cpp index 15f61ba47..d81eb72f8 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -171,7 +171,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) { if (RuleI(Adventure, ItemIDToEnablePorts) != 0) { if (!sender->KeyRingCheck(RuleI(Adventure, ItemIDToEnablePorts))) { if (sender->GetInv().HasItem(RuleI(Adventure, ItemIDToEnablePorts)) == INVALID_INDEX) { - sender->Message_StringID(Chat::Red, DUNGEON_SEALED); + sender->MessageString(Chat::Red, DUNGEON_SEALED); safe_delete(outapp); return; } else { @@ -281,7 +281,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) { * GM can always open locks */ if (sender->GetGM()) { - sender->Message_StringID(Chat::LightBlue, DOORS_GM); + sender->MessageString(Chat::LightBlue, DOORS_GM); if (!IsDoorOpen() || (open_type == 58)) { move_door_packet->action = static_cast(invert_state == 0 ? OPEN_DOOR : OPEN_INVDOOR); @@ -333,19 +333,19 @@ void Doors::HandleClick(Client* sender, uint8 trigger) { } else { move_door_packet->action = static_cast(invert_state == 0 ? CLOSE_DOOR : CLOSE_INVDOOR); } - sender->Message_StringID(Chat::LightBlue, DOORS_SUCCESSFUL_PICK); + sender->MessageString(Chat::LightBlue, DOORS_SUCCESSFUL_PICK); } else { - sender->Message_StringID(Chat::LightBlue, DOORS_INSUFFICIENT_SKILL); + sender->MessageString(Chat::LightBlue, DOORS_INSUFFICIENT_SKILL); safe_delete(outapp); return; } } else { - sender->Message_StringID(Chat::LightBlue, DOORS_NO_PICK); + sender->MessageString(Chat::LightBlue, DOORS_NO_PICK); safe_delete(outapp); return; } } else { - sender->Message_StringID(Chat::LightBlue, DOORS_CANT_PICK); + sender->MessageString(Chat::LightBlue, DOORS_CANT_PICK); safe_delete(outapp); return; } @@ -368,7 +368,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) { move_door_packet->action = static_cast(invert_state == 0 ? CLOSE_DOOR : CLOSE_INVDOOR); } } else { - sender->Message_StringID(Chat::LightBlue, DOORS_LOCKED); + sender->MessageString(Chat::LightBlue, DOORS_LOCKED); safe_delete(outapp); return; } diff --git a/zone/effects.cpp b/zone/effects.cpp index e51d540ad..f6996c030 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -122,11 +122,12 @@ int32 Mob::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) { else if (IsNPC() && CastToNPC()->GetSpellScale()) value = int(static_cast(value) * CastToNPC()->GetSpellScale() / 100.0f); - entity_list.MessageClose_StringID(this, true, 100, Chat::SpellCrit, - OTHER_CRIT_BLAST, GetName(), itoa(-value)); + entity_list.MessageCloseString( + this, true, 100, Chat::SpellCrit, + OTHER_CRIT_BLAST, GetName(), itoa(-value)); if (IsClient()) - Message_StringID(Chat::SpellCrit, YOU_CRIT_BLAST, itoa(-value)); + MessageString(Chat::SpellCrit, YOU_CRIT_BLAST, itoa(-value)); return value; } @@ -306,11 +307,12 @@ int32 Mob::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { value = int(static_cast(value) * CastToNPC()->GetHealScale() / 100.0f); if (Critical) { - entity_list.MessageClose_StringID(this, true, 100, Chat::SpellCrit, - OTHER_CRIT_HEAL, GetName(), itoa(value)); + entity_list.MessageCloseString( + this, true, 100, Chat::SpellCrit, + OTHER_CRIT_HEAL, GetName(), itoa(value)); if (IsClient()) - Message_StringID(Chat::SpellCrit, YOU_CRIT_HEAL, itoa(value)); + MessageString(Chat::SpellCrit, YOU_CRIT_HEAL, itoa(value)); } return value; @@ -595,7 +597,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { } if(level_to_use > GetLevel()) { - Message_StringID(Chat::Red, DISC_LEVEL_USE_ERROR); + MessageString(Chat::Red, DISC_LEVEL_USE_ERROR); //should summon them a new one... return(false); } @@ -607,7 +609,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { // sneak attack discs require you to be hidden for 4 seconds before use if (spell.sneak && (!hidden || (hidden && (Timer::GetCurrentTime() - tmHidden) < 4000))) { - Message_StringID(Chat::SpellFailure, SNEAK_RESTRICT); + MessageString(Chat::SpellFailure, SNEAK_RESTRICT); return false; } @@ -621,7 +623,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { /*char val1[20]={0};*/ //unused /*char val2[20]={0};*/ //unused uint32 remain = p_timers.GetRemainingTime(DiscTimer); - //Message_StringID(Chat::WhiteSmoke, DISCIPLINE_CANUSEIN, ConvertArray((remain)/60,val1), ConvertArray(remain%60,val2)); + //MessageString(Chat::WhiteSmoke, DISCIPLINE_CANUSEIN, ConvertArray((remain)/60,val1), ConvertArray(remain%60,val2)); Message(0, "You can use this discipline in %d minutes %d seconds.", ((remain)/60), (remain%60)); return(false); } diff --git a/zone/entity.cpp b/zone/entity.cpp index 97678b2d0..e52935ded 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -1671,9 +1671,9 @@ void EntityList::DuelMessage(Mob *winner, Mob *loser, bool flee) //might want some sort of distance check in here? if (cur != winner && cur != loser) { if (flee) - cur->Message_StringID(Chat::Yellow, DUEL_FLED, winner->GetName(),loser->GetName(),loser->GetName()); + cur->MessageString(Chat::Yellow, DUEL_FLED, winner->GetName(),loser->GetName(),loser->GetName()); else - cur->Message_StringID(Chat::Yellow, DUEL_FINISHED, winner->GetName(),loser->GetName()); + cur->MessageString(Chat::Yellow, DUEL_FINISHED, winner->GetName(),loser->GetName()); } ++it; } @@ -2071,7 +2071,7 @@ void EntityList::QueueClientsGuildBankItemUpdate(const GuildBankItemUpdate_Struc void EntityList::MessageStatus(uint32 to_guild_id, int to_minstatus, uint32 type, const char *message, ...) { va_list argptr; - char buffer[4096]; + char buffer[4096]; va_start(argptr, message); vsnprintf(buffer, 4096, message, argptr); @@ -2080,22 +2080,66 @@ void EntityList::MessageStatus(uint32 to_guild_id, int to_minstatus, uint32 type auto it = client_list.begin(); while (it != client_list.end()) { Client *client = it->second; - if ((to_guild_id == 0 || client->IsInGuild(to_guild_id)) && client->Admin() >= to_minstatus) + if ((to_guild_id == 0 || client->IsInGuild(to_guild_id)) && client->Admin() >= to_minstatus) { client->Message(type, buffer); + } ++it; } } -// works much like MessageClose, but with formatted strings -void EntityList::MessageClose_StringID(Mob *sender, bool skipsender, float dist, uint32 type, uint32 string_id, const char* message1,const char* message2,const char* message3,const char* message4,const char* message5,const char* message6,const char* message7,const char* message8,const char* message9) +/** + * @param sender + * @param skipsender + * @param dist + * @param type + * @param string_id + * @param message1 + * @param message2 + * @param message3 + * @param message4 + * @param message5 + * @param message6 + * @param message7 + * @param message8 + * @param message9 + */ +void EntityList::MessageCloseString( + Mob *sender, + bool skipsender, + float dist, + uint32 type, + uint32 string_id, + const char *message1, + const char *message2, + const char *message3, + const char *message4, + const char *message5, + const char *message6, + const char *message7, + const char *message8, + const char *message9 +) { Client *c; - float dist2 = dist * dist; + float dist2 = dist * dist; - for (auto it = client_list.begin(); it != client_list.end(); ++it) { - c = it->second; - if(c && DistanceSquared(c->GetPosition(), sender->GetPosition()) <= dist2 && (!skipsender || c != sender)) - c->Message_StringID(type, string_id, message1, message2, message3, message4, message5, message6, message7, message8, message9); + for (auto & it : client_list) { + c = it.second; + if (c && DistanceSquared(c->GetPosition(), sender->GetPosition()) <= dist2 && (!skipsender || c != sender)) { + c->MessageString( + type, + string_id, + message1, + message2, + message3, + message4, + message5, + message6, + message7, + message8, + message9 + ); + } } } @@ -2116,56 +2160,162 @@ void EntityList::MessageClose_StringID(Mob *sender, bool skipsender, float dist, * @param message8 * @param message9 */ -void EntityList::FilteredMessageClose_StringID(Mob *sender, bool skipsender, - float dist, uint32 type, eqFilterType filter, uint32 string_id, - const char *message1, const char *message2, const char *message3, - const char *message4, const char *message5, const char *message6, - const char *message7, const char *message8, const char *message9) +void EntityList::FilteredMessageCloseString( + Mob *sender, bool skipsender, + float dist, + uint32 type, + eqFilterType filter, + uint32 string_id, + const char *message1, + const char *message2, + const char *message3, + const char *message4, + const char *message5, + const char *message6, + const char *message7, + const char *message8, + const char *message9 +) { Client *c; - float dist2 = dist * dist; + float dist2 = dist * dist; - for (auto it = client_list.begin(); it != client_list.end(); ++it) { - c = it->second; - if (c && DistanceSquared(c->GetPosition(), sender->GetPosition()) <= dist2 && (!skipsender || c != sender)) - c->FilteredMessage_StringID(sender, type, filter, string_id, - message1, message2, message3, message4, message5, - message6, message7, message8, message9); + for (auto & it : client_list) { + c = it.second; + if (c && DistanceSquared(c->GetPosition(), sender->GetPosition()) <= dist2 && (!skipsender || c != sender)) { + c->FilteredMessageString( + sender, type, filter, string_id, + message1, message2, message3, message4, message5, + message6, message7, message8, message9 + ); + } } } -void EntityList::Message_StringID(Mob *sender, bool skipsender, uint32 type, uint32 string_id, const char* message1,const char* message2,const char* message3,const char* message4,const char* message5,const char* message6,const char* message7,const char* message8,const char* message9) +/** + * + * @param sender + * @param skipsender + * @param type + * @param string_id + * @param message1 + * @param message2 + * @param message3 + * @param message4 + * @param message5 + * @param message6 + * @param message7 + * @param message8 + * @param message9 + */ +void EntityList::MessageString( + Mob *sender, + bool skipsender, + uint32 type, + uint32 string_id, + const char *message1, + const char *message2, + const char *message3, + const char *message4, + const char *message5, + const char *message6, + const char *message7, + const char *message8, + const char *message9 +) { Client *c; - for (auto it = client_list.begin(); it != client_list.end(); ++it) { - c = it->second; - if(c && (!skipsender || c != sender)) - c->Message_StringID(type, string_id, message1, message2, message3, message4, message5, message6, message7, message8, message9); + for (auto & it : client_list) { + c = it.second; + if (c && (!skipsender || c != sender)) { + c->MessageString( + type, + string_id, + message1, + message2, + message3, + message4, + message5, + message6, + message7, + message8, + message9 + ); + } } } -void EntityList::FilteredMessage_StringID(Mob *sender, bool skipsender, - uint32 type, eqFilterType filter, uint32 string_id, - const char *message1, const char *message2, const char *message3, - const char *message4, const char *message5, const char *message6, - const char *message7, const char *message8, const char *message9) +/** + * + * @param sender + * @param skipsender + * @param type + * @param filter + * @param string_id + * @param message1 + * @param message2 + * @param message3 + * @param message4 + * @param message5 + * @param message6 + * @param message7 + * @param message8 + * @param message9 + */ +void EntityList::FilteredMessageString( + Mob *sender, + bool skipsender, + uint32 type, + eqFilterType filter, + uint32 string_id, + const char *message1, + const char *message2, + const char *message3, + const char *message4, + const char *message5, + const char *message6, + const char *message7, + const char *message8, + const char *message9 +) { Client *c; - for (auto it = client_list.begin(); it != client_list.end(); ++it) { - c = it->second; - if (c && (!skipsender || c != sender)) - c->FilteredMessage_StringID(sender, type, filter, string_id, - message1, message2, message3, message4, message5, message6, - message7, message8, message9); + for (auto & it : client_list) { + c = it.second; + if (c && (!skipsender || c != sender)) { + c->FilteredMessageString( + sender, + type, + filter, + string_id, + message1, + message2, + message3, + message4, + message5, + message6, + message7, + message8, + message9 + ); + } } } -void EntityList::MessageClose(Mob* sender, bool skipsender, float dist, uint32 type, const char* message, ...) +/** + * @param sender + * @param skipsender + * @param dist + * @param type + * @param message + * @param ... + */ +void EntityList::MessageClose(Mob *sender, bool skipsender, float dist, uint32 type, const char *message, ...) { va_list argptr; - char buffer[4096]; + char buffer[4096]; va_start(argptr, message); vsnprintf(buffer, 4095, message, argptr); @@ -2175,16 +2325,26 @@ void EntityList::MessageClose(Mob* sender, bool skipsender, float dist, uint32 t auto it = client_list.begin(); while (it != client_list.end()) { - if (DistanceSquared(it->second->GetPosition(), sender->GetPosition()) <= dist2 && (!skipsender || it->second != sender)) + if (DistanceSquared(it->second->GetPosition(), sender->GetPosition()) <= dist2 && + (!skipsender || it->second != sender)) { it->second->Message(type, buffer); + } ++it; } } -void EntityList::FilteredMessageClose(Mob *sender, bool skipsender, float dist, uint32 type, eqFilterType filter, const char *message, ...) +void EntityList::FilteredMessageClose( + Mob *sender, + bool skipsender, + float dist, + uint32 type, + eqFilterType filter, + const char *message, + ... +) { va_list argptr; - char buffer[4096]; + char buffer[4096]; va_start(argptr, message); vsnprintf(buffer, 4095, message, argptr); @@ -2194,8 +2354,10 @@ void EntityList::FilteredMessageClose(Mob *sender, bool skipsender, float dist, auto it = client_list.begin(); while (it != client_list.end()) { - if (DistanceSquared(it->second->GetPosition(), sender->GetPosition()) <= dist2 && (!skipsender || it->second != sender)) - it->second->FilteredMessage(sender, type, filter, buffer); + if (DistanceSquared(it->second->GetPosition(), sender->GetPosition()) <= dist2 && + (!skipsender || it->second != sender)) { + it->second->FilteredMessage(sender, type, filter, buffer); + } ++it; } } @@ -4649,7 +4811,7 @@ void EntityList::ExpeditionWarning(uint32 minutes_left) auto it = client_list.begin(); while (it != client_list.end()) { - it->second->Message_StringID(Chat::Yellow, EXPEDITION_MIN_REMAIN, itoa((int)minutes_left)); + it->second->MessageString(Chat::Yellow, EXPEDITION_MIN_REMAIN, itoa((int)minutes_left)); it->second->QueuePacket(outapp); ++it; } diff --git a/zone/entity.h b/zone/entity.h index a02a8be2e..3f6581ca6 100644 --- a/zone/entity.h +++ b/zone/entity.h @@ -321,10 +321,39 @@ public: void MessageStatus(uint32 to_guilddbid, int to_minstatus, uint32 type, const char* message, ...); void MessageClose(Mob* sender, bool skipsender, float dist, uint32 type, const char* message, ...); void FilteredMessageClose(Mob* sender, bool skipsender, float dist, uint32 type, eqFilterType filter, const char* message, ...); - void Message_StringID(Mob *sender, bool skipsender, uint32 type, uint32 string_id, const char* message1=0,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0); - void FilteredMessage_StringID(Mob *sender, bool skipsender, uint32 type, eqFilterType filter, uint32 string_id, const char* message1=0,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0); - void MessageClose_StringID(Mob *sender, bool skipsender, float dist, uint32 type, uint32 string_id, const char* message1=0,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0); - void FilteredMessageClose_StringID(Mob *sender, bool skipsender, float dist, uint32 type, eqFilterType filter, uint32 string_id, const char* message1=0,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0); + void MessageString(Mob *sender, bool skipsender, uint32 type, uint32 string_id, const char* message1=0,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0); + void FilteredMessageString(Mob *sender, bool skipsender, uint32 type, eqFilterType filter, uint32 string_id, const char* message1=0,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0); + void MessageCloseString( + Mob *sender, + bool skipsender, + float dist, + uint32 type, + uint32 string_id, + const char *message1 = 0, + const char *message2 = 0, + const char *message3 = 0, + const char *message4 = 0, + const char *message5 = 0, + const char *message6 = 0, + const char *message7 = 0, + const char *message8 = 0, + const char *message9 = 0); + void FilteredMessageCloseString( + Mob *sender, + bool skipsender, + float dist, + uint32 type, + eqFilterType filter, + uint32 string_id, + const char *message1 = 0, + const char *message2 = 0, + const char *message3 = 0, + const char *message4 = 0, + const char *message5 = 0, + const char *message6 = 0, + const char *message7 = 0, + const char *message8 = 0, + const char *message9 = 0); void ChannelMessageFromWorld(const char* from, const char* to, uint8 chan_num, uint32 guilddbid, uint8 language, uint8 lang_skill, const char* message); void ChannelMessage(Mob* from, uint8 chan_num, uint8 language, const char* message, ...); void ChannelMessage(Mob* from, uint8 chan_num, uint8 language, uint8 lang_skill, const char* message, ...); diff --git a/zone/exp.cpp b/zone/exp.cpp index 2fe87997b..23593f644 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -333,18 +333,18 @@ void Client::CalculateLeadershipExp(uint32 &add_exp, uint8 conlevel) uint32 mentor_exp = exp * (GetGroup()->GetMentorPercent() / 100.0f); exp -= mentor_exp; mentoree->AddLeadershipEXP(mentor_exp, 0); // ends up rounded down - mentoree->Message_StringID(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_EXP); + mentoree->MessageString(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_EXP); } if (exp > 0) { // possible if you mentor 100% to the other client AddLeadershipEXP(exp, 0); // ends up rounded up if mentored, no idea how live actually does it - Message_StringID(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_EXP); + MessageString(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_EXP); } } else { - Message_StringID(Chat::LeaderShip, MAX_GROUP_LEADERSHIP_POINTS); + MessageString(Chat::LeaderShip, MAX_GROUP_LEADERSHIP_POINTS); } } else @@ -357,11 +357,11 @@ void Client::CalculateLeadershipExp(uint32 &add_exp, uint8 conlevel) && RuleI(Character, KillsPerRaidLeadershipAA) > 0) { AddLeadershipEXP(0, RAID_EXP_PER_POINT / RuleI(Character, KillsPerRaidLeadershipAA)); - Message_StringID(Chat::LeaderShip, GAIN_RAID_LEADERSHIP_EXP); + MessageString(Chat::LeaderShip, GAIN_RAID_LEADERSHIP_EXP); } else { - Message_StringID(Chat::LeaderShip, MAX_RAID_LEADERSHIP_POINTS); + MessageString(Chat::LeaderShip, MAX_RAID_LEADERSHIP_POINTS); } } else @@ -378,17 +378,17 @@ void Client::CalculateLeadershipExp(uint32 &add_exp, uint8 conlevel) uint32 mentor_exp = exp * (raid->GetMentorPercent(group_id) / 100.0f); exp -= mentor_exp; mentoree->AddLeadershipEXP(mentor_exp, 0); - mentoree->Message_StringID(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_EXP); + mentoree->MessageString(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_EXP); } if (exp > 0) { AddLeadershipEXP(exp, 0); - Message_StringID(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_EXP); + MessageString(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_EXP); } } else { - Message_StringID(Chat::LeaderShip, MAX_GROUP_LEADERSHIP_POINTS); + MessageString(Chat::LeaderShip, MAX_GROUP_LEADERSHIP_POINTS); } } } @@ -565,22 +565,22 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { if (isrezzexp) { if (RuleI(Character, ShowExpValues) > 0) Message(Chat::Experience, "You regain %s experience from resurrection. %s", exp_amount_message.c_str(), exp_percent_message.c_str()); - else Message_StringID(Chat::Experience, REZ_REGAIN); + else MessageString(Chat::Experience, REZ_REGAIN); } else { if (membercount > 1) { if (RuleI(Character, ShowExpValues) > 0) Message(Chat::Experience, "You have gained %s party experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str()); - else Message_StringID(Chat::Experience, GAIN_GROUPXP); + else MessageString(Chat::Experience, GAIN_GROUPXP); } else if (IsRaidGrouped()) { if (RuleI(Character, ShowExpValues) > 0) Message(Chat::Experience, "You have gained %s raid experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str()); - else Message_StringID(Chat::Experience, GAIN_RAIDEXP); + else MessageString(Chat::Experience, GAIN_RAIDEXP); } else { if (RuleI(Character, ShowExpValues) > 0) Message(Chat::Experience, "You have gained %s experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str()); - else Message_StringID(Chat::Experience, GAIN_XP); + else MessageString(Chat::Experience, GAIN_XP); } } } @@ -656,7 +656,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { //Message(Chat::Yellow, "You have gained %d skill points!!", m_pp.aapoints - last_unspentAA); char val1[20]={0}; - Message_StringID(Chat::Experience, GAIN_ABILITY_POINT, ConvertArray(m_pp.aapoints, val1),m_pp.aapoints == 1 ? "" : "(s)"); //You have gained an ability point! You now have %1 ability point%2. + MessageString(Chat::Experience, GAIN_ABILITY_POINT, ConvertArray(m_pp.aapoints, val1),m_pp.aapoints == 1 ? "" : "(s)"); //You have gained an ability point! You now have %1 ability point%2. /* QS: PlayerLogAARate */ if (RuleB(QueryServ, PlayerLogAARate)){ @@ -699,18 +699,18 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { if (level_increase) { if (level_count == 1) - Message_StringID(Chat::Experience, GAIN_LEVEL, ConvertArray(check_level, val1)); + MessageString(Chat::Experience, GAIN_LEVEL, ConvertArray(check_level, val1)); else Message(Chat::Yellow, "Welcome to level %i!", check_level); if (check_level == RuleI(Character, DeathItemLossLevel)) - Message_StringID(Chat::Yellow, CORPSE_ITEM_LOST); + MessageString(Chat::Yellow, CORPSE_ITEM_LOST); if (check_level == RuleI(Character, DeathExpLossLevel)) - Message_StringID(Chat::Yellow, CORPSE_EXP_LOST); + MessageString(Chat::Yellow, CORPSE_EXP_LOST); } else - Message_StringID(Chat::Experience, LOSE_LEVEL, ConvertArray(check_level, val1)); + MessageString(Chat::Experience, LOSE_LEVEL, ConvertArray(check_level, val1)); #ifdef BOTS uint8 myoldlevel = GetLevel(); @@ -758,7 +758,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { char val1[20]={0}; char val2[20]={0}; char val3[20]={0}; - Message_StringID(Chat::Experience, GM_GAINXP, ConvertArray(set_aaxp,val1),ConvertArray(set_exp,val2),ConvertArray(GetEXPForLevel(GetLevel()+1),val3)); //[GM] You have gained %1 AXP and %2 EXP (%3). + MessageString(Chat::Experience, GM_GAINXP, ConvertArray(set_aaxp,val1),ConvertArray(set_exp,val2),ConvertArray(GetEXPForLevel(GetLevel()+1),val3)); //[GM] You have gained %1 AXP and %2 EXP (%3). } } @@ -1077,12 +1077,12 @@ void Client::SetLeadershipEXP(uint32 group_exp, uint32 raid_exp) { while(group_exp >= GROUP_EXP_PER_POINT) { group_exp -= GROUP_EXP_PER_POINT; m_pp.group_leadership_points++; - Message_StringID(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_POINT); + MessageString(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_POINT); } while(raid_exp >= RAID_EXP_PER_POINT) { raid_exp -= RAID_EXP_PER_POINT; m_pp.raid_leadership_points++; - Message_StringID(Chat::LeaderShip, GAIN_RAID_LEADERSHIP_POINT); + MessageString(Chat::LeaderShip, GAIN_RAID_LEADERSHIP_POINT); } m_pp.group_leadership_exp = group_exp; diff --git a/zone/forage.cpp b/zone/forage.cpp index df3cce2a0..c3310a0d3 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -161,14 +161,14 @@ bool Client::CanFish() { if (!Pole || !Pole->IsClassCommon() || Pole->GetItem()->ItemType != EQEmu::item::ItemTypeFishingPole) { if (m_inv.HasItemByUse(EQEmu::item::ItemTypeFishingPole, 1, invWhereWorn | invWherePersonal | invWhereBank | invWhereSharedBank | invWhereTrading | invWhereCursor)) //We have a fishing pole somewhere, just not equipped - Message_StringID(Chat::Skills, FISHING_EQUIP_POLE); //You need to put your fishing pole in your primary hand. + MessageString(Chat::Skills, FISHING_EQUIP_POLE); //You need to put your fishing pole in your primary hand. else //We don't have a fishing pole anywhere - Message_StringID(Chat::Skills, FISHING_NO_POLE); //You can't fish without a fishing pole, go buy one. + MessageString(Chat::Skills, FISHING_NO_POLE); //You can't fish without a fishing pole, go buy one. return false; } if (!Bait || !Bait->IsClassCommon() || Bait->GetItem()->ItemType != EQEmu::item::ItemTypeFishingBait) { - Message_StringID(Chat::Skills, FISHING_NO_BAIT); //You can't fish without fishing bait, go buy some. + MessageString(Chat::Skills, FISHING_NO_BAIT); //You can't fish without fishing bait, go buy some. return false; } @@ -190,7 +190,7 @@ bool Client::CanFish() { float bestz = zone->zonemap->FindBestZ(rodPosition, nullptr); float len = m_Position.z - bestz; if(len > LineLength || len < 0.0f) { - Message_StringID(Chat::Skills, FISHING_LAND); + MessageString(Chat::Skills, FISHING_LAND); return false; } @@ -203,7 +203,7 @@ bool Client::CanFish() { bool in_water = zone->watermap->InWater(dest) || zone->watermap->InVWater(dest); if (in_lava) { - Message_StringID(Chat::Skills, FISHING_LAVA); //Trying to catch a fire elemental or something? + MessageString(Chat::Skills, FISHING_LAVA); //Trying to catch a fire elemental or something? return false; } @@ -212,7 +212,7 @@ bool Client::CanFish() { } } - Message_StringID(Chat::Skills, FISHING_LAND); + MessageString(Chat::Skills, FISHING_LAND); return false; } return true; @@ -223,7 +223,7 @@ void Client::GoFish() //TODO: generate a message if we're already fishing /*if (!fishing_timer.Check()) { //this isn't the right check, may need to add something to the Client class like 'bool is_fishing' - Message_StringID(Chat::WhiteSmoke, ALREADY_FISHING); //You are already fishing! + MessageString(Chat::WhiteSmoke, ALREADY_FISHING); //You are already fishing! return; }*/ @@ -315,17 +315,17 @@ void Client::GoFish() const EQEmu::ItemData* food_item = database.GetItem(food_id); if (food_item->ItemType != EQEmu::item::ItemTypeFood) { - Message_StringID(Chat::Skills, FISHING_SUCCESS); + MessageString(Chat::Skills, FISHING_SUCCESS); } else { - Message_StringID(Chat::Skills, FISHING_SUCCESS_FISH_NAME, food_item->Name); + MessageString(Chat::Skills, FISHING_SUCCESS_FISH_NAME, food_item->Name); } EQEmu::ItemInstance* inst = database.CreateItem(food_item, 1); if(inst != nullptr) { if(CheckLoreConflict(inst->GetItem())) { - Message_StringID(Chat::White, DUP_LORE); + MessageString(Chat::White, DUP_LORE); safe_delete(inst); } else @@ -351,13 +351,13 @@ void Client::GoFish() //chance to use bait when you dont catch anything... if (zone->random.Int(0, 4) == 1) { DeleteItemInInventory(bslot, 1, true); //do we need client update? - Message_StringID(Chat::Skills, FISHING_LOST_BAIT); //You lost your bait! + MessageString(Chat::Skills, FISHING_LOST_BAIT); //You lost your bait! } else { if (zone->random.Int(0, 15) == 1) //give about a 1 in 15 chance to spill your beer. we could make this a rule, but it doesn't really seem worth it //TODO: check for & consume an alcoholic beverage from inventory when this triggers, and set it as a rule that's disabled by default - Message_StringID(Chat::Skills, FISHING_SPILL_BEER); //You spill your beer while bringing in your line. + MessageString(Chat::Skills, FISHING_SPILL_BEER); //You spill your beer while bringing in your line. else - Message_StringID(Chat::Skills, FISHING_FAILED); //You didn't catch anything. + MessageString(Chat::Skills, FISHING_FAILED); //You didn't catch anything. } parse->EventPlayer(EVENT_FISH_FAILURE, this, "", 0); @@ -367,7 +367,7 @@ void Client::GoFish() //this is potentially exploitable in that they can fish //and then swap out items in primary slot... too lazy to fix right now if (zone->random.Int(0, 49) == 1) { - Message_StringID(Chat::Skills, FISHING_POLE_BROKE); //Your fishing pole broke! + MessageString(Chat::Skills, FISHING_POLE_BROKE); //Your fishing pole broke! DeleteItemInInventory(EQEmu::invslot::slotPrimary, 0, true); } @@ -434,13 +434,13 @@ void Client::ForageItem(bool guarantee) { break; } - Message_StringID(Chat::Skills, stringid); + MessageString(Chat::Skills, stringid); EQEmu::ItemInstance* inst = database.CreateItem(food_item, 1); if(inst != nullptr) { // check to make sure it isn't a foraged lore item if(CheckLoreConflict(inst->GetItem())) { - Message_StringID(Chat::White, DUP_LORE); + MessageString(Chat::White, DUP_LORE); safe_delete(inst); } else { @@ -462,12 +462,12 @@ void Client::ForageItem(bool guarantee) { int ChanceSecondForage = aabonuses.ForageAdditionalItems + itembonuses.ForageAdditionalItems + spellbonuses.ForageAdditionalItems; if(!guarantee && zone->random.Roll(ChanceSecondForage)) { - Message_StringID(Chat::Skills, FORAGE_MASTERY); + MessageString(Chat::Skills, FORAGE_MASTERY); ForageItem(true); } } else { - Message_StringID(Chat::Skills, FORAGE_FAILED); + MessageString(Chat::Skills, FORAGE_FAILED); parse->EventPlayer(EVENT_FORAGE_FAILURE, this, "", 0); } diff --git a/zone/groups.cpp b/zone/groups.cpp index 2f0c5e854..a4104b26a 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -1236,7 +1236,7 @@ void Group::VerifyGroup() { } } -void Group::GroupMessage_StringID(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2,const char* message3,const char* message4,const char* message5,const char* message6,const char* message7,const char* message8,const char* message9, uint32 distance) { +void Group::GroupMessageString(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2,const char* message3,const char* message4,const char* message5,const char* message6,const char* message7,const char* message8,const char* message9, uint32 distance) { uint32 i; for (i = 0; i < MAX_GROUP_MEMBERS; i++) { if(members[i] == nullptr) @@ -1248,7 +1248,7 @@ void Group::GroupMessage_StringID(Mob* sender, uint32 type, uint32 string_id, co if(!members[i]->IsClient()) continue; - members[i]->Message_StringID(type, string_id, message, message2, message3, message4, message5, message6, message7, message8, message9, 0); + members[i]->MessageString(type, string_id, message, message2, message3, message4, message5, message6, message7, message8, message9, 0); } } diff --git a/zone/groups.h b/zone/groups.h index 913a6c169..0d39409e0 100644 --- a/zone/groups.h +++ b/zone/groups.h @@ -74,7 +74,7 @@ public: void GroupBardPulse(Mob* caster,uint16 spellid); void SplitExp(uint32 exp, Mob* other); void GroupMessage(Mob* sender,uint8 language,uint8 lang_skill,const char* message); - void GroupMessage_StringID(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0); + void GroupMessageString(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0); uint32 GetTotalGroupDamage(Mob* other); void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Client *splitter = nullptr); inline void SetLeader(Mob* newleader){ leader=newleader; }; diff --git a/zone/inventory.cpp b/zone/inventory.cpp index b24d03795..94ca78007 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -853,7 +853,7 @@ void Client::SendCursorBuffer() if (!lore_pass) { Log(Logs::General, Logs::Inventory, "(%s) Duplicate lore items are not allowed - destroying item %s(id:%u) on cursor", GetName(), test_item->Name, test_item->ID); - Message_StringID(Chat::Loot, 290); + MessageString(Chat::Loot, 290); parse->EventItem(EVENT_DESTROY_ITEM, this, test_inst, nullptr, "", 0); DeleteItemInInventory(EQEmu::invslot::slotCursor); SendCursorBuffer(); @@ -1555,7 +1555,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if (!lore_pass) { Log(Logs::General, Logs::Inventory, "(%s) Duplicate lore items are not allowed - destroying item %s(id:%u) on cursor", GetName(), test_item->Name, test_item->ID); - Message_StringID(Chat::Loot, 290); + MessageString(Chat::Loot, 290); parse->EventItem(EVENT_DESTROY_ITEM, this, test_inst, nullptr, "", 0); DeleteItemInInventory(EQEmu::invslot::slotCursor, 0, true); } diff --git a/zone/lua_mob.cpp b/zone/lua_mob.cpp index df0cd7b70..7d769b8dd 100644 --- a/zone/lua_mob.cpp +++ b/zone/lua_mob.cpp @@ -743,9 +743,9 @@ void Lua_Mob::Message(int type, const char *message) { self->Message(type, message); } -void Lua_Mob::Message_StringID(int type, int string_id, uint32 distance) { +void Lua_Mob::MessageString(int type, int string_id, uint32 distance) { Lua_Safe_Call_Void(); - self->Message_StringID(type, string_id, distance); + self->MessageString(type, string_id, distance); } void Lua_Mob::Say(const char *message) { @@ -2386,7 +2386,8 @@ luabind::scope lua_register_mob() { .def("SetCurrentWP", &Lua_Mob::SetCurrentWP) .def("GetSize", &Lua_Mob::GetSize) .def("Message", &Lua_Mob::Message) - .def("Message_StringID", &Lua_Mob::Message_StringID) + .def("MessageString", &Lua_Mob::MessageString) + .def("Message_StringID", &Lua_Mob::MessageString) .def("Say", (void(Lua_Mob::*)(const char*))& Lua_Mob::Say) .def("Say", (void(Lua_Mob::*)(const char*, int))& Lua_Mob::Say) .def("QuestSay", (void(Lua_Mob::*)(Lua_Client,const char *))&Lua_Mob::QuestSay) diff --git a/zone/lua_mob.h b/zone/lua_mob.h index 1270f2121..592ac6243 100644 --- a/zone/lua_mob.h +++ b/zone/lua_mob.h @@ -166,7 +166,7 @@ public: void SetCurrentWP(int wp); double GetSize(); void Message(int type, const char *message); - void Message_StringID(int type, int string_id, uint32 distance); + void MessageString(int type, int string_id, uint32 distance); void Say(const char *message); void Say(const char* message, int language); void QuestSay(Lua_Client client, const char *message); diff --git a/zone/merc.cpp b/zone/merc.cpp index 7ae4a4d9f..c2b433d52 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -1618,7 +1618,7 @@ void Merc::AI_Process() { { if(zone->random.Roll(flurrychance)) { - Message_StringID(Chat::NPCFlurry, YOU_FLURRY); + MessageString(Chat::NPCFlurry, YOU_FLURRY); Attack(GetTarget(), EQEmu::invslot::slotPrimary, false); Attack(GetTarget(), EQEmu::invslot::slotPrimary, false); } @@ -2623,7 +2623,7 @@ int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) { realTotal = CalcFocusEffect(type, UsedFocusID, spell_id); if (realTotal != 0 && UsedItem) - Message_StringID(Chat::Spells, BEGINS_TO_GLOW, UsedItem->Name); + MessageString(Chat::Spells, BEGINS_TO_GLOW, UsedItem->Name); } //Check if spell focus effect exists for the client. diff --git a/zone/mob.cpp b/zone/mob.cpp index 6067f206e..a5d7ae261 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -2835,7 +2835,7 @@ void Mob::Say(const char *format, ...) talker = this; } - entity_list.MessageClose_StringID( + entity_list.MessageCloseString( talker, false, 200, 10, GENERIC_SAY, GetCleanName(), buf ); @@ -2850,7 +2850,8 @@ void Mob::Say_StringID(uint32 string_id, const char *message3, const char *messa snprintf(string_id_str, 10, "%d", string_id); - entity_list.MessageClose_StringID(this, false, 200, 10, + entity_list.MessageCloseString( + this, false, 200, 10, GENERIC_STRINGID_SAY, GetCleanName(), string_id_str, message3, message4, message5, message6, message7, message8, message9 ); @@ -2862,7 +2863,8 @@ void Mob::Say_StringID(uint32 type, uint32 string_id, const char *message3, cons snprintf(string_id_str, 10, "%d", string_id); - entity_list.MessageClose_StringID(this, false, 200, type, + entity_list.MessageCloseString( + this, false, 200, type, GENERIC_STRINGID_SAY, GetCleanName(), string_id_str, message3, message4, message5, message6, message7, message8, message9 ); @@ -2875,7 +2877,7 @@ void Mob::SayTo_StringID(Client *to, uint32 string_id, const char *message3, con auto string_id_str = std::to_string(string_id); - to->Message_StringID(Chat::NPCQuestSay, GENERIC_STRINGID_SAY, GetCleanName(), string_id_str.c_str(), message3, message4, message5, message6, message7, message8, message9); + to->MessageString(Chat::NPCQuestSay, GENERIC_STRINGID_SAY, GetCleanName(), string_id_str.c_str(), message3, message4, message5, message6, message7, message8, message9); } void Mob::SayTo_StringID(Client *to, uint32 type, uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9) @@ -2885,7 +2887,7 @@ void Mob::SayTo_StringID(Client *to, uint32 type, uint32 string_id, const char * auto string_id_str = std::to_string(string_id); - to->Message_StringID(type, GENERIC_STRINGID_SAY, GetCleanName(), string_id_str.c_str(), message3, message4, message5, message6, message7, message8, message9); + to->MessageString(type, GENERIC_STRINGID_SAY, GetCleanName(), string_id_str.c_str(), message3, message4, message5, message6, message7, message8, message9); } void Mob::Shout(const char *format, ...) @@ -2897,7 +2899,7 @@ void Mob::Shout(const char *format, ...) vsnprintf(buf, 1000, format, ap); va_end(ap); - entity_list.Message_StringID(this, false, Chat::Shout, + entity_list.MessageString(this, false, Chat::Shout, GENERIC_SHOUT, GetCleanName(), buf); } @@ -2910,8 +2912,10 @@ void Mob::Emote(const char *format, ...) vsnprintf(buf, 1000, format, ap); va_end(ap); - entity_list.MessageClose_StringID(this, false, 200, 10, - GENERIC_EMOTE, GetCleanName(), buf); + entity_list.MessageCloseString( + this, false, 200, 10, + GENERIC_EMOTE, GetCleanName(), buf + ); } void Mob::QuestJournalledSay(Client *QuestInitiator, const char *str, Journal::Options &opts) @@ -4887,16 +4891,16 @@ void Mob::SlowMitigation(Mob* caster) if (GetSlowMitigation() && caster && caster->IsClient()) { if ((GetSlowMitigation() > 0) && (GetSlowMitigation() < 26)) - caster->Message_StringID(Chat::SpellFailure, SLOW_MOSTLY_SUCCESSFUL); + caster->MessageString(Chat::SpellFailure, SLOW_MOSTLY_SUCCESSFUL); else if ((GetSlowMitigation() >= 26) && (GetSlowMitigation() < 74)) - caster->Message_StringID(Chat::SpellFailure, SLOW_PARTIALLY_SUCCESSFUL); + caster->MessageString(Chat::SpellFailure, SLOW_PARTIALLY_SUCCESSFUL); else if ((GetSlowMitigation() >= 74) && (GetSlowMitigation() < 101)) - caster->Message_StringID(Chat::SpellFailure, SLOW_SLIGHTLY_SUCCESSFUL); + caster->MessageString(Chat::SpellFailure, SLOW_SLIGHTLY_SUCCESSFUL); else if (GetSlowMitigation() > 100) - caster->Message_StringID(Chat::SpellFailure, SPELL_OPPOSITE_EFFECT); + caster->MessageString(Chat::SpellFailure, SPELL_OPPOSITE_EFFECT); } } diff --git a/zone/mob.h b/zone/mob.h index d2ebe3934..5134f1ace 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -722,12 +722,12 @@ public: inline void SetRareSpawn(bool in) { rare_spawn = in; } virtual void Message(uint32 type, const char* message, ...) { } - virtual void Message_StringID(uint32 type, uint32 string_id, uint32 distance = 0) { } - virtual void Message_StringID(uint32 type, uint32 string_id, const char* message, const char* message2 = 0, + virtual void MessageString(uint32 type, uint32 string_id, uint32 distance = 0) { } + virtual void MessageString(uint32 type, uint32 string_id, const char* message, const char* message2 = 0, const char* message3 = 0, const char* message4 = 0, const char* message5 = 0, const char* message6 = 0, const char* message7 = 0, const char* message8 = 0, const char* message9 = 0, uint32 distance = 0) { } - virtual void FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType filter, uint32 string_id) { } - virtual void FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType filter, + virtual void FilteredMessageString(Mob *sender, uint32 type, eqFilterType filter, uint32 string_id) { } + virtual void FilteredMessageString(Mob *sender, uint32 type, eqFilterType filter, uint32 string_id, const char *message1, const char *message2 = nullptr, const char *message3 = nullptr, const char *message4 = nullptr, const char *message5 = nullptr, const char *message6 = nullptr, diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index e71a28a05..6b7218417 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -578,7 +578,7 @@ void NPC::AI_Stop() { void Client::AI_Stop() { Mob::AI_Stop(); - this->Message_StringID(Chat::Red,PLAYER_REGAIN); + this->MessageString(Chat::Red,PLAYER_REGAIN); auto app = new EQApplicationPacket(OP_Charm, sizeof(Charm_Struct)); Charm_Struct *ps = (Charm_Struct*)app->pBuffer; @@ -2029,14 +2029,14 @@ void Mob::StartEnrage() // start the timer. need to call IsEnraged frequently since we dont have callback timers :-/ bEnraged = true; - entity_list.MessageClose_StringID(this, true, 200, Chat::NPCEnrage, NPC_ENRAGE_START, GetCleanName()); + entity_list.MessageCloseString(this, true, 200, Chat::NPCEnrage, NPC_ENRAGE_START, GetCleanName()); } void Mob::ProcessEnrage(){ if(IsEnraged()){ Timer *timer = GetSpecialAbilityTimer(SPECATK_ENRAGE); if(timer && timer->Check()){ - entity_list.MessageClose_StringID(this, true, 200, Chat::NPCEnrage, NPC_ENRAGE_END, GetCleanName()); + entity_list.MessageCloseString(this, true, 200, Chat::NPCEnrage, NPC_ENRAGE_END, GetCleanName()); int enraged_cooldown = GetSpecialAbilityParam(SPECATK_ENRAGE, 2); enraged_cooldown = enraged_cooldown > 0 ? enraged_cooldown : EnragedTimer; @@ -2057,9 +2057,23 @@ bool Mob::Flurry(ExtraAttackOptions *opts) Mob *target = GetTarget(); if (target) { if (!IsPet()) { - entity_list.MessageClose_StringID(this, true, 200, Chat::NPCFlurry, NPC_FLURRY, GetCleanName(), target->GetCleanName()); + entity_list.MessageCloseString( + this, + true, + 200, + Chat::NPCFlurry, + NPC_FLURRY, + GetCleanName(), + target->GetCleanName()); } else { - entity_list.MessageClose_StringID(this, true, 200, Chat::PetFlurry, NPC_FLURRY, GetCleanName(), target->GetCleanName()); + entity_list.MessageCloseString( + this, + true, + 200, + Chat::PetFlurry, + NPC_FLURRY, + GetCleanName(), + target->GetCleanName()); } int num_attacks = GetSpecialAbilityParam(SPECATK_FLURRY, 1); @@ -2096,9 +2110,9 @@ bool Mob::Rampage(ExtraAttackOptions *opts) { int index_hit = 0; if (!IsPet()) - entity_list.MessageClose_StringID(this, true, 200, Chat::NPCRampage, NPC_RAMPAGE, GetCleanName()); + entity_list.MessageCloseString(this, true, 200, Chat::NPCRampage, NPC_RAMPAGE, GetCleanName()); else - entity_list.MessageClose_StringID(this, true, 200, Chat::PetFlurry, NPC_RAMPAGE, GetCleanName()); + entity_list.MessageCloseString(this, true, 200, Chat::PetFlurry, NPC_RAMPAGE, GetCleanName()); int rampage_targets = GetSpecialAbilityParam(SPECATK_RAMPAGE, 1); if (rampage_targets == 0) // if set to 0 or not set in the DB @@ -2153,9 +2167,9 @@ void Mob::AreaRampage(ExtraAttackOptions *opts) { int index_hit = 0; if (!IsPet()) { // do not know every pet AA so thought it safer to add this - entity_list.MessageClose_StringID(this, true, 200, Chat::NPCRampage, AE_RAMPAGE, GetCleanName()); + entity_list.MessageCloseString(this, true, 200, Chat::NPCRampage, AE_RAMPAGE, GetCleanName()); } else { - entity_list.MessageClose_StringID(this, true, 200, Chat::PetFlurry, AE_RAMPAGE, GetCleanName()); + entity_list.MessageCloseString(this, true, 200, Chat::PetFlurry, AE_RAMPAGE, GetCleanName()); } int rampage_targets = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 1); diff --git a/zone/npc.cpp b/zone/npc.cpp index 3f31d57da..30bf0b614 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1744,17 +1744,17 @@ void NPC::Disarm(Client* client, int chance) { SendWearChange(matslot); if ((CastToMob()->GetBodyType() == BT_Humanoid || CastToMob()->GetBodyType() == BT_Summoned) && eslot == EQEmu::invslot::slotPrimary) Say("Ahh! My weapon!"); - client->Message_StringID(Chat::Skills, DISARM_SUCCESS, this->GetCleanName()); + client->MessageString(Chat::Skills, DISARM_SUCCESS, this->GetCleanName()); if (chance != 1000) client->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 4); return; } - client->Message_StringID(Chat::Skills, DISARM_FAILED); + client->MessageString(Chat::Skills, DISARM_FAILED); if (chance != 1000) client->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 2); return; } - client->Message_StringID(Chat::Skills, DISARM_FAILED); + client->MessageString(Chat::Skills, DISARM_FAILED); } void Mob::NPCSpecialAttacks(const char* parse, int permtag, bool reset, bool remove) { @@ -2592,7 +2592,7 @@ void NPC::DoNPCEmote(uint8 event_, uint16 emoteid) else if(nes->type == 2) this->Shout("%s",nes->text); else if(nes->type == 3) - entity_list.MessageClose_StringID(this, true, 200, 10, GENERIC_STRING, nes->text); + entity_list.MessageCloseString(this, true, 200, 10, GENERIC_STRING, nes->text); else this->Say("%s",nes->text); } diff --git a/zone/oldcode.cpp b/zone/oldcode.cpp index 7da290439..059504328 100644 --- a/zone/oldcode.cpp +++ b/zone/oldcode.cpp @@ -1198,7 +1198,7 @@ Message(0, "Disc packet id=%d, %x,%x,%x", disc_in->disc_id, disc_in->unknown3[0] char val1[20]={0}; char val2[20]={0}; uint32 remain = p_timers.GetRemainingTime(pTimerDisciplineReuse); - Message_StringID(Chat::WhiteSmoke,DISCIPLINE_CANUSEIN,ConvertArray((remain)/60,val1),ConvertArray(remain%60,val2)); + MessageString(Chat::WhiteSmoke,DISCIPLINE_CANUSEIN,ConvertArray((remain)/60,val1),ConvertArray(remain%60,val2)); //Message(0,"You can use a new discipline in %i minutes %i seconds.", (disc_timer.GetRemainingTime()/1000)/60, disc_timer.GetRemainingTime()/1000%60); return; } diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index 5dd4ce5be..9ad3a6e8b 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -3702,7 +3702,7 @@ XS(XS_Mob_Message_StringID) { distance = (uint32) SvUV(ST(3)); } - THIS->Message_StringID(type, string_id, distance); + THIS->MessageString(type, string_id, distance); } XSRETURN_EMPTY; } diff --git a/zone/raids.cpp b/zone/raids.cpp index e4c5b3552..51fd2296f 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -1712,12 +1712,12 @@ const char *Raid::GetClientNameByIndex(uint8 index) return members[index].membername; } -void Raid::RaidMessage_StringID(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2,const char* message3,const char* message4,const char* message5,const char* message6,const char* message7,const char* message8,const char* message9, uint32 distance) { +void Raid::RaidMessageString(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2,const char* message3,const char* message4,const char* message5,const char* message6,const char* message7,const char* message8,const char* message9, uint32 distance) { uint32 i; for (i = 0; i < MAX_RAID_MEMBERS; i++) { if(members[i].member) { if(members[i].member != sender) - members[i].member->Message_StringID(type, string_id, message, message2, message3, message4, message5, message6, message7, message8, message9, distance); + members[i].member->MessageString(type, string_id, message, message2, message3, message4, message5, message6, message7, message8, message9, distance); } } } diff --git a/zone/raids.h b/zone/raids.h index 26f5a0880..260ae6c71 100644 --- a/zone/raids.h +++ b/zone/raids.h @@ -152,7 +152,7 @@ public: //Actual Implementation Stuff - void RaidMessage_StringID(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0); + void RaidMessageString(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0); void CastGroupSpell(Mob* caster,uint16 spellid, uint32 gid); void SplitExp(uint32 exp, Mob* other); uint32 GetTotalRaidDamage(Mob* other); diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 35b865610..3940834b8 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -177,7 +177,7 @@ void Mob::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32 auto fbash = GetFuriousBash(itm->Focus.Effect); hate = hate * (100 + fbash) / 100; if (fbash) - Message_StringID(Chat::Spells, GLOWS_RED, itm->Name); + MessageString(Chat::Spells, GLOWS_RED, itm->Name); } } } @@ -530,7 +530,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) { if(IsClient()) { const EQEmu::ItemInstance *wpn = CastToClient()->GetInv().GetItem(EQEmu::invslot::slotPrimary); if (!wpn || (wpn->GetItem()->ItemType != EQEmu::item::ItemType1HPiercing)){ - Message_StringID(Chat::Red, BACKSTAB_WEAPON); + MessageString(Chat::Red, BACKSTAB_WEAPON); return; } } @@ -720,11 +720,11 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { float dist = DistanceSquared(m_Position, other->GetPosition()); if(dist > range) { Log(Logs::Detail, Logs::Combat, "Ranged attack out of range... client should catch this. (%f > %f).\n", dist, range); - Message_StringID(Chat::Red,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. + MessageString(Chat::Red,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. return; } else if(dist < (RuleI(Combat, MinRangedAttackDist)*RuleI(Combat, MinRangedAttackDist))){ - Message_StringID(Chat::Yellow,RANGED_TOO_CLOSE);//Client enforces range and sends the message, this is a backup just incase. + MessageString(Chat::Yellow,RANGED_TOO_CLOSE);//Client enforces range and sends the message, this is a backup just incase. return; } @@ -1273,11 +1273,11 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 float dist = DistanceSquared(m_Position, other->GetPosition()); if(dist > range) { Log(Logs::Detail, Logs::Combat, "Throwing attack out of range... client should catch this. (%f > %f).\n", dist, range); - Message_StringID(Chat::Red,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. + MessageString(Chat::Red,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. return; } else if(dist < (RuleI(Combat, MinRangedAttackDist)*RuleI(Combat, MinRangedAttackDist))){ - Message_StringID(Chat::Yellow,RANGED_TOO_CLOSE);//Client enforces range and sends the message, this is a backup just incase. + MessageString(Chat::Yellow,RANGED_TOO_CLOSE);//Client enforces range and sends the message, this is a backup just incase. return; } @@ -1566,7 +1566,7 @@ void NPC::DoClassAttacks(Mob *target) { //general stuff, for all classes.... //only gets used when their primary ability get used too if (taunting && HasOwner() && target->IsNPC() && target->GetBodyType() != BT_Undead && taunt_time) { - this->GetOwner()->Message_StringID(Chat::PetResponse, PET_TAUNTING); + this->GetOwner()->MessageString(Chat::PetResponse, PET_TAUNTING); Taunt(target->CastToNPC(), false); } @@ -1898,7 +1898,7 @@ void Mob::Taunt(NPC *who, bool always_succeed, int chance_bonus, bool FromSpell, // Support for how taunt worked pre 2000 on LIVE - Can not taunt NPC over your level. if ((RuleB(Combat, TauntOverLevel) == false) && (level_difference < 0) || who->GetSpecialAbility(IMMUNE_TAUNT)) { - Message_StringID(Chat::SpellFailure, FAILED_TAUNT); + MessageString(Chat::SpellFailure, FAILED_TAUNT); return; } @@ -1955,10 +1955,10 @@ void Mob::Taunt(NPC *who, bool always_succeed, int chance_bonus, bool FromSpell, if (who->CanTalk()) who->Say_StringID(SUCCESSFUL_TAUNT, GetCleanName()); } else { - Message_StringID(Chat::SpellFailure, FAILED_TAUNT); + MessageString(Chat::SpellFailure, FAILED_TAUNT); } } else { - Message_StringID(Chat::SpellFailure, FAILED_TAUNT); + MessageString(Chat::SpellFailure, FAILED_TAUNT); } if (HasSkillProcs()) @@ -2003,7 +2003,7 @@ void Mob::InstillDoubt(Mob *who) { SpellOnTarget(229, who, false, true, -2000); //is there a success message? } else { - Message_StringID(Chat::LightBlue,NOT_SCARING); + MessageString(Chat::LightBlue,NOT_SCARING); //Idea from WR: /* if (target->IsNPC() && zone->random.Int(0,99) < 10 ) { entity_list.MessageClose(target, false, 50, Chat::NPCRampage, "%s lashes out in anger!",target->GetName()); @@ -2033,8 +2033,9 @@ int Mob::TryHeadShot(Mob *defender, EQEmu::skills::SkillType skillInUse) chance = chance * norm / 100; chance += aabonuses.HeadShot[0] + spellbonuses.HeadShot[0] + itembonuses.HeadShot[0]; if (zone->random.Int(1, 1000) <= chance) { - entity_list.MessageClose_StringID(this, false, 200, Chat::MeleeCrit, FATAL_BOW_SHOT, - GetName()); + entity_list.MessageCloseString( + this, false, 200, Chat::MeleeCrit, FATAL_BOW_SHOT, + GetName()); return HeadShot_Dmg; } } @@ -2078,8 +2079,9 @@ int Mob::TryAssassinate(Mob *defender, EQEmu::skills::SkillType skillInUse) if (Assassinate_Dmg && Assassinate_Level && (defender->GetLevel() <= Assassinate_Level)) { if (zone->random.Int(1, 1000) <= chance) { - entity_list.MessageClose_StringID(this, false, 200, Chat::MeleeCrit, ASSASSINATES, - GetName()); + entity_list.MessageCloseString( + this, false, 200, Chat::MeleeCrit, ASSASSINATES, + GetName()); return Assassinate_Dmg; } } diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index af5a63ffc..1f8acfa2f 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -471,7 +471,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(zone->random.Roll(RuleI(Spells, SuccorFailChance))) { //2% Fail chance by default if(IsClient()) { - CastToClient()->Message_StringID(Chat::SpellFailure,SUCCOR_FAIL); + CastToClient()->MessageString(Chat::SpellFailure,SUCCOR_FAIL); } break; } @@ -703,7 +703,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity)))))) { if (caster) - caster->Message_StringID(Chat::SpellFailure, IMMUNE_STUN); + caster->MessageString(Chat::SpellFailure, IMMUNE_STUN); } else { int stun_resist = itembonuses.StunResist+spellbonuses.StunResist; if (IsClient()) @@ -718,7 +718,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove Stun(effect_value); } else { if (IsClient()) - Message_StringID(Chat::Stun, SHAKE_OFF_STUN); + MessageString(Chat::Stun, SHAKE_OFF_STUN); Log(Logs::Detail, Logs::Combat, "Stun Resisted. We had %d percent resist chance.", stun_resist); } @@ -847,14 +847,14 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(ClosestMob) { - Message_StringID(Chat::Spells, MessageID); + MessageString(Chat::Spells, MessageID); SetHeading(CalculateHeadingToTarget(ClosestMob->GetX(), ClosestMob->GetY())); SetTarget(ClosestMob); CastToClient()->SendTargetCommand(ClosestMob->GetID()); SentPositionPacket(0.0f, 0.0f, 0.0f, 0.0f, 0, true); } else - Message_StringID(Chat::Red, SENSE_NOTHING); + MessageString(Chat::Red, SENSE_NOTHING); } } break; @@ -939,14 +939,14 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove { if(!zone->CanBind()) { - Message_StringID(Chat::SpellFailure, CANNOT_BIND); + MessageString(Chat::SpellFailure, CANNOT_BIND); break; } if(!zone->IsCity()) { if(caster != this) { - Message_StringID(Chat::SpellFailure, CANNOT_BIND); + MessageString(Chat::SpellFailure, CANNOT_BIND); break; } else @@ -1039,7 +1039,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(zone->random.Roll(effect_value)) Gate(spells[spell_id].base2[i] - 1); else if (caster) - caster->Message_StringID(Chat::SpellFailure,GATE_FAIL); + caster->MessageString(Chat::SpellFailure,GATE_FAIL); } break; } @@ -1051,7 +1051,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #endif if(GetSpecialAbility(UNDISPELLABLE)){ if (caster) - caster->Message_StringID(Chat::SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name); + caster->MessageString(Chat::SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name); break; } @@ -1077,7 +1077,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #endif if(GetSpecialAbility(UNDISPELLABLE)){ if (caster) - caster->Message_StringID(Chat::SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name); + caster->MessageString(Chat::SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name); break; } @@ -1103,7 +1103,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #endif if(GetSpecialAbility(UNDISPELLABLE)){ if (caster) - caster->Message_StringID(Chat::SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name); + caster->MessageString(Chat::SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name); break; } @@ -1235,7 +1235,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #endif if(GetPet()) { - Message_StringID(Chat::Shout, ONLY_ONE_PET); + MessageString(Chat::Shout, ONLY_ONE_PET); } else { @@ -1537,7 +1537,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove && caster && (!caster->IsNPC() || (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity))))) { if (caster) - caster->Message_StringID(Chat::Shout, IMMUNE_STUN); + caster->MessageString(Chat::Shout, IMMUNE_STUN); } else { @@ -1627,7 +1627,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if (zone->random.Int(0, 99) > spells[spell_id].base[i]) { CastToClient()->SetFeigned(false); - entity_list.MessageClose_StringID(this, false, 200, 10, STRING_FEIGNFAILED, GetName()); + entity_list.MessageCloseString(this, false, 200, 10, STRING_FEIGNFAILED, GetName()); } else { CastToClient()->SetFeigned(true); } @@ -1644,12 +1644,12 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove { if(caster == this) { - Message_StringID(Chat::Spells, + MessageString(Chat::Spells, SENTINEL_TRIG_YOU); } else { - caster->Message_StringID(Chat::Spells, + caster->MessageString(Chat::Spells, SENTINEL_TRIG_OTHER, GetCleanName()); } } @@ -1790,26 +1790,26 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove Corpse *corpse = entity_list.GetCorpseByOwner(TargetClient); if(corpse) { if(TargetClient == this->CastToClient()) - Message_StringID(Chat::LightBlue, SUMMONING_CORPSE, TargetClient->CastToMob()->GetCleanName()); + MessageString(Chat::LightBlue, SUMMONING_CORPSE, TargetClient->CastToMob()->GetCleanName()); else - Message_StringID(Chat::LightBlue, SUMMONING_CORPSE_OTHER, TargetClient->CastToMob()->GetCleanName()); + MessageString(Chat::LightBlue, SUMMONING_CORPSE_OTHER, TargetClient->CastToMob()->GetCleanName()); corpse->Summon(CastToClient(), true, true); } else { // No corpse found in the zone - Message_StringID(Chat::LightBlue, CORPSE_CANT_SENSE); + MessageString(Chat::LightBlue, CORPSE_CANT_SENSE); } } else if (caster) { char level[4]; ConvertArray(effect_value, level); - caster->Message_StringID(Chat::SpellFailure, + caster->MessageString(Chat::SpellFailure, SPELL_LEVEL_REQ, level); } } else { - Message_StringID(Chat::LightBlue, TARGET_NOT_FOUND); + MessageString(Chat::LightBlue, TARGET_NOT_FOUND); Log(Logs::General, Logs::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id); } } @@ -2725,7 +2725,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_MassGroupBuff:{ SetMGB(true); - Message_StringID(Chat::Disciplines, MGB_STRING); + MessageString(Chat::Disciplines, MGB_STRING); break; } @@ -3643,7 +3643,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster) case SE_Invisibility2: case SE_InvisVsUndead2: { if (buff.ticsremaining <= 3 && buff.ticsremaining > 1) { - Message_StringID(Chat::Spells, INVIS_BEGIN_BREAK); + MessageString(Chat::Spells, INVIS_BEGIN_BREAK); } break; } @@ -4047,7 +4047,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) if(p->IsPet()) notify = p->GetOwner(); if(p) { - notify->Message_StringID(Chat::SpellWornOff, SPELL_WORN_OFF_OF, + notify->MessageString(Chat::SpellWornOff, SPELL_WORN_OFF_OF, spells[buffs[slot].spellid].name, GetCleanName()); } } @@ -5406,7 +5406,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) default: break; } - Message_StringID(Chat::Spells, string_id, UsedItem->Name); + MessageString(Chat::Spells, string_id, UsedItem->Name); } } @@ -5814,9 +5814,15 @@ bool Mob::TryDeathSave() { Message(263, "The gods have healed you for %i points of damage.", HealAmt); if(spellbonuses.DeathSave[0] == 2) - entity_list.MessageClose_StringID(this, false, 200, Chat::MeleeCrit, DIVINE_INTERVENTION, GetCleanName()); + entity_list.MessageCloseString( + this, + false, + 200, + Chat::MeleeCrit, + DIVINE_INTERVENTION, + GetCleanName()); else - entity_list.MessageClose_StringID(this, false, 200, Chat::MeleeCrit, DEATH_PACT, GetCleanName()); + entity_list.MessageCloseString(this, false, 200, Chat::MeleeCrit, DEATH_PACT, GetCleanName()); SendHPUpdate(); BuffFadeBySlot(buffSlot); @@ -5847,9 +5853,15 @@ bool Mob::TryDeathSave() { Message(263, "The gods have healed you for %i points of damage.", HealAmt); if(spellbonuses.DeathSave[0] == 2) - entity_list.MessageClose_StringID(this, false, 200, Chat::MeleeCrit, DIVINE_INTERVENTION, GetCleanName()); + entity_list.MessageCloseString( + this, + false, + 200, + Chat::MeleeCrit, + DIVINE_INTERVENTION, + GetCleanName()); else - entity_list.MessageClose_StringID(this, false, 200, Chat::MeleeCrit, DEATH_PACT, GetCleanName()); + entity_list.MessageCloseString(this, false, 200, Chat::MeleeCrit, DEATH_PACT, GetCleanName()); SendHPUpdate(); BuffFadeBySlot(buffSlot); @@ -6802,11 +6814,11 @@ void Client::BreakFeignDeathWhenCastOn(bool IsResisted) chance *= 2; if(chance && (zone->random.Roll(chance))){ - Message_StringID(Chat::SpellFailure,FD_CAST_ON_NO_BREAK); + MessageString(Chat::SpellFailure,FD_CAST_ON_NO_BREAK); return; } SetFeigned(false); - Message_StringID(Chat::SpellFailure,FD_CAST_ON); + MessageString(Chat::SpellFailure,FD_CAST_ON); } } diff --git a/zone/spells.cpp b/zone/spells.cpp index 2b4056434..f6cf829c5 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -180,9 +180,9 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, Log(Logs::Detail, Logs::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d, amnesiad? %d", IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced(), IsAmnesiad() ); if(IsSilenced() && !IsDiscipline(spell_id)) - Message_StringID(Chat::Red, SILENCED_STRING); + MessageString(Chat::Red, SILENCED_STRING); if(IsAmnesiad() && IsDiscipline(spell_id)) - Message_StringID(Chat::Red, MELEE_SILENCE); + MessageString(Chat::Red, MELEE_SILENCE); if(IsClient()) CastToClient()->SendSpellBarEnable(spell_id); if(casting_spell_id && IsNPC()) @@ -197,7 +197,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, int chance = CastToClient()->GetFocusEffect(focusFcMute, spell_id);//Client only if (zone->random.Roll(chance)) { - Message_StringID(Chat::Red, SILENCED_STRING); + MessageString(Chat::Red, SILENCED_STRING); if(IsClient()) CastToClient()->SendSpellBarEnable(spell_id); return(false); @@ -205,7 +205,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, } if(IsDetrimentalSpell(spell_id) && !zone->CanDoCombat()){ - Message_StringID(Chat::Red, SPELL_WOULDNT_HOLD); + MessageString(Chat::Red, SPELL_WOULDNT_HOLD); if(IsClient()) CastToClient()->SendSpellBarEnable(spell_id); if(casting_spell_id && IsNPC()) @@ -257,7 +257,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item with an invalid class"); } else { - Message_StringID(Chat::Red, MUST_EQUIP_ITEM); + MessageString(Chat::Red, MUST_EQUIP_ITEM); } return(false); } @@ -276,7 +276,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, } else { - Message_StringID(Chat::Red, CANNOT_USE_ITEM); + MessageString(Chat::Red, CANNOT_USE_ITEM); } } return(false); @@ -289,7 +289,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item without equiping it"); } else { - Message_StringID(Chat::Red, MUST_EQUIP_ITEM); + MessageString(Chat::Red, MUST_EQUIP_ITEM); } return(false); } @@ -370,18 +370,18 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, Mob::SetMana(GetMana() - use_mana); // We send StopCasting which will update mana StopCasting(); - Message_StringID(Chat::SpellFailure, fizzle_msg); + MessageString(Chat::SpellFailure, fizzle_msg); /** * Song Failure message */ - entity_list.FilteredMessageClose_StringID( + entity_list.FilteredMessageCloseString( this, true, - RuleI(Range, SpellMessages), + RuleI(Range, SpellMessages), Chat::SpellFailure, (IsClient() ? FilterPCSpells : FilterNPCSpells), - (fizzle_msg == MISS_NOTE ? MISSED_NOTE_OTHER : SPELL_FIZZLE_OTHER), + (fizzle_msg == MISS_NOTE ? MISSED_NOTE_OTHER : SPELL_FIZZLE_OTHER), /* MessageFormat: You miss a note, bringing your song to a close! (if missed note) MessageFormat: A missed note brings %1's song to a close! @@ -428,7 +428,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, Log(Logs::Detail, Logs::Spells, "Spell Error: no target. spell=%d", spell_id); if(IsClient()) { //clients produce messages... npcs should not for this case - Message_StringID(Chat::Red, SPELL_NEED_TAR); + MessageString(Chat::Red, SPELL_NEED_TAR); InterruptSpell(); } else { InterruptSpell(0, 0, 0); //the 0 args should cause no messages @@ -461,7 +461,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, Log(Logs::Detail, Logs::Spells, "Spell Error not enough mana spell=%d mymana=%d cost=%d\n", spell_id, my_curmana, mana_cost); if(IsClient()) { //clients produce messages... npcs should not for this case - Message_StringID(Chat::Red, INSUFFICIENT_MANA); + MessageString(Chat::Red, INSUFFICIENT_MANA); InterruptSpell(); } else { InterruptSpell(0, 0, 0); //the 0 args should cause no messages @@ -518,7 +518,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, if (IsClient() && slot == CastingSlot::Item && item_slot != 0xFFFFFFFF) { auto item = CastToClient()->GetInv().GetItem(item_slot); if (item && item->GetItem()) - Message_StringID(Chat::Spells, BEGINS_TO_GLOW, item->GetItem()->Name); + MessageString(Chat::Spells, BEGINS_TO_GLOW, item->GetItem()->Name); } if (!DoCastingChecks()) { @@ -575,13 +575,13 @@ bool Mob::DoCastingChecks() if (spell_target && spells[spell_id].targettype != ST_Self && !spell_target->CheckSpellLevelRestriction(spell_id)) { Log(Logs::Detail, Logs::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); if (!IsBardSong(spell_id)) - Message_StringID(Chat::SpellFailure, SPELL_TOO_POWERFUL); + MessageString(Chat::SpellFailure, SPELL_TOO_POWERFUL); return false; } } if (spells[spell_id].zonetype == 1 && !zone->CanCastOutdoor()) { - Message_StringID(Chat::Red, CAST_OUTDOORS); + MessageString(Chat::Red, CAST_OUTDOORS); return false; } @@ -680,7 +680,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){ if (GetRawSkill(EQEmu::skills::SkillPercussionInstruments) > 0) // no skill increases if not trained in the instrument CheckIncreaseSkill(EQEmu::skills::SkillPercussionInstruments, nullptr, -15); else - Message_StringID(Chat::Red,NO_INSTRUMENT_SKILL); // tell the client that they need instrument training + MessageString(Chat::Red,NO_INSTRUMENT_SKILL); // tell the client that they need instrument training } else CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15); @@ -690,7 +690,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){ if (GetRawSkill(EQEmu::skills::SkillStringedInstruments) > 0) CheckIncreaseSkill(EQEmu::skills::SkillStringedInstruments, nullptr, -15); else - Message_StringID(Chat::Red,NO_INSTRUMENT_SKILL); + MessageString(Chat::Red,NO_INSTRUMENT_SKILL); } else CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15); @@ -700,7 +700,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){ if (GetRawSkill(EQEmu::skills::SkillWindInstruments) > 0) CheckIncreaseSkill(EQEmu::skills::SkillWindInstruments, nullptr, -15); else - Message_StringID(Chat::Red,NO_INSTRUMENT_SKILL); + MessageString(Chat::Red,NO_INSTRUMENT_SKILL); } else CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15); @@ -710,7 +710,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){ if (GetRawSkill(EQEmu::skills::SkillBrassInstruments) > 0) CheckIncreaseSkill(EQEmu::skills::SkillBrassInstruments, nullptr, -15); else - Message_StringID(Chat::Red,NO_INSTRUMENT_SKILL); + MessageString(Chat::Red,NO_INSTRUMENT_SKILL); } else CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15); @@ -861,7 +861,7 @@ void Mob::InterruptSpell(uint16 message, uint16 color, uint16 spellid) } if(casting_spell_aa_id && IsClient()) { //Rest AA Timer on failed cast - CastToClient()->Message_StringID(Chat::SpellFailure, ABILITY_FAILED); + CastToClient()->MessageString(Chat::SpellFailure, ABILITY_FAILED); CastToClient()->ResetAlternateAdvancementTimer(casting_spell_aa_id); } @@ -940,7 +940,7 @@ void Mob::StopCasting() if (IsClient()) { auto c = CastToClient(); if (casting_spell_aa_id) { //Rest AA Timer on failed cast - c->Message_StringID(Chat::SpellFailure, ABILITY_FAILED); + c->MessageString(Chat::SpellFailure, ABILITY_FAILED); c->ResetAlternateAdvancementTimer(casting_spell_aa_id); } @@ -969,7 +969,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo if(IsClient() && slot != CastingSlot::Item && slot != CastingSlot::PotionBelt && spells[spell_id].recast_time > 1000) { // 10 is item if(!CastToClient()->GetPTimers().Expired(&database, pTimerSpellStart + spell_id, false)) { //should we issue a message or send them a spell gem packet? - Message_StringID(Chat::Red, SPELL_RECAST); + MessageString(Chat::Red, SPELL_RECAST); Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: spell reuse timer not expired", spell_id); StopCasting(); return; @@ -983,7 +983,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo if(itm && itm->GetItem()->RecastDelay > 0) { if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + itm->GetItem()->RecastType), false)) { - Message_StringID(Chat::Red, SPELL_RECAST); + MessageString(Chat::Red, SPELL_RECAST); Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); StopCasting(); return; @@ -1015,7 +1015,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo if (casting_spell_id != spell_id) { Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: already casting", spell_id); - Message_StringID(Chat::Red,ALREADY_CASTING); + MessageString(Chat::Red,ALREADY_CASTING); InterruptSpell(); return; } @@ -1133,8 +1133,14 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo } // if we got here, we regained concentration regain_conc = true; - Message_StringID(Chat::Spells, REGAIN_AND_CONTINUE); - entity_list.MessageClose_StringID(this, true, RuleI(Range, SpellMessages), Chat::Spells, OTHER_REGAIN_CAST, this->GetCleanName()); + MessageString(Chat::Spells, REGAIN_AND_CONTINUE); + entity_list.MessageCloseString( + this, + true, + RuleI(Range, SpellMessages), + Chat::Spells, + OTHER_REGAIN_CAST, + this->GetCleanName()); } } @@ -1170,7 +1176,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo case 13000: if(itembonuses.percussionMod == 0) { // check for the appropriate instrument type HasInstrument = false; - c->Message_StringID(Chat::Red, SONG_NEEDS_DRUM); // send an error message if missing + c->MessageString(Chat::Red, SONG_NEEDS_DRUM); // send an error message if missing } break; @@ -1178,7 +1184,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo case 13001: if(itembonuses.windMod == 0) { HasInstrument = false; - c->Message_StringID(Chat::Red, SONG_NEEDS_WIND); + c->MessageString(Chat::Red, SONG_NEEDS_WIND); } break; @@ -1186,7 +1192,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo case 13011: if(itembonuses.stringedMod == 0) { HasInstrument = false; - c->Message_StringID(Chat::Red, SONG_NEEDS_STRINGS); + c->MessageString(Chat::Red, SONG_NEEDS_STRINGS); } break; @@ -1194,7 +1200,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo case 13012: if(itembonuses.brassMod == 0) { HasInstrument = false; - c->Message_StringID(Chat::Red, SONG_NEEDS_BRASS); + c->MessageString(Chat::Red, SONG_NEEDS_BRASS); } break; @@ -1222,13 +1228,13 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo { if (!missingreags) { - c->Message_StringID(Chat::Red, MISSING_SPELL_COMP); + c->MessageString(Chat::Red, MISSING_SPELL_COMP); missingreags=true; } const EQEmu::ItemData *item = database.GetItem(component); if(item) { - c->Message_StringID(Chat::Red, MISSING_SPELL_COMP_ITEM, item->Name); + c->MessageString(Chat::Red, MISSING_SPELL_COMP_ITEM, item->Name); Log(Logs::Detail, Logs::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component); } else { @@ -1324,7 +1330,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo if(IsClient() && fromaug && recastdelay > 0) { if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + recasttype), false)) { - Message_StringID(Chat::Red, SPELL_RECAST); + MessageString(Chat::Red, SPELL_RECAST); Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); StopCasting(); return; @@ -1502,7 +1508,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce targetType = ST_Target; if (spell_target && !spell_target->PassCastRestriction(true, spells[spell_id].CastRestriction)){ - Message_StringID(Chat::Red,SPELL_NEED_TAR); + MessageString(Chat::Red,SPELL_NEED_TAR); return false; } @@ -1512,7 +1518,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if (spell_target && ((spell_target->IsNPC() && spell_target->IsEngaged()) || (spell_target->IsClient() && spell_target->CastToClient()->GetAggroCount()))) { - Message_StringID(Chat::Red, SPELL_NO_EFFECT); // Unsure correct string + MessageString(Chat::Red, SPELL_NO_EFFECT); // Unsure correct string return false; } } @@ -1520,9 +1526,9 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce else if (IsBeneficialSpell(spell_id)) { if ((IsNPC() && IsEngaged()) || (IsClient() && CastToClient()->GetAggroCount())) { if (IsDiscipline(spell_id)) - Message_StringID(Chat::Red, NO_ABILITY_IN_COMBAT); + MessageString(Chat::Red, NO_ABILITY_IN_COMBAT); else - Message_StringID(Chat::Red, NO_CAST_IN_COMBAT); + MessageString(Chat::Red, NO_CAST_IN_COMBAT); return false; } @@ -1535,7 +1541,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if (spell_target && ((spell_target->IsNPC() && !spell_target->IsEngaged()) || (spell_target->IsClient() && !spell_target->CastToClient()->GetAggroCount()))) { - Message_StringID(Chat::Red, SPELL_NO_EFFECT); // Unsure correct string + MessageString(Chat::Red, SPELL_NO_EFFECT); // Unsure correct string return false; } } @@ -1543,9 +1549,9 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce else if (IsBeneficialSpell(spell_id)) { if ((IsNPC() && !IsEngaged()) || (IsClient() && !CastToClient()->GetAggroCount())) { if (IsDiscipline(spell_id)) - Message_StringID(Chat::Red, NO_ABILITY_OUT_OF_COMBAT); + MessageString(Chat::Red, NO_ABILITY_OUT_OF_COMBAT); else - Message_StringID(Chat::Red, NO_CAST_OUT_OF_COMBAT); + MessageString(Chat::Red, NO_CAST_OUT_OF_COMBAT); return false; } @@ -1582,9 +1588,9 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce //invalid target Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, mob_body); if(!spell_target) - Message_StringID(Chat::Red,SPELL_NEED_TAR); + MessageString(Chat::Red,SPELL_NEED_TAR); else - Message_StringID(Chat::Red,CANNOT_AFFECT_NPC); + MessageString(Chat::Red,CANNOT_AFFECT_NPC); return false; } CastAction = SingleTarget; @@ -1596,7 +1602,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { //invalid target Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, mob_body); - Message_StringID(Chat::Red,SPELL_NEED_TAR); + MessageString(Chat::Red,SPELL_NEED_TAR); return false; } CastAction = SingleTarget; @@ -1611,7 +1617,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (summoned pet)", spell_id, mob_body); - Message_StringID(Chat::Red, SPELL_NEED_TAR); + MessageString(Chat::Red, SPELL_NEED_TAR); return false; } @@ -1635,9 +1641,9 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce //invalid target Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (want body Type %d)", spell_id, mob_body, target_bt); if(!spell_target) - Message_StringID(Chat::Red,SPELL_NEED_TAR); + MessageString(Chat::Red,SPELL_NEED_TAR); else - Message_StringID(Chat::Red,CANNOT_AFFECT_NPC); + MessageString(Chat::Red,CANNOT_AFFECT_NPC); return false; } CastAction = SingleTarget; @@ -1652,7 +1658,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (ldon object)", spell_id); - Message_StringID(Chat::Red,SPELL_NEED_TAR); + MessageString(Chat::Red,SPELL_NEED_TAR); return false; } else @@ -1660,14 +1666,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target->IsNPC()) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (normal)", spell_id); - Message_StringID(Chat::Red,SPELL_NEED_TAR); + MessageString(Chat::Red,SPELL_NEED_TAR); return false; } if(spell_target->GetClass() != LDON_TREASURE) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (normal)", spell_id); - Message_StringID(Chat::Red,SPELL_NEED_TAR); + MessageString(Chat::Red,SPELL_NEED_TAR); return false; } } @@ -1676,7 +1682,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (normal)", spell_id); - Message_StringID(Chat::Red,SPELL_NEED_TAR); + MessageString(Chat::Red,SPELL_NEED_TAR); return false; // can't cast these unless we have a target } CastAction = SingleTarget; @@ -1692,7 +1698,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) message = SPELL_NEED_TAR; else if(!spell_target->IsCorpse()) message = ONLY_ON_CORPSES; else if(!spell_target->IsPlayerCorpse()) message = CORPSE_NOT_VALID; - Message_StringID(Chat::Red, message); + MessageString(Chat::Red, message); return false; } CastAction = SingleTarget; @@ -1704,7 +1710,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (no pet)", spell_id); - Message_StringID(Chat::Red,NO_PET); + MessageString(Chat::Red,NO_PET); return false; // can't cast these unless we have a target } CastAction = SingleTarget; @@ -1775,7 +1781,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (AOE)", spell_id); - Message_StringID(Chat::Red,SPELL_NEED_TAR); + MessageString(Chat::Red,SPELL_NEED_TAR); return false; } ae_center = spell_target; @@ -1800,7 +1806,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce } if (spell_target && spell_target->IsPet() && spells[spell_id].targettype == ST_GroupNoPets){ - Message_StringID(Chat::Red,NO_CAST_ON_PET); + MessageString(Chat::Red,NO_CAST_ON_PET); return false; } @@ -1812,7 +1818,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (Group Required: Single Target)", spell_id); - Message_StringID(Chat::Red,SPELL_NEED_TAR); + MessageString(Chat::Red,SPELL_NEED_TAR); return false; } @@ -1929,14 +1935,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(group_id_caster == 0 || group_id_target == 0) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); - Message_StringID(Chat::Red, TARGET_GROUP_MEMBER); + MessageString(Chat::Red, TARGET_GROUP_MEMBER); return false; } if(group_id_caster != group_id_target) { Log(Logs::Detail, Logs::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); - Message_StringID(Chat::Red, TARGET_GROUP_MEMBER); + MessageString(Chat::Red, TARGET_GROUP_MEMBER); return false; } @@ -2030,7 +2036,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui if( spells[spell_id].zonetype == 1 && !zone->CanCastOutdoor()){ if(IsClient()){ if(!CastToClient()->GetGM()){ - Message_StringID(Chat::Red, CAST_OUTDOORS); + MessageString(Chat::Red, CAST_OUTDOORS); return false; } } @@ -2112,14 +2118,14 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui if(!spells[spell_id].npc_no_los && spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target) && !IsHarmonySpell(spell_id) && spells[spell_id].targettype != ST_TargetOptional) { Log(Logs::Detail, Logs::Spells, "Spell %d: cannot see target %s", spell_id, spell_target->GetName()); - Message_StringID(Chat::Red,CANT_SEE_TARGET); + MessageString(Chat::Red,CANT_SEE_TARGET); return false; } // check to see if target is a caster mob before performing a mana tap if(spell_target && IsManaTapSpell(spell_id)) { if(spell_target->GetCasterClass() == 'N') { - Message_StringID(Chat::Red, TARGET_NO_MANA); + MessageString(Chat::Red, TARGET_NO_MANA); return false; } } @@ -2143,13 +2149,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui if(dist2 > range2) { //target is out of range. Log(Logs::Detail, Logs::Spells, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); - Message_StringID(Chat::Red, TARGET_OUT_OF_RANGE); + MessageString(Chat::Red, TARGET_OUT_OF_RANGE); return(false); } else if (dist2 < min_range2){ //target is too close range. Log(Logs::Detail, Logs::Spells, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2); - Message_StringID(Chat::Red, TARGET_TOO_CLOSE); + MessageString(Chat::Red, TARGET_TOO_CLOSE); return(false); } @@ -2164,13 +2170,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui if(dist2 > range2) { //target is out of range. Log(Logs::Detail, Logs::Spells, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); - Message_StringID(Chat::Red, TARGET_OUT_OF_RANGE); + MessageString(Chat::Red, TARGET_OUT_OF_RANGE); return(false); } else if (dist2 < min_range2){ //target is too close range. Log(Logs::Detail, Logs::Spells, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2); - Message_StringID(Chat::Red, TARGET_TOO_CLOSE); + MessageString(Chat::Red, TARGET_TOO_CLOSE); return(false); } @@ -2520,7 +2526,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, CastingSlot slo if(spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target)) { Log(Logs::Detail, Logs::Spells, "Bard Song Pulse %d: cannot see target %s", spell_target->GetName()); - Message_StringID(Chat::Red, CANT_SEE_TARGET); + MessageString(Chat::Red, CANT_SEE_TARGET); return(false); } @@ -2535,7 +2541,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, CastingSlot slo if(dist2 > range2) { //target is out of range. Log(Logs::Detail, Logs::Spells, "Bard Song Pulse %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); - Message_StringID(Chat::Red, TARGET_OUT_OF_RANGE); + MessageString(Chat::Red, TARGET_OUT_OF_RANGE); return(false); } } @@ -2894,7 +2900,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, if (spellbonuses.Screech == 1) { if (effect2 == SE_Screech && sp2.base[i] == -1) { - Message_StringID(Chat::SpellFailure, SCREECH_BUFF_BLOCK, sp2.name); + MessageString(Chat::SpellFailure, SCREECH_BUFF_BLOCK, sp2.name); return -1; } } @@ -3425,7 +3431,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r if(IsDetrimentalSpell(spell_id) && !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id)) { if(!IsClient() || !CastToClient()->GetGM()) { - Message_StringID(Chat::SpellFailure, SPELL_NO_HOLD); + MessageString(Chat::SpellFailure, SPELL_NO_HOLD); return false; } } @@ -3590,7 +3596,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r { if(spelltar->invisible) { - spelltar->Message_StringID(Chat::SpellFailure, ALREADY_INVIS, GetCleanName()); + spelltar->MessageString(Chat::SpellFailure, ALREADY_INVIS, GetCleanName()); safe_delete(action_packet); return false; } @@ -3600,7 +3606,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r { if(spelltar->invisible_undead) { - spelltar->Message_StringID(Chat::SpellFailure, ALREADY_INVIS, GetCleanName()); + spelltar->MessageString(Chat::SpellFailure, ALREADY_INVIS, GetCleanName()); safe_delete(action_packet); return false; } @@ -3610,7 +3616,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r { if(spelltar->invisible_animals) { - spelltar->Message_StringID(Chat::SpellFailure, ALREADY_INVIS, GetCleanName()); + spelltar->MessageString(Chat::SpellFailure, ALREADY_INVIS, GetCleanName()); safe_delete(action_packet); return false; } @@ -3690,7 +3696,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r Log(Logs::Detail, Logs::Spells, "Beneficial ae bard song %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); } else { Log(Logs::Detail, Logs::Spells, "Beneficial spell %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); - Message_StringID(Chat::SpellFailure, SPELL_NO_HOLD); + MessageString(Chat::SpellFailure, SPELL_NO_HOLD); } safe_delete(action_packet); return false; @@ -3700,7 +3706,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r else if ( !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id)) // Detrimental spells - PVP check { Log(Logs::Detail, Logs::Spells, "Detrimental spell %d can't take hold %s -> %s", spell_id, GetName(), spelltar->GetName()); - spelltar->Message_StringID(Chat::SpellFailure, YOU_ARE_PROTECTED, GetCleanName()); + spelltar->MessageString(Chat::SpellFailure, YOU_ARE_PROTECTED, GetCleanName()); safe_delete(action_packet); return false; } @@ -3737,7 +3743,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r focus = CalcFocusEffect(focusBlockNextSpell, buffs[b].spellid, spell_id); if(focus) { CheckNumHitsRemaining(NumHit::MatchingSpells, b); - Message_StringID(Chat::SpellFailure, SPELL_WOULDNT_HOLD); + MessageString(Chat::SpellFailure, SPELL_WOULDNT_HOLD); safe_delete(action_packet); return false; } @@ -3786,7 +3792,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r if (reflect_chance) { if (RuleB(Spells, ReflectMessagesClose)) { - entity_list.MessageClose_StringID( + entity_list.MessageCloseString( this, /* Sender */ false, /* Skip Sender */ RuleI(Range, SpellMessages), /* Range */ @@ -3797,7 +3803,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r ); } else { - Message_StringID(Chat::Spells, SPELL_REFLECT, GetCleanName(), spelltar->GetCleanName()); + MessageString(Chat::Spells, SPELL_REFLECT, GetCleanName(), spelltar->GetCleanName()); } CheckNumHitsRemaining(NumHit::ReflectSpell); @@ -3829,12 +3835,12 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r Log(Logs::Detail, Logs::Spells, "Spell %d was completely resisted by %s", spell_id, spelltar->GetName()); if (spells[spell_id].resisttype == RESIST_PHYSICAL){ - Message_StringID(Chat::SpellFailure, PHYSICAL_RESIST_FAIL,spells[spell_id].name); - spelltar->Message_StringID(Chat::SpellFailure, YOU_RESIST, spells[spell_id].name); + MessageString(Chat::SpellFailure, PHYSICAL_RESIST_FAIL,spells[spell_id].name); + spelltar->MessageString(Chat::SpellFailure, YOU_RESIST, spells[spell_id].name); } else { - Message_StringID(Chat::SpellFailure, TARGET_RESISTED, spells[spell_id].name); - spelltar->Message_StringID(Chat::SpellFailure, YOU_RESIST, spells[spell_id].name); + MessageString(Chat::SpellFailure, TARGET_RESISTED, spells[spell_id].name); + spelltar->MessageString(Chat::SpellFailure, YOU_RESIST, spells[spell_id].name); } if (spelltar->IsAIControlled()) { @@ -3899,7 +3905,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r { Log(Logs::Detail, Logs::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); if(!IsBardSong(spell_id)) - Message_StringID(Chat::SpellFailure, SPELL_TOO_POWERFUL); + MessageString(Chat::SpellFailure, SPELL_TOO_POWERFUL); safe_delete(action_packet); return false; } @@ -3911,7 +3917,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r // spell. It's most likely a buff that can't stack. Log(Logs::Detail, Logs::Spells, "Spell %d could not apply its effects %s -> %s\n", spell_id, GetName(), spelltar->GetName()); if(casting_spell_aa_id) - Message_StringID(Chat::SpellFailure, SPELL_NO_HOLD); + MessageString(Chat::SpellFailure, SPELL_NO_HOLD); safe_delete(action_packet); return false; } @@ -3998,7 +4004,7 @@ void Corpse::CastRezz(uint16 spellid, Mob* Caster) /* if(!can_rez) { if(Caster && Caster->IsClient()) - Caster->Message_StringID(Chat::WhiteSmoke, CORPSE_TOO_OLD); + Caster->MessageString(Chat::WhiteSmoke, CORPSE_TOO_OLD); return; } */ @@ -4226,7 +4232,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(GetSpecialAbility(UNMEZABLE)) { Log(Logs::Detail, Logs::Spells, "We are immune to Mez spells."); - caster->Message_StringID(Chat::SpellFailure, CANNOT_MEZ); + caster->MessageString(Chat::SpellFailure, CANNOT_MEZ); int32 aggro = caster->CheckAggroAmount(spell_id, this); if(aggro > 0) { AddToHateList(caster, aggro); @@ -4244,7 +4250,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) (!caster->IsNPC() || (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity)))) { Log(Logs::Detail, Logs::Spells, "Our level (%d) is higher than the limit of this Mez spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); - caster->Message_StringID(Chat::SpellFailure, CANNOT_MEZ_WITH_SPELL); + caster->MessageString(Chat::SpellFailure, CANNOT_MEZ_WITH_SPELL); AddToHateList(caster, 1,0,true,false,false,spell_id); return true; } @@ -4254,7 +4260,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(GetSpecialAbility(UNSLOWABLE) && IsEffectInSpell(spell_id, SE_AttackSpeed)) { Log(Logs::Detail, Logs::Spells, "We are immune to Slow spells."); - caster->Message_StringID(Chat::Red, IMMUNE_ATKSPEED); + caster->MessageString(Chat::Red, IMMUNE_ATKSPEED); int32 aggro = caster->CheckAggroAmount(spell_id, this); if(aggro > 0) { AddToHateList(caster, aggro); @@ -4270,7 +4276,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) effect_index = GetSpellEffectIndex(spell_id, SE_Fear); if(GetSpecialAbility(UNFEARABLE)) { Log(Logs::Detail, Logs::Spells, "We are immune to Fear spells."); - caster->Message_StringID(Chat::Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up + caster->MessageString(Chat::Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up int32 aggro = caster->CheckAggroAmount(spell_id, this); if(aggro > 0) { AddToHateList(caster, aggro); @@ -4281,13 +4287,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) } else if(IsClient() && caster->IsClient() && (caster->CastToClient()->GetGM() == false)) { Log(Logs::Detail, Logs::Spells, "Clients cannot fear eachother!"); - caster->Message_StringID(Chat::Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up + caster->MessageString(Chat::Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up return true; } else if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) { Log(Logs::Detail, Logs::Spells, "Level is %d, cannot be feared by this spell.", GetLevel()); - caster->Message_StringID(Chat::Shout, FEAR_TOO_HIGH); + caster->MessageString(Chat::Shout, FEAR_TOO_HIGH); int32 aggro = caster->CheckAggroAmount(spell_id, this); if (aggro > 0) { AddToHateList(caster, aggro); @@ -4300,7 +4306,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { Message(Chat::Red, "Your are immune to fear."); Log(Logs::Detail, Logs::Spells, "Clients has WarCry effect, immune to fear!"); - caster->Message_StringID(Chat::Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up + caster->MessageString(Chat::Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up return true; } } @@ -4310,7 +4316,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(GetSpecialAbility(UNCHARMABLE)) { Log(Logs::Detail, Logs::Spells, "We are immune to Charm spells."); - caster->Message_StringID(Chat::Red, CANNOT_CHARM); // need to verify message type, not in MQ2Cast for easy look up + caster->MessageString(Chat::Red, CANNOT_CHARM); // need to verify message type, not in MQ2Cast for easy look up int32 aggro = caster->CheckAggroAmount(spell_id, this); if(aggro > 0) { AddToHateList(caster, aggro); @@ -4336,7 +4342,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) { Log(Logs::Detail, Logs::Spells, "Our level (%d) is higher than the limit of this Charm spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); - caster->Message_StringID(Chat::Red, CANNOT_CHARM_YET); // need to verify message type, not in MQ2Cast for easy look up + caster->MessageString(Chat::Red, CANNOT_CHARM_YET); // need to verify message type, not in MQ2Cast for easy look up AddToHateList(caster, 1,0,true,false,false,spell_id); return true; } @@ -4351,7 +4357,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(GetSpecialAbility(UNSNAREABLE)) { Log(Logs::Detail, Logs::Spells, "We are immune to Snare spells."); - caster->Message_StringID(Chat::Red, IMMUNE_MOVEMENT); + caster->MessageString(Chat::Red, IMMUNE_MOVEMENT); int32 aggro = caster->CheckAggroAmount(spell_id, this); if(aggro > 0) { AddToHateList(caster, aggro); @@ -4367,7 +4373,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(this == caster) { Log(Logs::Detail, Logs::Spells, "You cannot lifetap yourself."); - caster->Message_StringID(Chat::SpellFailure, CANT_DRAIN_SELF); + caster->MessageString(Chat::SpellFailure, CANT_DRAIN_SELF); return true; } } @@ -4377,7 +4383,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(this == caster) { Log(Logs::Detail, Logs::Spells, "You cannot sacrifice yourself."); - caster->Message_StringID(Chat::SpellFailure, CANNOT_SAC_SELF); + caster->MessageString(Chat::SpellFailure, CANNOT_SAC_SELF); return true; } } diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 07e6da7fb..9230871c8 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -304,12 +304,12 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob user->DeleteItemInInventory(EQEmu::InventoryProfile::CalcSlotId(in_combine->container_slot, 0), 0, true); container->Clear(); user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), EQEmu::invslot::slotCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2)); - user->Message_StringID(Chat::LightBlue, TRANSFORM_COMPLETE, inst->GetItem()->Name); + user->MessageString(Chat::LightBlue, TRANSFORM_COMPLETE, inst->GetItem()->Name); if (RuleB(Inventory, DeleteTransformationMold)) user->DeleteItemInInventory(in_combine->container_slot, 0, true); } else if (inst) { - user->Message_StringID(Chat::LightBlue, TRANSFORM_FAILED, inst->GetItem()->Name); + user->MessageString(Chat::LightBlue, TRANSFORM_FAILED, inst->GetItem()->Name); } auto outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0); user->QueuePacket(outapp); @@ -324,10 +324,10 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob user->DeleteItemInInventory(EQEmu::InventoryProfile::CalcSlotId(in_combine->container_slot, 0), 0, true); container->Clear(); user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), EQEmu::invslot::slotCursor, 0, 0); - user->Message_StringID(Chat::LightBlue, TRANSFORM_COMPLETE, inst->GetItem()->Name); + user->MessageString(Chat::LightBlue, TRANSFORM_COMPLETE, inst->GetItem()->Name); } else if (inst) { - user->Message_StringID(Chat::LightBlue, DETRANSFORM_FAILED, inst->GetItem()->Name); + user->MessageString(Chat::LightBlue, DETRANSFORM_FAILED, inst->GetItem()->Name); } auto outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0); user->QueuePacket(outapp); @@ -337,7 +337,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob DBTradeskillRecipe_Struct spec; if (!database.GetTradeRecipe(container, c_type, some_id, user->CharacterID(), &spec)) { - user->Message_StringID(Chat::Emote,TRADESKILL_NOCOMBINE); + user->MessageString(Chat::Emote,TRADESKILL_NOCOMBINE); auto outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0); user->QueuePacket(outapp); safe_delete(outapp); @@ -422,7 +422,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob // Update Made count if (success) { if (!spec.has_learnt && ((spec.must_learn&0x10) != 0x10)) { - user->Message_StringID(Chat::LightBlue, TRADESKILL_LEARN_RECIPE, spec.name.c_str()); + user->MessageString(Chat::LightBlue, TRADESKILL_LEARN_RECIPE, spec.name.c_str()); } database.UpdateRecipeMadecount(spec.recipe_id, user->CharacterID(), spec.madecount+1); } @@ -540,13 +540,13 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac safe_delete(outapp); - user->Message_StringID(Chat::Skills, TRADESKILL_MISSING_COMPONENTS); + user->MessageString(Chat::Skills, TRADESKILL_MISSING_COMPONENTS); for (auto it = MissingItems.begin(); it != MissingItems.end(); ++it) { const EQEmu::ItemData* item = database.GetItem(*it); if(item) - user->Message_StringID(Chat::Skills, TRADESKILL_MISSING_ITEM, item->Name); + user->MessageString(Chat::Skills, TRADESKILL_MISSING_ITEM, item->Name); } return; @@ -593,7 +593,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac if (success) { if (!spec.has_learnt && ((spec.must_learn & 0x10) != 0x10)) { - user->Message_StringID(Chat::LightBlue, TRADESKILL_LEARN_RECIPE, spec.name.c_str()); + user->MessageString(Chat::LightBlue, TRADESKILL_LEARN_RECIPE, spec.name.c_str()); } database.UpdateRecipeMadecount(spec.recipe_id, user->CharacterID(), spec.madecount+1); } @@ -951,7 +951,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { // above critical still stands. // Mastery modifier is: 10%/25%/50% for rank one/two/three chance = 95.0f + (float(user_skill - spec->trivial) / 40.0f); - Message_StringID(Chat::Emote, TRADESKILL_TRIVIAL); + MessageString(Chat::Emote, TRADESKILL_TRIVIAL); } else if(chance < 5) { // Minimum chance is always 5 chance = 5; @@ -978,7 +978,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { if(over_trivial < 0) CheckIncreaseTradeskill(bonusstat, stat_modifier, skillup_modifier, success_modifier, spec->tradeskill); - Message_StringID(Chat::LightBlue, TRADESKILL_SUCCEED, spec->name.c_str()); + MessageString(Chat::LightBlue, TRADESKILL_SUCCEED, spec->name.c_str()); Log(Logs::Detail, Logs::Tradeskills, "Tradeskill success"); @@ -1010,7 +1010,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { if(over_trivial < 0) CheckIncreaseTradeskill(bonusstat, stat_modifier, skillup_modifier, success_modifier, spec->tradeskill); - Message_StringID(Chat::Emote,TRADESKILL_FAILED); + MessageString(Chat::Emote,TRADESKILL_FAILED); Log(Logs::Detail, Logs::Tradeskills, "Tradeskill failed"); if (this->GetGroup()) @@ -1404,7 +1404,7 @@ void Client::LearnRecipe(uint32 recipeID) if (row[1] != nullptr) return; - Message_StringID(Chat::LightBlue, TRADESKILL_LEARN_RECIPE, row[0]); + MessageString(Chat::LightBlue, TRADESKILL_LEARN_RECIPE, row[0]); // Actually learn the recipe now query = StringFormat("INSERT INTO char_recipe_list " "SET recipe_id = %u, char_id = %u, madecount = 0 " diff --git a/zone/trading.cpp b/zone/trading.cpp index 80e5dc851..2d8f03e4f 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -2475,7 +2475,7 @@ void Client::ShowBuyLines(const EQApplicationPacket *app) { QueuePacket(app); if(bir->Approval == 0) { - Message_StringID(Chat::Yellow, TRADER_BUSY); + MessageString(Chat::Yellow, TRADER_BUSY); return; } diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 6493188bf..4d1399f68 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -211,7 +211,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) else if (scm->queued == 2) // tell queue was full client->Tell_StringID(QUEUE_TELL_FULL, scm->to, scm->message); else if (scm->queued == 3) // person was offline - client->Message_StringID(Chat::EchoTell, TOLD_NOT_ONLINE, scm->to); + client->MessageString(Chat::EchoTell, TOLD_NOT_ONLINE, scm->to); else // normal tell echo "You told Soanso, 'something'" // tell echo doesn't use language, so it looks normal to you even if nobody can understand your tells client->ChannelMessageSend(scm->from, scm->to, scm->chan_num, 0, 100, scm->message); @@ -414,7 +414,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) Client* client = entity_list.GetClientByID(wars->id); if (client) { if (pack->size == 64)//no results - client->Message_StringID(Chat::White, WHOALL_NO_RESULTS); + client->MessageString(Chat::White, WHOALL_NO_RESULTS); else { auto outapp = new EQApplicationPacket(OP_WhoAllResponse, pack->size); memcpy(outapp->pBuffer, pack->pBuffer, pack->size); @@ -783,7 +783,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) Client* c = entity_list.GetClientByName(Rezzer); if (c) - c->Message_StringID(Chat::SpellWornOff, REZZ_ALREADY_PENDING); + c->MessageString(Chat::SpellWornOff, REZZ_ALREADY_PENDING); break; } @@ -1485,7 +1485,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) ServerOP_Consent_Struct* s = (ServerOP_Consent_Struct*)pack->pBuffer; Client* client = entity_list.GetClientByName(s->ownername); if (client) { - client->Message_StringID(Chat::White, s->message_string_id); + client->MessageString(Chat::White, s->message_string_id); } break; } @@ -1729,7 +1729,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) if (c) { c->ClearPendingAdventureDoorClick(); - c->Message_StringID(Chat::Red, 5141); + c->MessageString(Chat::Red, 5141); } break; } diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 869ef4eb4..5950d4025 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -723,7 +723,7 @@ void Client::Gate(uint8 bindnum) { } void NPC::Gate(uint8 bindnum) { - entity_list.MessageClose_StringID(this, true, RuleI(Range, SpellMessages), Chat::Spells, GATES, GetCleanName()); + entity_list.MessageCloseString(this, true, RuleI(Range, SpellMessages), Chat::Spells, GATES, GetCleanName()); Mob::Gate(bindnum); } From a28ea6419fe32d6acb2e8485f9d2355ce27aa29b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 11 Aug 2019 00:14:34 -0500 Subject: [PATCH 3/7] Beginning of #npceditmass --- zone/command.cpp | 842 +++++++++++++++++++++++++++-------------------- zone/command.h | 1 + 2 files changed, 478 insertions(+), 365 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index d95f07e8a..cf6cc6d6b 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #ifdef _WINDOWS #define strcasecmp _stricmp @@ -105,7 +106,7 @@ LinkedList cleanup_commandlist; */ int command_notavail(Client *c, const char *message) { - c->Message(13, "Commands not available."); + c->Message(Chat::Red, "Commands not available."); return -1; } @@ -151,7 +152,7 @@ Access Levels: int command_init(void) { commandaliases.clear(); - + if ( command_add("acceptrules", "[acceptrules] - Accept the EQEmu Agreement", 0, command_acceptrules) || command_add("advnpcspawn", "[maketype|makegroup|addgroupentry|addgroupspawn][removegroupspawn|movespawn|editgroupbox|cleargroupbox]", 150, command_advnpcspawn) || @@ -282,6 +283,7 @@ int command_init(void) command_add("network", "- Admin commands for the udp network interface.", 250, command_network) || command_add("npccast", "[targetname/entityid] [spellid] - Causes NPC target to cast spellid on targetname/entityid", 80, command_npccast) || command_add("npcedit", "[column] [value] - Mega NPC editing command", 100, command_npcedit) || + command_add("npceditmass", "[name-search] [column] [value] - Mass (Zone wide) NPC data editing command", 100, command_npceditmass) || command_add("npcemote", "[message] - Make your NPC target emote a message.", 150, command_npcemote) || command_add("npcloot", "[show/money/add/remove] [itemid/all/money: pp gp sp cp] - Manipulate the loot an NPC is carrying", 80, command_npcloot) || command_add("npcsay", "[message] - Make your NPC target say a message.", 150, command_npcsay) || @@ -445,7 +447,7 @@ int command_init(void) command_deinit(); return -1; } - + std::map>> command_settings; database.GetCommandSettings(command_settings); @@ -572,7 +574,7 @@ int command_realdispatch(Client *c, const char *message) CommandRecord *cur = commandlist[cstr]; if(c->Admin() < cur->access){ - c->Message(13,"Your access level is not high enough to use this command."); + c->Message(Chat::Red,"Your access level is not high enough to use this command."); return(-1); } @@ -691,7 +693,7 @@ void command_incstat(Client* c, const Seperator* sep){ void command_resetaa(Client* c,const Seperator *sep) { if(c->GetTarget() && c->GetTarget()->IsClient()){ c->GetTarget()->CastToClient()->ResetAA(); - c->Message(13,"Successfully reset %s's AAs", c->GetTarget()->GetName()); + c->Message(Chat::Red,"Successfully reset %s's AAs", c->GetTarget()->GetName()); } else c->Message(0,"Usage: Target a client and use #resetaa to reset the AA data in their Profile."); @@ -739,7 +741,7 @@ void command_setfaction(Client *c, const Seperator *sep) } auto npcTypeID = c->GetTarget()->CastToNPC()->GetNPCTypeID(); - c->Message(15,"Setting NPC %u to faction %i", npcTypeID, atoi(sep->argplus[1])); + c->Message(Chat::Yellow,"Setting NPC %u to faction %i", npcTypeID, atoi(sep->argplus[1])); std::string query = StringFormat("UPDATE npc_types SET npc_faction_id = %i WHERE id = %i", atoi(sep->argplus[1]), npcTypeID); @@ -763,7 +765,7 @@ void command_wc(Client *c, const Seperator *sep) ); } else if (c->GetTarget() == nullptr) { - c->Message(13, "You must have a target to do a wear change."); + c->Message(Chat::Red, "You must have a target to do a wear change."); } else { uint32 hero_forge_model = 0; @@ -802,7 +804,7 @@ void command_heromodel(Client *c, const Seperator *sep) c->Message(0, "Usage: #heromodel [hero forge model] [ [slot] ] (example: #heromodel 63)"); } else if (c->GetTarget() == nullptr) { - c->Message(13, "You must have a target to do a wear change for Hero's Forge Models."); + c->Message(Chat::Red, "You must have a target to do a wear change for Hero's Forge Models."); } else { uint32 hero_forge_model = atoi(sep->arg[1]); @@ -823,7 +825,7 @@ void command_heromodel(Client *c, const Seperator *sep) } } else { - c->Message(13, "Hero's Forge Model must be greater than 0."); + c->Message(Chat::Red, "Hero's Forge Model must be greater than 0."); } } } @@ -1192,7 +1194,7 @@ void command_peqzone(Client *c, const Seperator *sep) uint32 timeleft = c->GetPTimers().GetRemainingTime(pTimerPeqzoneReuse)/60; if(!c->GetPTimers().Expired(&database, pTimerPeqzoneReuse, false)) { - c->Message(13,"You must wait %i minute(s) before using this ability again.", timeleft); + c->Message(Chat::Red,"You must wait %i minute(s) before using this ability again.", timeleft); return; } @@ -1221,11 +1223,11 @@ void command_peqzone(Client *c, const Seperator *sep) zoneid = atoi(sep->arg[1]); destzone = database.GetPEQZone(zoneid, 0); if(destzone == 0){ - c->Message(13, "You cannot use this command to enter that zone!"); + c->Message(Chat::Red, "You cannot use this command to enter that zone!"); return; } if(zoneid == zone->GetZoneID()) { - c->Message(13, "You cannot use this command on the zone you are in!"); + c->Message(Chat::Red, "You cannot use this command on the zone you are in!"); return; } } @@ -1243,11 +1245,11 @@ void command_peqzone(Client *c, const Seperator *sep) return; } if(destzone == 0){ - c->Message(13, "You cannot use this command to enter that zone!"); + c->Message(Chat::Red, "You cannot use this command to enter that zone!"); return; } if(zoneid == zone->GetZoneID()) { - c->Message(13, "You cannot use this command on the zone you are in!"); + c->Message(Chat::Red, "You cannot use this command on the zone you are in!"); return; } } @@ -1279,7 +1281,7 @@ void command_movechar(Client *c, const Seperator *sep) else c->Message(0, "Character has been moved."); else - c->Message(13,"You cannot move characters that are not on your account."); + c->Message(Chat::Red,"You cannot move characters that are not on your account."); } else c->Message(0, "Character Does Not Exist"); @@ -1365,7 +1367,7 @@ void command_viewpetition(Client *c, const Seperator *sep) return; } - c->Message(13," ID : Character Name , Petition Text"); + c->Message(Chat::Red," ID : Character Name , Petition Text"); std::string query = "SELECT petid, charname, petitiontext FROM petitions ORDER BY petid"; auto results = database.QueryDatabase(query); @@ -1375,13 +1377,13 @@ void command_viewpetition(Client *c, const Seperator *sep) Log(Logs::General, Logs::Normal, "View petition request from %s, petition number: %i", c->GetName(), atoi(sep->argplus[1]) ); if (results.RowCount() == 0) { - c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again."); + c->Message(Chat::Red,"There was an error in your request: ID not found! Please check the Id and try again."); return; } for (auto row = results.begin(); row != results.end(); ++row) if (strcasecmp(row[0], sep->argplus[1]) == 0) - c->Message(15, " %s: %s , %s ", row[0], row[1], row[2]); + c->Message(Chat::Yellow, " %s: %s , %s ", row[0], row[1], row[2]); } @@ -1400,13 +1402,13 @@ void command_petitioninfo(Client *c, const Seperator *sep) Log(Logs::General, Logs::Normal, "Petition information request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); if (results.RowCount() == 0) { - c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again."); + c->Message(Chat::Red,"There was an error in your request: ID not found! Please check the Id and try again."); return; } for (auto row = results.begin(); row != results.end(); ++row) if (strcasecmp(row[0],sep->argplus[1])== 0) - c->Message(13," ID : %s Character Name: %s Account Name: %s Zone: %s Character Class: %s Character Race: %s Character Level: %s", row[0],row[1],row[2],row[3],row[4],row[5],row[6]); + c->Message(Chat::Red," ID : %s Character Name: %s Account Name: %s Zone: %s Character Class: %s Character Race: %s Character Level: %s", row[0],row[1],row[2],row[3],row[4],row[5],row[6]); } @@ -1417,7 +1419,7 @@ void command_delpetition(Client *c, const Seperator *sep) return; } - c->Message(13,"Attempting to delete petition number: %i", atoi(sep->argplus[1])); + c->Message(Chat::Red,"Attempting to delete petition number: %i", atoi(sep->argplus[1])); std::string query = StringFormat("DELETE FROM petitions WHERE petid = %i", atoi(sep->argplus[1])); auto results = database.QueryDatabase(query); if (!results.Success()) @@ -1696,7 +1698,7 @@ void command_date(Client *c, const Seperator *sep) { //yyyy mm dd hh mm local if(sep->arg[3][0]==0 || !sep->IsNumber(1) || !sep->IsNumber(2) || !sep->IsNumber(3)) { - c->Message(13, "Usage: #date yyyy mm dd [HH MM]"); + c->Message(Chat::Red, "Usage: #date yyyy mm dd [HH MM]"); } else { int h=0, m=0; @@ -1710,7 +1712,7 @@ void command_date(Client *c, const Seperator *sep) m=eqTime.minute; else m=atoi(sep->arg[5]); - c->Message(13, "Setting world time to %s-%s-%s %i:%i...", sep->arg[1], sep->arg[2], sep->arg[3], h, m); + c->Message(Chat::Red, "Setting world time to %s-%s-%s %i:%i...", sep->arg[1], sep->arg[2], sep->arg[3], h, m); zone->SetDate(atoi(sep->arg[1]), atoi(sep->arg[2]), atoi(sep->arg[3]), h, m); } } @@ -1718,15 +1720,15 @@ void command_date(Client *c, const Seperator *sep) void command_timezone(Client *c, const Seperator *sep) { if(sep->arg[1][0]==0 && !sep->IsNumber(1)) { - c->Message(13, "Usage: #timezone HH [MM]"); - c->Message(13, "Current timezone is: %ih %im", zone->zone_time.getEQTimeZoneHr(), zone->zone_time.getEQTimeZoneMin()); + c->Message(Chat::Red, "Usage: #timezone HH [MM]"); + c->Message(Chat::Red, "Current timezone is: %ih %im", zone->zone_time.getEQTimeZoneHr(), zone->zone_time.getEQTimeZoneMin()); } else { uint8 hours = atoi(sep->arg[1]); uint8 minutes = atoi(sep->arg[2]); if(!sep->IsNumber(2)) minutes = 0; - c->Message(13, "Setting timezone to %i h %i m", hours, minutes); + c->Message(Chat::Red, "Setting timezone to %i h %i m", hours, minutes); uint32 ntz=(hours*60)+minutes; zone->zone_time.setEQTimeZone(ntz); database.SetZoneTZ(zone->GetZoneID(), zone->GetInstanceVersion(), ntz); @@ -1765,7 +1767,7 @@ void command_hideme(Client *c, const Seperator *sep) else { c->SetHideMe(state); - c->Message_StringID(MT_Broadcasts, c->GetHideMe() ? NOW_INVISIBLE : NOW_VISIBLE, c->GetName()); + c->MessageString(Chat::Broadcasts, c->GetHideMe() ? NOW_INVISIBLE : NOW_VISIBLE, c->GetName()); } } @@ -2109,7 +2111,7 @@ void command_itemtest(Client *c, const Seperator *sep) //Using this to determine new item layout FILE* f = nullptr; if (!(f = fopen("c:\\EQEMUcvs\\ItemDump.txt", "rb"))) { - c->Message(13, "Error: Could not open c:\\EQEMUcvs\\ItemDump.txt"); + c->Message(Chat::Red, "Error: Could not open c:\\EQEMUcvs\\ItemDump.txt"); return; } @@ -2283,10 +2285,10 @@ void command_sendzonespawns(Client *c, const Seperator *sep) void command_zsave(Client *c, const Seperator *sep) { if (zone->SaveZoneCFG()) { - c->Message(13, "Zone header saved successfully."); + c->Message(Chat::Red, "Zone header saved successfully."); } else { - c->Message(13, "ERROR: Zone header data was NOT saved."); + c->Message(Chat::Red, "ERROR: Zone header data was NOT saved."); } } @@ -2625,7 +2627,7 @@ void command_castspell(Client *c, const Seperator *sep) ((spellid >= 1342) && (spellid <= 1348)) || (spellid == 1923) || (spellid == 1924) || (spellid == 3355)) && c->Admin() < commandCastSpecials) - c->Message(13, "Unable to cast spell."); + c->Message(Chat::Red, "Unable to cast spell."); else if (spellid >= SPDAT_RECORDS) c->Message(0, "Error: #CastSpell: Argument out of range"); else @@ -2846,7 +2848,7 @@ void command_spawn(Client *c, const Seperator *sep) void command_test(Client *c, const Seperator *sep) { - c->Message(15, "Triggering test command"); + c->Message(Chat::Yellow, "Triggering test command"); if (sep->arg[1]) { c->SetPrimaryWeaponOrnamentation(atoi(sep->arg[1])); @@ -3297,8 +3299,8 @@ void command_interrogateinv(Client *c, const Seperator *sep) if (c->Admin() < commandInterrogateInv) { if (c->GetInterrogateInvState()) { - c->Message(13, "The last use of #interrogateinv on this inventory instance discovered an error..."); - c->Message(13, "Logging out, zoning or re-arranging items at this point will result in item loss!"); + c->Message(Chat::Red, "The last use of #interrogateinv on this inventory instance discovered an error..."); + c->Message(Chat::Red, "Logging out, zoning or re-arranging items at this point will result in item loss!"); return; } target = c; @@ -3325,7 +3327,7 @@ void command_interrogateinv(Client *c, const Seperator *sep) bool success = target->InterrogateInventory(c, log, silent, allowtrip, error); if (!success) - c->Message(13, "An unknown error occurred while processing Client::InterrogateInventory()"); + c->Message(Chat::Red, "An unknown error occurred while processing Client::InterrogateInventory()"); } void command_invsnapshot(Client *c, const Seperator *sep) @@ -3353,7 +3355,7 @@ void command_invsnapshot(Client *c, const Seperator *sep) "" "takes snapshot of character inventory" ""; - + if (c->Admin() >= commandInvSnapshot) window_text.append( "" @@ -3543,7 +3545,7 @@ void command_invsnapshot(Client *c, const Seperator *sep) std::string window_title = StringFormat("Snapshot Parse for %s @ %u", tc->GetName(), timestamp); std::string window_text = "Slot: ItemID - Description
"; - + for (auto iter : parse_list) { auto item_data = database.GetItem(iter.second); std::string window_line = StringFormat("%i: %u - %s
", iter.first, iter.second, (item_data ? item_data->Name : "[error]")); @@ -3569,7 +3571,7 @@ void command_invsnapshot(Client *c, const Seperator *sep) } uint32 timestamp = atoul(sep->arg[2]); - + if (!database.ValidateCharacterInvSnapshotTimestamp(tc->CharacterID(), timestamp)) { c->Message(0, "No inventory snapshots for %s (id: %u) exist at %u.", tc->GetName(), tc->CharacterID(), timestamp); return; @@ -3584,7 +3586,7 @@ void command_invsnapshot(Client *c, const Seperator *sep) std::string window_title = StringFormat("Snapshot Comparison for %s @ %u", tc->GetName(), timestamp); std::string window_text = "Slot: (action) Snapshot -> Inventory
"; - + auto inv_iter = inv_compare_list.begin(); auto iss_iter = iss_compare_list.begin(); @@ -3649,7 +3651,7 @@ void command_invsnapshot(Client *c, const Seperator *sep) tc->SetNextInvSnapshot(RuleI(Character, InvSnapshotMinIntervalM)); } else { - c->Message(13, "Failed to take pre-restore inventory snapshot of %s (id: %u).", + c->Message(Chat::Red, "Failed to take pre-restore inventory snapshot of %s (id: %u).", tc->GetName(), tc->CharacterID()); return; } @@ -3662,10 +3664,10 @@ void command_invsnapshot(Client *c, const Seperator *sep) timestamp, tc->GetName(), tc->CharacterID()); } else { - c->Message(13, "Failed to apply snapshot %u to %s's (id: %u) inventory.", + c->Message(Chat::Red, "Failed to apply snapshot %u to %s's (id: %u) inventory.", timestamp, tc->GetName(), tc->CharacterID()); } - + return; } } @@ -3824,7 +3826,7 @@ void command_reloadworld(Client *c, const Seperator *sep) void command_reloadmerchants(Client *c, const Seperator *sep) { entity_list.ReloadMerchants(); - c->Message(15, "Reloading merchants."); + c->Message(Chat::Yellow, "Reloading merchants."); } void command_reloadlevelmods(Client *c, const Seperator *sep) @@ -3833,9 +3835,9 @@ void command_reloadlevelmods(Client *c, const Seperator *sep) { if(RuleB(Zone, LevelBasedEXPMods)){ zone->LoadLevelEXPMods(); - c->Message(15, "Level based EXP Mods have been reloaded zonewide"); + c->Message(Chat::Yellow, "Level based EXP Mods have been reloaded zonewide"); }else{ - c->Message(15, "Level based EXP Mods are disabled in rules!"); + c->Message(Chat::Yellow, "Level based EXP Mods are disabled in rules!"); } } } @@ -3968,10 +3970,10 @@ void command_listpetition(Client *c, const Seperator *sep) if (results.RowCount() == 0) return; - c->Message(13," ID : Character Name , Account Name"); + c->Message(Chat::Red," ID : Character Name , Account Name"); for (auto row = results.begin(); row != results.end(); ++row) - c->Message(15, " %s: %s , %s ", row[0],row[1],row[2]); + c->Message(Chat::Yellow, " %s: %s , %s ", row[0],row[1],row[2]); } void command_equipitem(Client *c, const Seperator *sep) @@ -4007,7 +4009,7 @@ void command_equipitem(Client *c, const Seperator *sep) if (partialmove) { // remove this con check if someone can figure out removing charges from cursor stack issue below // mi->number_in_stack is always from_inst->GetCharges() when partialmove is false - c->Message(13, "Error: Partial stack added to existing stack exceeds allowable stacksize"); + c->Message(Chat::Red, "Error: Partial stack added to existing stack exceeds allowable stacksize"); safe_delete(outapp); return; } @@ -4035,16 +4037,16 @@ void command_equipitem(Client *c, const Seperator *sep) //} } else { - c->Message(13, "Error: Unable to equip current item"); + c->Message(Chat::Red, "Error: Unable to equip current item"); } safe_delete(outapp); // also send out a wear change packet? } else if (from_inst == nullptr) - c->Message(13, "Error: There is no item on your cursor"); + c->Message(Chat::Red, "Error: There is no item on your cursor"); else - c->Message(13, "Error: Item on your cursor cannot be equipped"); + c->Message(Chat::Red, "Error: Item on your cursor cannot be equipped"); } else c->Message(0, "Usage: #equipitem slotid[0-21] - equips the item on your cursor to the position"); @@ -4482,7 +4484,7 @@ void command_gmzone(Client *c, const Seperator *sep) uint16 instance_id = 0; if (zone_id == 0) { - c->Message(13, "Invalid zone specified"); + c->Message(Chat::Red, "Invalid zone specified"); return; } @@ -4496,21 +4498,21 @@ void command_gmzone(Client *c, const Seperator *sep) if (existing_zone_instance.length() > 0) { instance_id = std::stoi(existing_zone_instance); - c->Message(15, "Found already created instance (%s) (%u)", zone_short_name, instance_id); + c->Message(Chat::Yellow, "Found already created instance (%s) (%u)", zone_short_name, instance_id); } if (instance_id == 0) { if (!database.GetUnusedInstanceID(instance_id)) { - c->Message(13, "Server was unable to find a free instance id."); + c->Message(Chat::Red, "Server was unable to find a free instance id."); return; } if (!database.CreateInstance(instance_id, zone_id, zone_version, duration)) { - c->Message(13, "Server was unable to create a new instance."); + c->Message(Chat::Red, "Server was unable to create a new instance."); return; } - c->Message(15, "New private GM instance %s was created with id %lu.", zone_short_name, (unsigned long) instance_id); + c->Message(Chat::Yellow, "New private GM instance %s was created with id %lu.", zone_short_name, (unsigned long) instance_id); DataBucket::SetData(bucket_key, std::to_string(instance_id)); } @@ -4528,10 +4530,10 @@ void command_gmzone(Client *c, const Seperator *sep) &min_status, &min_level )) { - c->Message(13, "Failed to find safe coordinates for specified zone"); + c->Message(Chat::Red, "Failed to find safe coordinates for specified zone"); } - c->Message(15, "Zoning to private GM instance (%s) (%u)", zone_short_name, instance_id); + c->Message(Chat::Yellow, "Zoning to private GM instance (%s) (%u)", zone_short_name, instance_id); c->AssignToInstance(instance_id); c->MovePC(zone_id, instance_id, target_x, target_y, target_z, 0, 1); @@ -4549,13 +4551,13 @@ void command_title(Client *c, const Seperator *sep) if(!target_mob) target_mob = c; if(!target_mob->IsClient()) { - c->Message(13, "#title only works on players."); + c->Message(Chat::Red, "#title only works on players."); return; } Client *t = target_mob->CastToClient(); if(strlen(sep->arg[1]) > 31) { - c->Message(13, "Title must be 31 characters or less."); + c->Message(Chat::Red, "Title must be 31 characters or less."); return; } @@ -4576,13 +4578,13 @@ void command_title(Client *c, const Seperator *sep) t->Save(); if(removed) { - c->Message(13, "%s's title has been removed.", t->GetName(), sep->arg[1]); + c->Message(Chat::Red, "%s's title has been removed.", t->GetName(), sep->arg[1]); if(t != c) - t->Message(13, "Your title has been removed.", sep->arg[1]); + t->Message(Chat::Red, "Your title has been removed.", sep->arg[1]); } else { - c->Message(13, "%s's title has been changed to '%s'.", t->GetName(), sep->arg[1]); + c->Message(Chat::Red, "%s's title has been changed to '%s'.", t->GetName(), sep->arg[1]); if(t != c) - t->Message(13, "Your title has been changed to '%s'.", sep->arg[1]); + t->Message(Chat::Red, "Your title has been changed to '%s'.", sep->arg[1]); } } } @@ -4599,13 +4601,13 @@ void command_titlesuffix(Client *c, const Seperator *sep) if(!target_mob) target_mob = c; if(!target_mob->IsClient()) { - c->Message(13, "#titlesuffix only works on players."); + c->Message(Chat::Red, "#titlesuffix only works on players."); return; } Client *t = target_mob->CastToClient(); if(strlen(sep->arg[1]) > 31) { - c->Message(13, "Title suffix must be 31 characters or less."); + c->Message(Chat::Red, "Title suffix must be 31 characters or less."); return; } @@ -4627,13 +4629,13 @@ void command_titlesuffix(Client *c, const Seperator *sep) t->Save(); if(removed) { - c->Message(13, "%s's title suffix has been removed.", t->GetName(), sep->arg[1]); + c->Message(Chat::Red, "%s's title suffix has been removed.", t->GetName(), sep->arg[1]); if(t != c) - t->Message(13, "Your title suffix has been removed.", sep->arg[1]); + t->Message(Chat::Red, "Your title suffix has been removed.", sep->arg[1]); } else { - c->Message(13, "%s's title suffix has been changed to '%s'.", t->GetName(), sep->arg[1]); + c->Message(Chat::Red, "%s's title suffix has been changed to '%s'.", t->GetName(), sep->arg[1]); if(t != c) - t->Message(13, "Your title suffix has been changed to '%s'.", sep->arg[1]); + t->Message(Chat::Red, "Your title suffix has been changed to '%s'.", sep->arg[1]); } } } @@ -5190,7 +5192,7 @@ void command_name(Client *c, const Seperator *sep) target->Kick("Name was changed"); } else - c->Message(13, "ERROR: Unable to rename %s. Check that the new name '%s' isn't already taken.", oldname, sep->arg[2]); + c->Message(Chat::Red, "ERROR: Unable to rename %s. Check that the new name '%s' isn't already taken.", oldname, sep->arg[2]); free(oldname); } } @@ -5295,7 +5297,7 @@ void command_killallnpcs(Client *c, const Seperator *sep) count++; } - c->Message(15, "Killed (%i) npc(s)", count); + c->Message(Chat::Yellow, "Killed (%i) npc(s)", count); } void command_haste(Client *c, const Seperator *sep) @@ -5437,8 +5439,8 @@ void command_spawnfix(Client *c, const Seperator *sep) { c->GetX(), c->GetY(), c->GetZ(), c->GetHeading(),s2->GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - c->Message(13, "Update failed! MySQL gave the following error:"); - c->Message(13, results.ErrorMessage().c_str()); + c->Message(Chat::Red, "Update failed! MySQL gave the following error:"); + c->Message(Chat::Red, results.ErrorMessage().c_str()); return; } @@ -5488,13 +5490,13 @@ void command_goto(Client *c, const Seperator *sep) client->GetZ(), client->GetHeading()); - c->Message(15, "Goto player '%s' same zone", player_name_string.c_str()); + c->Message(Chat::Yellow, "Goto player '%s' same zone", player_name_string.c_str()); } else if (c->GotoPlayer(player_name_string)) { - c->Message(15, "Goto player '%s' different zone", player_name_string.c_str()); + c->Message(Chat::Yellow, "Goto player '%s' different zone", player_name_string.c_str()); } else { - c->Message(15, "Player '%s' not found", player_name_string.c_str()); + c->Message(Chat::Yellow, "Player '%s' not found", player_name_string.c_str()); } } @@ -5520,13 +5522,13 @@ void command_iteminfo(Client *c, const Seperator *sep) { auto inst = c->GetInv()[EQEmu::invslot::slotCursor]; if (!inst) { - c->Message(13, "Error: You need an item on your cursor for this command"); + c->Message(Chat::Red, "Error: You need an item on your cursor for this command"); return; } auto item = inst->GetItem(); if (!item) { Log(Logs::General, Logs::Inventory, "(%s) Command #iteminfo processed an item with no data pointer"); - c->Message(13, "Error: This item has no data reference"); + c->Message(Chat::Red, "Error: This item has no data reference"); return; } @@ -5628,12 +5630,12 @@ void command_time(Client *c, const Seperator *sep) if(sep->IsNumber(2)) { minutes=atoi(sep->arg[2]); } - c->Message(13, "Setting world time to %s:%i (Timezone: 0)...", sep->arg[1], minutes); + c->Message(Chat::Red, "Setting world time to %s:%i (Timezone: 0)...", sep->arg[1], minutes); zone->SetTime(atoi(sep->arg[1])+1, minutes); Log(Logs::General, Logs::Zone_Server, "%s :: Setting world time to %s:%i (Timezone: 0)...", c->GetCleanName(), sep->arg[1], minutes); } else { - c->Message(13, "To set the Time: #time HH [MM]"); + c->Message(Chat::Red, "To set the Time: #time HH [MM]"); TimeOfDay_Struct eqTime; zone->zone_time.GetCurrentEQTimeOfDay( time(0), &eqTime); sprintf(timeMessage,"%02d:%s%d %s (Timezone: %ih %im)", @@ -5644,7 +5646,7 @@ void command_time(Client *c, const Seperator *sep) zone->zone_time.getEQTimeZoneHr(), zone->zone_time.getEQTimeZoneMin() ); - c->Message(13, "It is now %s.", timeMessage); + c->Message(Chat::Red, "It is now %s.", timeMessage); Log(Logs::General, Logs::Zone_Server, "Current Time is: %s", timeMessage); } } @@ -5762,19 +5764,19 @@ void command_guild(Client *c, const Seperator *sep) if(guild_id == 0) guild_id = GUILD_NONE; else if(!guild_mgr.GuildExists(guild_id)) { - c->Message(13, "Guild %d does not exist.", guild_id); + c->Message(Chat::Red, "Guild %d does not exist.", guild_id); return; } uint32 charid = database.GetCharacterID(sep->arg[2]); if(charid == 0) { - c->Message(13, "Unable to find character '%s'", charid); + c->Message(Chat::Red, "Unable to find character '%s'", charid); return; } //we could do the checking we need for guild_mgr.CheckGMStatus, but im lazy right now if(admin < minStatusToEditOtherGuilds) { - c->Message(13, "Access denied."); + c->Message(Chat::Red, "Access denied."); return; } @@ -5788,7 +5790,7 @@ void command_guild(Client *c, const Seperator *sep) } if(!guild_mgr.SetGuild(charid, guild_id, GUILD_MEMBER)) { - c->Message(13, "Error putting '%s' into guild %d", sep->arg[2], guild_id); + c->Message(Chat::Red, "Error putting '%s' into guild %d", sep->arg[2], guild_id); } else { c->Message(0, "%s has been put into guild %d", sep->arg[2], guild_id); } @@ -5821,13 +5823,13 @@ void command_guild(Client *c, const Seperator *sep) else { uint32 charid = database.GetCharacterID(sep->arg[2]); if(charid == 0) { - c->Message(13, "Unable to find character '%s'", charid); + c->Message(Chat::Red, "Unable to find character '%s'", charid); return; } //we could do the checking we need for guild_mgr.CheckGMStatus, but im lazy right now if(admin < minStatusToEditOtherGuilds) { - c->Message(13, "Access denied."); + c->Message(Chat::Red, "Access denied."); return; } @@ -5835,7 +5837,7 @@ void command_guild(Client *c, const Seperator *sep) sep->arg[2], charid, rank); if(!guild_mgr.SetGuildRank(charid, rank)) - c->Message(13, "Error while setting rank %d on '%s'.", rank, sep->arg[2]); + c->Message(Chat::Red, "Error while setting rank %d on '%s'.", rank, sep->arg[2]); else c->Message(0, "%s has been set to rank %d", sep->arg[2], rank); } @@ -5852,7 +5854,7 @@ void command_guild(Client *c, const Seperator *sep) } else if((leader=database.GetCharacterID(sep->arg[2])) != 0) { //got it from the db.. } else { - c->Message(13, "Unable to find char '%s'", sep->arg[2]); + c->Message(Chat::Red, "Unable to find char '%s'", sep->arg[2]); return; } if (leader == 0) { @@ -5867,7 +5869,7 @@ void command_guild(Client *c, const Seperator *sep) else { if(admin < minStatusToEditOtherGuilds) { - c->Message(13, "Access denied."); + c->Message(Chat::Red, "Access denied."); return; } @@ -5904,10 +5906,10 @@ void command_guild(Client *c, const Seperator *sep) if(admin < minStatusToEditOtherGuilds) { //this person is not allowed to just edit any guild, check this guild's min status. if(c->GuildID() != id) { - c->Message(13, "Access denied to edit other people's guilds"); + c->Message(Chat::Red, "Access denied to edit other people's guilds"); return; } else if(!guild_mgr.CheckGMStatus(id, admin)) { - c->Message(13, "Access denied to edit your guild with GM commands."); + c->Message(Chat::Red, "Access denied to edit your guild with GM commands."); return; } } @@ -5938,10 +5940,10 @@ void command_guild(Client *c, const Seperator *sep) if(admin < minStatusToEditOtherGuilds) { //this person is not allowed to just edit any guild, check this guild's min status. if(c->GuildID() != id) { - c->Message(13, "Access denied to edit other people's guilds"); + c->Message(Chat::Red, "Access denied to edit other people's guilds"); return; } else if(!guild_mgr.CheckGMStatus(id, admin)) { - c->Message(13, "Access denied to edit your guild with GM commands."); + c->Message(Chat::Red, "Access denied to edit your guild with GM commands."); return; } } @@ -5968,7 +5970,7 @@ void command_guild(Client *c, const Seperator *sep) } else if((leader=database.GetCharacterID(sep->arg[2])) != 0) { //got it from the db.. } else { - c->Message(13, "Unable to find char '%s'", sep->arg[2]); + c->Message(Chat::Red, "Unable to find char '%s'", sep->arg[2]); return; } @@ -5989,10 +5991,10 @@ void command_guild(Client *c, const Seperator *sep) if(admin < minStatusToEditOtherGuilds) { //this person is not allowed to just edit any guild, check this guild's min status. if(c->GuildID() != id) { - c->Message(13, "Access denied to edit other people's guilds"); + c->Message(Chat::Red, "Access denied to edit other people's guilds"); return; } else if(!guild_mgr.CheckGMStatus(id, admin)) { - c->Message(13, "Access denied to edit your guild with GM commands."); + c->Message(Chat::Red, "Access denied to edit your guild with GM commands."); return; } } @@ -6010,7 +6012,7 @@ void command_guild(Client *c, const Seperator *sep) } else if (strcasecmp(sep->arg[1], "list") == 0) { if(admin < minStatusToEditOtherGuilds) { - c->Message(13, "Access denied."); + c->Message(Chat::Red, "Access denied."); return; } guild_mgr.ListGuilds(c); @@ -6150,7 +6152,7 @@ void command_findaliases(Client *c, const Seperator *sep) auto find_iter = commandaliases.find(sep->arg[1]); if (find_iter == commandaliases.end()) { - c->Message(15, "No commands or aliases match '%s'", sep->arg[1]); + c->Message(Chat::Yellow, "No commands or aliases match '%s'", sep->arg[1]); return; } @@ -6478,14 +6480,14 @@ void command_scribespells(Client *c, const Seperator *sep) break; } if (spell_id < 0 || spell_id >= SPDAT_RECORDS) { - c->Message(13, "FATAL ERROR: Spell id out-of-range (id: %i, min: 0, max: %i)", spell_id, SPDAT_RECORDS); + c->Message(Chat::Red, "FATAL ERROR: Spell id out-of-range (id: %i, min: 0, max: %i)", spell_id, SPDAT_RECORDS); return; } if (book_slot < 0 || book_slot >= EQEmu::spells::SPELLBOOK_SIZE) { - c->Message(13, "FATAL ERROR: Book slot out-of-range (slot: %i, min: 0, max: %i)", book_slot, EQEmu::spells::SPELLBOOK_SIZE); + c->Message(Chat::Red, "FATAL ERROR: Book slot out-of-range (slot: %i, min: 0, max: %i)", book_slot, EQEmu::spells::SPELLBOOK_SIZE); return; } - + while (true) { if (spells[spell_id].classes[WARRIOR] == 0) // check if spell exists break; @@ -6498,7 +6500,7 @@ void command_scribespells(Client *c, const Seperator *sep) uint16 spell_id_ = (uint16)spell_id; if ((spell_id_ != spell_id) || (spell_id != spell_id_)) { - c->Message(13, "FATAL ERROR: Type conversion data loss with spell_id (%i != %u)", spell_id, spell_id_); + c->Message(Chat::Red, "FATAL ERROR: Type conversion data loss with spell_id (%i != %u)", spell_id, spell_id_); return; } @@ -6554,17 +6556,17 @@ void command_scribespell(Client *c, const Seperator *sep) { if(book_slot >= 0 && t->FindSpellBookSlotBySpellID(spell_id) < 0) t->ScribeSpell(spell_id, book_slot); else { - t->Message(13, "Unable to scribe spell: %s (%i) to your spellbook.", spells[spell_id].name, spell_id); + t->Message(Chat::Red, "Unable to scribe spell: %s (%i) to your spellbook.", spells[spell_id].name, spell_id); if(t != c) - c->Message(13, "Unable to scribe spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); + c->Message(Chat::Red, "Unable to scribe spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); } } else - c->Message(13, "Your target can not scribe this spell."); + c->Message(Chat::Red, "Your target can not scribe this spell."); } else - c->Message(13, "Spell ID: %i is an unknown spell and cannot be scribed.", spell_id); + c->Message(Chat::Red, "Spell ID: %i is an unknown spell and cannot be scribed.", spell_id); } void command_unscribespell(Client *c, const Seperator *sep) { @@ -6596,10 +6598,10 @@ void command_unscribespell(Client *c, const Seperator *sep) { Log(Logs::General, Logs::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); } else { - t->Message(13, "Unable to unscribe spell: %s (%i) from your spellbook. This spell is not scribed.", spells[spell_id].name, spell_id); + t->Message(Chat::Red, "Unable to unscribe spell: %s (%i) from your spellbook. This spell is not scribed.", spells[spell_id].name, spell_id); if(t != c) - c->Message(13, "Unable to unscribe spell: %s (%i) for %s due to spell not scribed.", spells[spell_id].name, spell_id, t->GetName()); + c->Message(Chat::Red, "Unable to unscribe spell: %s (%i) for %s due to spell not scribed.", spells[spell_id].name, spell_id, t->GetName()); } } } @@ -6618,7 +6620,7 @@ void command_untraindisc(Client *c, const Seperator *sep) { Client *t = c; if (c->GetTarget() && c->GetTarget()->IsClient() && c->GetGM()) t = c->GetTarget()->CastToClient(); - + for (int i = 0; i < MAX_PP_DISCIPLINES; i++) { if (t->GetPP().disciplines.values[i] == atoi(sep->arg[1])) { t->UntrainDisc(i, 1); @@ -6631,7 +6633,7 @@ void command_untraindiscs(Client *c, const Seperator *sep) { Client *t = c; if (c->GetTarget() && c->GetTarget()->IsClient() && c->GetGM()) t = c->GetTarget()->CastToClient(); - + t->UntrainDiscAll(); } @@ -6734,7 +6736,7 @@ void command_summonitem(Client *c, const Seperator *sep) } if (item_status > c->Admin()) - c->Message(13, "Error: Insufficient status to summon this item."); + c->Message(Chat::Red, "Error: Insufficient status to summon this item."); else if (sep->argnum == 2 && sep->IsNumber(2)) c->SummonItem(itemid, atoi(sep->arg[2])); else if (sep->argnum == 3) @@ -6752,17 +6754,17 @@ void command_summonitem(Client *c, const Seperator *sep) else { c->SummonItem(itemid); } - + } void command_giveitem(Client *c, const Seperator *sep) { if (!sep->IsNumber(1)) { - c->Message(13, "Usage: #summonitem [item id] [charges], charges are optional"); + c->Message(Chat::Red, "Usage: #summonitem [item id] [charges], charges are optional"); } else if(c->GetTarget() == nullptr) { - c->Message(13, "You must target a client to give the item to."); + c->Message(Chat::Red, "You must target a client to give the item to."); } else if(!c->GetTarget()->IsClient()) { - c->Message(13, "You can only give items to players with this command."); + c->Message(Chat::Red, "You can only give items to players with this command."); } else { Client *t = c->GetTarget()->CastToClient(); uint32 itemid = atoi(sep->arg[1]); @@ -6773,7 +6775,7 @@ void command_giveitem(Client *c, const Seperator *sep) } if (item_status > c->Admin()) - c->Message(13, "Error: Insufficient status to summon this item."); + c->Message(Chat::Red, "Error: Insufficient status to summon this item."); else if (sep->argnum==2 && sep->IsNumber(2)) t->SummonItem(itemid, atoi(sep->arg[2])); else if (sep->argnum==3) @@ -6797,13 +6799,13 @@ void command_giveitem(Client *c, const Seperator *sep) void command_givemoney(Client *c, const Seperator *sep) { if (!sep->IsNumber(1)) { //as long as the first one is a number, we'll just let atoi convert the rest to 0 or a number - c->Message(13, "Usage: #Usage: #givemoney [pp] [gp] [sp] [cp]"); + c->Message(Chat::Red, "Usage: #Usage: #givemoney [pp] [gp] [sp] [cp]"); } else if(c->GetTarget() == nullptr) { - c->Message(13, "You must target a player to give money to."); + c->Message(Chat::Red, "You must target a player to give money to."); } else if(!c->GetTarget()->IsClient()) { - c->Message(13, "You can only give money to players with this command."); + c->Message(Chat::Red, "You can only give money to players with this command."); } else { //TODO: update this to the client, otherwise the client doesn't show any weight change until you zone, move an item, etc @@ -6899,17 +6901,17 @@ void command_setaapts(Client *c, const Seperator *sep) else if(!strcasecmp(sep->arg[1], "group")) { t->GetPP().group_leadership_points = atoi(sep->arg[2]); t->GetPP().group_leadership_exp = 0; - t->Message(MT_Experience, "Setting Group AA points to %u", t->GetPP().group_leadership_points); + t->Message(Chat::Experience, "Setting Group AA points to %u", t->GetPP().group_leadership_points); t->SendLeadershipEXPUpdate(); } else if(!strcasecmp(sep->arg[1], "raid")) { t->GetPP().raid_leadership_points = atoi(sep->arg[2]); t->GetPP().raid_leadership_exp = 0; - t->Message(MT_Experience, "Setting Raid AA points to %u", t->GetPP().raid_leadership_points); + t->Message(Chat::Experience, "Setting Raid AA points to %u", t->GetPP().raid_leadership_points); t->SendLeadershipEXPUpdate(); } else { t->GetPP().aapoints = atoi(sep->arg[2]); t->GetPP().expAA = 0; - t->Message(MT_Experience, "Setting personal AA points to %u", t->GetPP().aapoints); + t->Message(Chat::Experience, "Setting personal AA points to %u", t->GetPP().aapoints); t->SendAlternateAdvancementStats(); } } @@ -6993,7 +6995,7 @@ if(sep->arg[1][0] == 0 || sep->arg[2][0] == 0) { } if(account_id == 0) { - c->Message(13, "Character does not exist."); + c->Message(Chat::Red, "Character does not exist."); return; } @@ -7001,7 +7003,7 @@ if(sep->arg[1][0] == 0 || sep->arg[2][0] == 0) { "WHERE id = %i", EscapeString(message).c_str(), account_id); auto results = database.QueryDatabase(query); - c->Message(13, "Account number %i with the character %s has been banned with message: \"%s\"", account_id, sep->arg[1], message.c_str()); + c->Message(Chat::Red, "Account number %i with the character %s has been banned with message: \"%s\"", account_id, sep->arg[1], message.c_str()); ServerPacket flagUpdatePack(ServerOP_FlagUpdate, 6); *((uint32*)&flagUpdatePack.pBuffer[0]) = account_id; @@ -7064,7 +7066,7 @@ void command_suspend(Client *c, const Seperator *sep) safe_delete_array(escName); if (accountID <= 0) { - c->Message(13,"Character does not exist."); + c->Message(Chat::Red,"Character does not exist."); return; } @@ -7074,9 +7076,9 @@ void command_suspend(Client *c, const Seperator *sep) auto results = database.QueryDatabase(query); if(duration) - c->Message(13,"Account number %i with the character %s has been temporarily suspended for %i day(s).", accountID, sep->arg[1], duration); + c->Message(Chat::Red,"Account number %i with the character %s has been temporarily suspended for %i day(s).", accountID, sep->arg[1], duration); else - c->Message(13,"Account number %i with the character %s is no longer suspended.", accountID, sep->arg[1]); + c->Message(Chat::Red,"Account number %i with the character %s is no longer suspended.", accountID, sep->arg[1]); Client *bannedClient = entity_list.GetClientByName(sep->arg[1]); @@ -7120,7 +7122,7 @@ void command_revoke(Client *c, const Seperator *sep) uint32 characterID = database.GetAccountIDByChar(sep->arg[1]); if(characterID == 0) { - c->Message(13,"Character does not exist."); + c->Message(Chat::Red,"Character does not exist."); return; } @@ -7128,7 +7130,7 @@ void command_revoke(Client *c, const Seperator *sep) std::string query = StringFormat("UPDATE account SET revoked = %d WHERE id = %i", flag, characterID); auto results = database.QueryDatabase(query); - c->Message(13,"%s account number %i with the character %s.", flag? "Revoking": "Unrevoking", characterID, sep->arg[1]); + c->Message(Chat::Red,"%s account number %i with the character %s.", flag? "Revoking": "Unrevoking", characterID, sep->arg[1]); Client* revokee = entity_list.GetClientByAccID(characterID); if(revokee) { @@ -7137,7 +7139,7 @@ void command_revoke(Client *c, const Seperator *sep) return; } - c->Message(13, "#revoke: Couldn't find %s in this zone, passing request to worldserver.", sep->arg[1]); + c->Message(Chat::Red, "#revoke: Couldn't find %s in this zone, passing request to worldserver.", sep->arg[1]); auto outapp = new ServerPacket(ServerOP_Revoke, sizeof(RevokeStruct)); RevokeStruct *revoke = (RevokeStruct *)outapp->pBuffer; @@ -7254,6 +7256,115 @@ void command_npcemote(Client *c, const Seperator *sep) } } +void command_npceditmass(Client *c, const Seperator *sep) +{ + std::string query = SQL( + SELECT + COLUMN_NAME + FROM + INFORMATION_SCHEMA.COLUMNS + WHERE + table_name = 'npc_types' + AND + COLUMN_NAME != 'id' + ); + + std::string search_column, search_value, change_column, change_value; + if (sep->arg[1]) { + search_column = sep->arg[1]; + } + if (sep->arg[2]) { + search_value = sep->arg[2]; + } + if (sep->arg[3]) { + change_column = sep->arg[3]; + } + if (sep->arg[4]) { + change_value = sep->arg[4]; + } + + bool valid_change_column = false; + bool valid_search_column = false; + auto results = database.QueryDatabase(query); + + for (auto row = results.begin(); row != results.end(); ++row) { + if (row[0] == change_column) { + valid_change_column = true; + } + if (row[0] == search_column) { + valid_search_column = true; + } + } + + if (!valid_search_column) { + c->Message(Chat::Red, "You must specify a valid search column. [%s] is not valid", search_column.c_str()); + return; + } + + if (!valid_change_column) { + c->Message(Chat::Red, "You must specify a valid change column. [%s] is not valid", change_column.c_str()); + return; + } + + if (!valid_search_column || !valid_change_column) { + c->Message(Chat::Red, "One requested column is invalid"); + return; + } + + query = fmt::format( + SQL( + select + id, + name, + {0}, + {1} + from + npc_types + where + id IN( + select + spawnentry.npcID + from + spawnentry + join spawn2 on spawn2.spawngroupID = spawnentry.spawngroupID + where + spawn2.zone = '{2}' and spawn2.version = {3} + ) + ), + search_column, + change_column, + zone->GetShortName(), + zone->GetInstanceVersion() + ); + + results = database.QueryDatabase(query); + for (auto row = results.begin(); row != results.end(); ++row) { + + std::string npc_id = row[0]; + std::string npc_name = row[1]; + std::string search_column_value = str_tolower(row[2]); + std::string change_column_current_value = row[3]; + + if (search_column_value.find(search_value) == std::string::npos) { + continue; + } + + c->Message( + 15, + fmt::format( + "NPC ({0}) [{1}] ({2}) [{3}] Current ({4}) [{5}] New [{6}]", + npc_id, + npc_name, + search_column, + search_column_value, + change_column, + change_column_current_value, + change_value + ).c_str() + ); + } +} + void command_npcedit(Client *c, const Seperator *sep) { if (!c->GetTarget() || !c->GetTarget()->IsNPC()) { c->Message(0, "Error: Must have NPC targeted"); @@ -7348,497 +7459,497 @@ void command_npcedit(Client *c, const Seperator *sep) uint32 npcTypeID = c->GetTarget()->CastToNPC()->GetNPCTypeID(); if (strcasecmp(sep->arg[1], "name") == 0) { - c->Message(15,"NPCID %u now has the name %s.", npcTypeID, sep->argplus[2]); + c->Message(Chat::Yellow,"NPCID %u now has the name %s.", npcTypeID, sep->argplus[2]); std::string query = StringFormat("UPDATE npc_types SET name = '%s' WHERE id = %i", sep->argplus[2],npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "lastname") == 0) { - c->Message(15,"NPCID %u now has the lastname %s.", npcTypeID, sep->argplus[2]); + c->Message(Chat::Yellow,"NPCID %u now has the lastname %s.", npcTypeID, sep->argplus[2]); std::string query = StringFormat("UPDATE npc_types SET lastname = '%s' WHERE id = %i", sep->argplus[2],npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "flymode") == 0) { - c->Message(15,"NPCID %u now has flymode [%s]", npcTypeID, sep->argplus[2]); + c->Message(Chat::Yellow,"NPCID %u now has flymode [%s]", npcTypeID, sep->argplus[2]); std::string query = StringFormat("UPDATE npc_types SET flymode = '%s' WHERE id = %i", sep->argplus[2],npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "race") == 0) { - c->Message(15,"NPCID %u now has the race %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has the race %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET race = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "class") == 0) { - c->Message(15,"NPCID %u is now class %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u is now class %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET class = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "bodytype") == 0) { - c->Message(15,"NPCID %u now has type %i bodytype.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has type %i bodytype.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET bodytype = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "hp") == 0) { - c->Message(15,"NPCID %u now has %i Hitpoints.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has %i Hitpoints.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET hp = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "gender") == 0) { - c->Message(15,"NPCID %u is now gender %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u is now gender %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET gender = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "texture") == 0) { - c->Message(15,"NPCID %u now uses texture %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now uses texture %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET texture = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "helmtexture") == 0) { - c->Message(15,"NPCID %u now uses helmtexture %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now uses helmtexture %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET helmtexture = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "armtexture") == 0) { - c->Message(15,"NPCID %u now uses armtexture %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now uses armtexture %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET armtexture = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "bracertexture") == 0) { - c->Message(15,"NPCID %u now uses bracertexture %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now uses bracertexture %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET bracertexture = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "handtexture") == 0) { - c->Message(15,"NPCID %u now uses handtexture %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now uses handtexture %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET handtexture = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "legtexture") == 0) { - c->Message(15,"NPCID %u now uses legtexture %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now uses legtexture %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET legtexture = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "feettexture") == 0) { - c->Message(15,"NPCID %u now uses feettexture %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now uses feettexture %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET feettexture = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "herosforgemodel") == 0) { - c->Message(15,"NPCID %u now uses herosforgemodel %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now uses herosforgemodel %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET herosforgemodel = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "size") == 0) { - c->Message(15,"NPCID %u is now size %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u is now size %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET size = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "hpregen") == 0) { - c->Message(15,"NPCID %u now regens %i hitpoints per tick.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now regens %i hitpoints per tick.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET hp_regen_rate = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "manaregen") == 0) { - c->Message(15,"NPCID %u now regens %i mana per tick.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now regens %i mana per tick.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET mana_regen_rate = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "loottable") == 0) { - c->Message(15,"NPCID %u is now on loottable_id %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u is now on loottable_id %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET loottable_id = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "merchantid") == 0) { - c->Message(15,"NPCID %u is now merchant_id %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u is now merchant_id %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET merchant_id = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "alt_currency_id") == 0) { - c->Message(15,"NPCID %u now has field 'alt_currency_id' set to %s.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has field 'alt_currency_id' set to %s.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET alt_currency_id = '%s' WHERE id = %i", sep->argplus[2],npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "npc_spells_effects_id") == 0) { - c->Message(15,"NPCID %u now has field 'npc_spells_effects_id' set to %s.", npcTypeID, sep->argplus[2]); + c->Message(Chat::Yellow,"NPCID %u now has field 'npc_spells_effects_id' set to %s.", npcTypeID, sep->argplus[2]); std::string query = StringFormat("UPDATE npc_types SET npc_spells_effects_id = '%s' WHERE id = %i", sep->argplus[2],npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "adventure_template_id") == 0) { - c->Message(15,"NPCID %u now has field 'adventure_template_id' set to %s.", npcTypeID, sep->argplus[2]); + c->Message(Chat::Yellow,"NPCID %u now has field 'adventure_template_id' set to %s.", npcTypeID, sep->argplus[2]); std::string query = StringFormat("UPDATE npc_types SET adventure_template_id = '%s' WHERE id = %i", sep->argplus[2],npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "trap_template") == 0) { - c->Message(15,"NPCID %u now has field 'trap_template' set to %s.", npcTypeID, sep->argplus[2]); + c->Message(Chat::Yellow,"NPCID %u now has field 'trap_template' set to %s.", npcTypeID, sep->argplus[2]); std::string query = StringFormat("UPDATE npc_types SET trap_template = '%s' WHERE id = %i", sep->argplus[2],npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "special_abilities") == 0) { - c->Message(15,"NPCID %u now has field 'special_abilities' set to %s.", npcTypeID, sep->argplus[2]); + c->Message(Chat::Yellow,"NPCID %u now has field 'special_abilities' set to %s.", npcTypeID, sep->argplus[2]); std::string query = StringFormat("UPDATE npc_types SET special_abilities = '%s' WHERE id = %i", sep->argplus[2],npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "spell") == 0) { - c->Message(15,"NPCID %u now uses spell list %i", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now uses spell list %i", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET npc_spells_id = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "faction") == 0) { - c->Message(15,"NPCID %u is now faction %i", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u is now faction %i", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET npc_faction_id = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "damage") == 0) { - c->Message(15,"NPCID %u now hits from %i to %i", npcTypeID, atoi(sep->arg[2]), atoi(sep->arg[3])); + c->Message(Chat::Yellow,"NPCID %u now hits from %i to %i", npcTypeID, atoi(sep->arg[2]), atoi(sep->arg[3])); std::string query = StringFormat("UPDATE npc_types SET mindmg = %i, maxdmg = %i WHERE id = %i", atoi(sep->arg[2]), atoi(sep->arg[3]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "meleetype") == 0) { - c->Message(15,"NPCID %u now has a primary melee type of %i and a secondary melee type of %i.", npcTypeID, atoi(sep->arg[2]), atoi(sep->arg[3])); + c->Message(Chat::Yellow,"NPCID %u now has a primary melee type of %i and a secondary melee type of %i.", npcTypeID, atoi(sep->arg[2]), atoi(sep->arg[3])); std::string query = StringFormat("UPDATE npc_types SET prim_melee_type = %i, sec_melee_type = %i WHERE id = %i", atoi(sep->arg[2]), atoi(sep->arg[3]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "rangedtype") == 0) { - c->Message(15,"NPCID %u now has a ranged type of %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has a ranged type of %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET ranged_type = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "ammoidfile") == 0) { - c->Message(15,"NPCID %u's ammo id file is now %i", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u's ammo id file is now %i", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET ammoidfile = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "aggroradius") == 0) { - c->Message(15,"NPCID %u now has an aggro radius of %i", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has an aggro radius of %i", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET aggroradius = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "assistradius") == 0) { - c->Message(15,"NPCID %u now has an assist radius of %i", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has an assist radius of %i", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET assistradius = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "social") == 0) { - c->Message(15,"NPCID %u social status is now %i", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u social status is now %i", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET social = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "runspeed") == 0) { - c->Message(15,"NPCID %u now runs at %f", npcTypeID, atof(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now runs at %f", npcTypeID, atof(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET runspeed = %f WHERE id = %i", atof(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "walkspeed") == 0) { - c->Message(15,"NPCID %u now walks at %f", npcTypeID, atof(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now walks at %f", npcTypeID, atof(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET walkspeed = %f WHERE id = %i", atof(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "AGI") == 0) { - c->Message(15,"NPCID %u now has %i Agility.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has %i Agility.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET AGI = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "CHA") == 0) { - c->Message(15,"NPCID %u now has %i Charisma.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has %i Charisma.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET CHA = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "DEX") == 0) { - c->Message(15,"NPCID %u now has %i Dexterity.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has %i Dexterity.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET DEX = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "INT") == 0) { - c->Message(15,"NPCID %u now has %i Intelligence.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has %i Intelligence.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET _INT = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "STA") == 0) { - c->Message(15,"NPCID %u now has %i Stamina.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has %i Stamina.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET STA = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "STR") == 0) { - c->Message(15,"NPCID %u now has %i Strength.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has %i Strength.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET STR = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "WIS") == 0) { - c->Message(15,"NPCID %u now has a Magic Resistance of %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has a Magic Resistance of %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET WIS = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "MR") == 0) { - c->Message(15,"NPCID %u now has a Magic Resistance of %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has a Magic Resistance of %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET MR = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "DR") == 0) { - c->Message(15,"NPCID %u now has a Disease Resistance of %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has a Disease Resistance of %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET DR = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "CR") == 0) { - c->Message(15,"NPCID %u now has a Cold Resistance of %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has a Cold Resistance of %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET CR = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "FR") == 0) { - c->Message(15,"NPCID %u now has a Fire Resistance of %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has a Fire Resistance of %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET FR = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "PR") == 0) { - c->Message(15,"NPCID %u now has a Poison Resistance of %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has a Poison Resistance of %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET PR = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "Corrup") == 0) { - c->Message(15,"NPCID %u now has a Corruption Resistance of %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has a Corruption Resistance of %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET corrup = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "PhR") == 0) { - c->Message(15,"NPCID %u now has a Physical Resistance of %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has a Physical Resistance of %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET PhR = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "seeinvis") == 0) { - c->Message(15,"NPCID %u now has seeinvis set to %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has seeinvis set to %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET see_invis = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "seeinvisundead") == 0) { - c->Message(15,"NPCID %u now has seeinvisundead set to %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has seeinvisundead set to %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET see_invis_undead = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "seehide") == 0) { - c->Message(15,"NPCID %u now has seehide set to %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has seehide set to %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET see_hide = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "seeimprovedhide") == 0) { - c->Message(15,"NPCID %u now has seeimprovedhide set to %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has seeimprovedhide set to %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET see_improved_hide = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "AC") == 0) { - c->Message(15,"NPCID %u now has %i Armor Class.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has %i Armor Class.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET ac = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "ATK") == 0) { - c->Message(15,"NPCID %u now has %i Attack.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has %i Attack.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET atk = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "Accuracy") == 0) { - c->Message(15,"NPCID %u now has %i Accuracy.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has %i Accuracy.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET accuracy = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "Avoidance") == 0) { - c->Message(15,"NPCID %u now has %i Avoidance.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has %i Avoidance.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET avoidance = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "level") == 0) { - c->Message(15,"NPCID %u is now level %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u is now level %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET level = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "maxlevel") == 0) { - c->Message(15,"NPCID %u now has a maximum level of %i.", npcTypeID, atoi(sep->argplus[2])); + c->Message(Chat::Yellow,"NPCID %u now has a maximum level of %i.", npcTypeID, atoi(sep->argplus[2])); std::string query = StringFormat("UPDATE npc_types SET maxlevel = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "qglobal") == 0) { - c->Message(15,"Quest globals have been %s for NPCID %u", atoi(sep->arg[2]) == 0 ? "disabled" : "enabled", npcTypeID); + c->Message(Chat::Yellow,"Quest globals have been %s for NPCID %u", atoi(sep->arg[2]) == 0 ? "disabled" : "enabled", npcTypeID); std::string query = StringFormat("UPDATE npc_types SET qglobal = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "npcaggro") == 0) { - c->Message(15,"NPCID %u will now %s other NPCs with negative faction npc_value", npcTypeID, atoi(sep->arg[2]) == 0? "not aggro": "aggro"); + c->Message(Chat::Yellow,"NPCID %u will now %s other NPCs with negative faction npc_value", npcTypeID, atoi(sep->arg[2]) == 0? "not aggro": "aggro"); std::string query = StringFormat("UPDATE npc_types SET npc_aggro = %i WHERE id = %i", atoi(sep->argplus[2]) == 0? 0: 1, npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "spawn_limit") == 0) { - c->Message(15,"NPCID %u now has a spawn limit of %i", npcTypeID, atoi(sep->arg[2])); + c->Message(Chat::Yellow,"NPCID %u now has a spawn limit of %i", npcTypeID, atoi(sep->arg[2])); std::string query = StringFormat("UPDATE npc_types SET spawn_limit = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "Attackspeed") == 0) { - c->Message(15,"NPCID %u now has attack_speed set to %f", npcTypeID, atof(sep->arg[2])); + c->Message(Chat::Yellow,"NPCID %u now has attack_speed set to %f", npcTypeID, atof(sep->arg[2])); std::string query = StringFormat("UPDATE npc_types SET attack_speed = %f WHERE id = %i", atof(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "Attackdelay") == 0) { - c->Message(15,"NPCID %u now has attack_delay set to %i", npcTypeID,atoi(sep->arg[2])); + c->Message(Chat::Yellow,"NPCID %u now has attack_delay set to %i", npcTypeID,atoi(sep->arg[2])); std::string query = StringFormat("UPDATE npc_types SET attack_delay = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "Attackcount") == 0) { - c->Message(15,"NPCID %u now has attack_count set to %i", npcTypeID,atoi(sep->arg[2])); + c->Message(Chat::Yellow,"NPCID %u now has attack_count set to %i", npcTypeID,atoi(sep->arg[2])); std::string query = StringFormat("UPDATE npc_types SET attack_count = %i WHERE id = %i", atoi(sep->argplus[2]),npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "findable") == 0) { - c->Message(15,"NPCID %u is now %s", npcTypeID, atoi(sep->arg[2]) == 0? "not findable": "findable"); + c->Message(Chat::Yellow,"NPCID %u is now %s", npcTypeID, atoi(sep->arg[2]) == 0? "not findable": "findable"); std::string query = StringFormat("UPDATE npc_types SET findable = %i WHERE id = %i", atoi(sep->argplus[2]) == 0? 0: 1, npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "trackable") == 0) { - c->Message(15,"NPCID %u is now %s", npcTypeID, atoi(sep->arg[2]) == 0? "not trackable": "trackable"); + c->Message(Chat::Yellow,"NPCID %u is now %s", npcTypeID, atoi(sep->arg[2]) == 0? "not trackable": "trackable"); std::string query = StringFormat("UPDATE npc_types SET trackable = %i WHERE id = %i", atoi(sep->argplus[2]) == 0? 0: 1, npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "weapon") == 0) { - c->Message(15,"NPCID %u will have item graphic %i set to his primary and item graphic %i set to his secondary on repop.", npcTypeID, atoi(sep->arg[2]), atoi(sep->arg[3])); + c->Message(Chat::Yellow,"NPCID %u will have item graphic %i set to his primary and item graphic %i set to his secondary on repop.", npcTypeID, atoi(sep->arg[2]), atoi(sep->arg[3])); std::string query = StringFormat("UPDATE npc_types SET d_melee_texture1 = %i, d_melee_texture2 = %i WHERE id = %i", atoi(sep->arg[2]), atoi(sep->arg[3]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "featuresave") == 0) { - c->Message(15,"NPCID %u saved with all current facial feature settings", npcTypeID); + c->Message(Chat::Yellow,"NPCID %u saved with all current facial feature settings", npcTypeID); Mob* target = c->GetTarget(); std::string query = StringFormat("UPDATE npc_types " "SET luclin_haircolor = %i, luclin_beardcolor = %i, " @@ -7856,14 +7967,14 @@ void command_npcedit(Client *c, const Seperator *sep) } if (strcasecmp(sep->arg[1], "color") == 0) { - c->Message(15,"NPCID %u now has %i red, %i green, and %i blue tinting on their armor.", npcTypeID, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4])); + c->Message(Chat::Yellow,"NPCID %u now has %i red, %i green, and %i blue tinting on their armor.", npcTypeID, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4])); std::string query = StringFormat("UPDATE npc_types SET armortint_red = %i, armortint_green = %i, armortint_blue = %i WHERE id = %i", atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "armortint_id") == 0) { - c->Message(15,"NPCID %u now has field 'armortint_id' set to %s", npcTypeID, sep->arg[2]); + c->Message(Chat::Yellow,"NPCID %u now has field 'armortint_id' set to %s", npcTypeID, sep->arg[2]); std::string query = StringFormat("UPDATE npc_types SET armortint_id = '%s' WHERE id = %i", sep->argplus[2], npcTypeID); database.QueryDatabase(query); return; @@ -7889,7 +8000,7 @@ void command_npcedit(Client *c, const Seperator *sep) return; } - c->Message(15,"NPCID %u now has the animation set to %i on spawn with spawngroup %i", npcTypeID, animation, c->GetTarget()->CastToNPC()->GetSp2() ); + c->Message(Chat::Yellow,"NPCID %u now has the animation set to %i on spawn with spawngroup %i", npcTypeID, animation, c->GetTarget()->CastToNPC()->GetSp2() ); std::string query = StringFormat("UPDATE spawn2 SET animation = %i " "WHERE spawngroupID = %i", animation, c->GetTarget()->CastToNPC()->GetSp2()); database.QueryDatabase(query); @@ -7898,42 +8009,42 @@ void command_npcedit(Client *c, const Seperator *sep) } if (strcasecmp(sep->arg[1], "scalerate") == 0) { - c->Message(15,"NPCID %u now has a scaling rate of %i.", npcTypeID, atoi(sep->arg[2])); + c->Message(Chat::Yellow,"NPCID %u now has a scaling rate of %i.", npcTypeID, atoi(sep->arg[2])); std::string query = StringFormat("UPDATE npc_types SET scalerate = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "healscale") == 0) { - c->Message(15, "NPCID %u now has a heal scaling rate of %i.", npcTypeID, atoi(sep->arg[2])); + c->Message(Chat::Yellow, "NPCID %u now has a heal scaling rate of %i.", npcTypeID, atoi(sep->arg[2])); std::string query = StringFormat("UPDATE npc_types SET healscale = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "spellscale") == 0) { - c->Message(15, "NPCID %u now has a spell scaling rate of %i.", npcTypeID, atoi(sep->arg[2])); + c->Message(Chat::Yellow, "NPCID %u now has a spell scaling rate of %i.", npcTypeID, atoi(sep->arg[2])); std::string query = StringFormat("UPDATE npc_types SET spellscale = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "no_target") == 0) { - c->Message(15, "NPCID %u is now %s.", npcTypeID, atoi(sep->arg[2]) == 0? "targetable": "untargetable"); + c->Message(Chat::Yellow, "NPCID %u is now %s.", npcTypeID, atoi(sep->arg[2]) == 0? "targetable": "untargetable"); std::string query = StringFormat("UPDATE npc_types SET no_target_hotkey = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "version") == 0) { - c->Message(15, "NPCID %u is now version %i.", npcTypeID, atoi(sep->arg[2])); + c->Message(Chat::Yellow, "NPCID %u is now version %i.", npcTypeID, atoi(sep->arg[2])); std::string query = StringFormat("UPDATE npc_types SET version = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; } if (strcasecmp(sep->arg[1], "slow_mitigation") == 0) { - c->Message(15, "NPCID %u's slow mitigation limit is now %i.", npcTypeID, atoi(sep->arg[2])); + c->Message(Chat::Yellow, "NPCID %u's slow mitigation limit is now %i.", npcTypeID, atoi(sep->arg[2])); std::string query = StringFormat("UPDATE npc_types SET slow_mitigation = %i WHERE id = %i", atoi(sep->argplus[2]), npcTypeID); database.QueryDatabase(query); return; @@ -7981,7 +8092,7 @@ void command_qglobal(Client *c, const Seperator *sep) { Mob *target = c->GetTarget(); if(!target || !target->IsNPC()) { - c->Message(13, "NPC Target Required!"); + c->Message(Chat::Red, "NPC Target Required!"); return; } @@ -7990,11 +8101,11 @@ void command_qglobal(Client *c, const Seperator *sep) { target->GetNPCTypeID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - c->Message(15, "Could not update database."); + c->Message(Chat::Yellow, "Could not update database."); return; } - c->Message(15, "Success! Changes take effect on zone reboot."); + c->Message(Chat::Yellow, "Success! Changes take effect on zone reboot."); return; } @@ -8003,26 +8114,26 @@ void command_qglobal(Client *c, const Seperator *sep) { target->GetNPCTypeID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - c->Message(15, "Could not update database."); + c->Message(Chat::Yellow, "Could not update database."); return; } - c->Message(15, "Success! Changes take effect on zone reboot."); + c->Message(Chat::Yellow, "Success! Changes take effect on zone reboot."); return; } if(!strcasecmp(sep->arg[1], "view")) { const NPCType *type = database.LoadNPCTypesData(target->GetNPCTypeID()); if(!type) - c->Message(15, "Invalid NPC type."); + c->Message(Chat::Yellow, "Invalid NPC type."); else if(type->qglobal) - c->Message(15, "This NPC has quest globals active."); + c->Message(Chat::Yellow, "This NPC has quest globals active."); else - c->Message(15, "This NPC has quest globals disabled."); + c->Message(Chat::Yellow, "This NPC has quest globals disabled."); return; } - c->Message(15, "Invalid action specified."); + c->Message(Chat::Yellow, "Invalid action specified."); } void command_path(Client *c, const Seperator *sep) @@ -8065,7 +8176,7 @@ void command_ucs(Client *c, const Seperator *sep) { if (!c) return; - + Log(Logs::Detail, Logs::UCS_Server, "Character %s attempting ucs reconnect while ucs server is %savailable", c->GetName(), (zone->IsUCSServerAvailable() ? "" : "un")); @@ -8149,7 +8260,7 @@ void command_undyeme(Client *c, const Seperator *sep) { if(c) { c->Undye(); - c->Message(13, "Dye removed from all slots. Please zone for the process to complete."); + c->Message(Chat::Red, "Dye removed from all slots. Please zone for the process to complete."); } } @@ -8203,7 +8314,7 @@ void command_aggro(Client *c, const Seperator *sep) } float d = atof(sep->arg[1]); if(d == 0.0f) { - c->Message(13, "Error: distance argument required."); + c->Message(Chat::Red, "Error: distance argument required."); return; } bool verbose = false; @@ -8330,13 +8441,13 @@ void command_flagedit(Client *c, const Seperator *sep) { } } if(zoneid < 1) { - c->Message(13, "zone required. see help."); + c->Message(Chat::Red, "zone required. see help."); return; } char flag_name[128]; if(sep->argplus[3][0] == '\0') { - c->Message(13, "flag name required. see help."); + c->Message(Chat::Red, "flag name required. see help."); return; } database.DoEscapeString(flag_name, sep->argplus[3], 64); @@ -8347,11 +8458,11 @@ void command_flagedit(Client *c, const Seperator *sep) { flag_name, zoneid, zone->GetInstanceVersion()); auto results = database.QueryDatabase(query); if(!results.Success()) { - c->Message(13, "Error updating zone: %s", results.ErrorMessage().c_str()); + c->Message(Chat::Red, "Error updating zone: %s", results.ErrorMessage().c_str()); return; } - c->Message(15, "Success! Zone %s now requires a flag, named %s", database.GetZoneName(zoneid), flag_name); + c->Message(Chat::Yellow, "Success! Zone %s now requires a flag, named %s", database.GetZoneName(zoneid), flag_name); return; } @@ -8365,7 +8476,7 @@ void command_flagedit(Client *c, const Seperator *sep) { } if(zoneid < 1) { - c->Message(13, "zone required. see help."); + c->Message(Chat::Red, "zone required. see help."); return; } @@ -8374,11 +8485,11 @@ void command_flagedit(Client *c, const Seperator *sep) { zoneid, zone->GetInstanceVersion()); auto results = database.QueryDatabase(query); if(!results.Success()) { - c->Message(15, "Error updating zone: %s", results.ErrorMessage().c_str()); + c->Message(Chat::Yellow, "Error updating zone: %s", results.ErrorMessage().c_str()); return; } - c->Message(15, "Success! Zone %s no longer requires a flag.", database.GetZoneName(zoneid)); + c->Message(Chat::Yellow, "Success! Zone %s no longer requires a flag.", database.GetZoneName(zoneid)); return; } @@ -8406,13 +8517,13 @@ void command_flagedit(Client *c, const Seperator *sep) { } } if(zoneid < 1) { - c->Message(13, "zone required. see help."); + c->Message(Chat::Red, "zone required. see help."); return; } Mob *t = c->GetTarget(); if(t == nullptr || !t->IsClient()) { - c->Message(13, "client target required"); + c->Message(Chat::Red, "client target required"); return; } @@ -8429,13 +8540,13 @@ void command_flagedit(Client *c, const Seperator *sep) { } } if(zoneid < 1) { - c->Message(13, "zone required. see help."); + c->Message(Chat::Red, "zone required. see help."); return; } Mob *t = c->GetTarget(); if(t == nullptr || !t->IsClient()) { - c->Message(13, "client target required"); + c->Message(Chat::Red, "client target required"); return; } @@ -8443,7 +8554,7 @@ void command_flagedit(Client *c, const Seperator *sep) { return; } - c->Message(15, "Invalid action specified. use '#flagedit help' for help"); + c->Message(Chat::Yellow, "Invalid action specified. use '#flagedit help' for help"); } void command_serverrules(Client *c, const Seperator *sep) @@ -8531,7 +8642,7 @@ void command_rules(Client *c, const Seperator *sep) { } else if(!strcasecmp(sep->arg[1], "listsets")) { std::map sets; if(!RuleManager::Instance()->ListRulesets(&database, sets)) { - c->Message(13, "Failed to list rule sets!"); + c->Message(Chat::Red, "Failed to list rule sets!"); return; } @@ -8550,11 +8661,11 @@ void command_rules(Client *c, const Seperator *sep) { //make sure this is a valid rule set.. int rsid = RuleManager::Instance()->GetRulesetID(&database, sep->arg[2]); if(rsid < 0) { - c->Message(13, "Unknown rule set '%s'", sep->arg[2]); + c->Message(Chat::Red, "Unknown rule set '%s'", sep->arg[2]); return; } if(!database.SetVariable("RuleSet", sep->arg[2])) { - c->Message(13, "Failed to update variables table to change selected rule set"); + c->Message(Chat::Red, "Failed to update variables table to change selected rule set"); return; } @@ -8566,7 +8677,7 @@ void command_rules(Client *c, const Seperator *sep) { //make sure this is a valid rule set.. int rsid = RuleManager::Instance()->GetRulesetID(&database, sep->arg[2]); if(rsid < 0) { - c->Message(13, "Unknown rule set '%s'", sep->arg[2]); + c->Message(Chat::Red, "Unknown rule set '%s'", sep->arg[2]); return; } RuleManager::Instance()->LoadRules(&database, sep->arg[2], true); @@ -8581,7 +8692,7 @@ void command_rules(Client *c, const Seperator *sep) { int prersid = RuleManager::Instance()->GetActiveRulesetID(); int rsid = RuleManager::Instance()->GetRulesetID(&database, sep->arg[2]); if(rsid < 0) { - c->Message(13, "Unable to query ruleset ID after store, it most likely failed."); + c->Message(Chat::Red, "Unable to query ruleset ID after store, it most likely failed."); } else { c->Message(0, "Stored rules as ruleset '%s' (%d)", sep->arg[2], rsid); if(prersid != rsid) { @@ -8589,41 +8700,41 @@ void command_rules(Client *c, const Seperator *sep) { } } } else { - c->Message(13, "Invalid argument count, see help."); + c->Message(Chat::Red, "Invalid argument count, see help."); return; } } else if(!strcasecmp(sep->arg[1], "reset")) { RuleManager::Instance()->ResetRules(true); c->Message(0, "The running ruleset has been set to defaults"); - + } else if(!strcasecmp(sep->arg[1], "get")) { if(sep->argnum != 2) { - c->Message(13, "Invalid argument count, see help."); + c->Message(Chat::Red, "Invalid argument count, see help."); return; } std::string value; if(!RuleManager::Instance()->GetRule(sep->arg[2], value)) - c->Message(13, "Unable to find rule %s", sep->arg[2]); + c->Message(Chat::Red, "Unable to find rule %s", sep->arg[2]); else c->Message(0, "%s - %s", sep->arg[2], value.c_str()); } else if(!strcasecmp(sep->arg[1], "set")) { if(sep->argnum != 3) { - c->Message(13, "Invalid argument count, see help."); + c->Message(Chat::Red, "Invalid argument count, see help."); return; } if(!RuleManager::Instance()->SetRule(sep->arg[2], sep->arg[3], nullptr, false, true)) { - c->Message(13, "Failed to modify rule"); + c->Message(Chat::Red, "Failed to modify rule"); } else { c->Message(0, "Rule modified locally."); } } else if(!strcasecmp(sep->arg[1], "setdb")) { if(sep->argnum != 3) { - c->Message(13, "Invalid argument count, see help."); + c->Message(Chat::Red, "Invalid argument count, see help."); return; } if(!RuleManager::Instance()->SetRule(sep->arg[2], sep->arg[3], &database, true, true)) { - c->Message(13, "Failed to modify rule"); + c->Message(Chat::Red, "Failed to modify rule"); } else { c->Message(0, "Rule modified locally and in the database."); } @@ -8631,7 +8742,7 @@ void command_rules(Client *c, const Seperator *sep) { if(sep->argnum == 1) { std::vector rule_list; if(!RuleManager::Instance()->ListCategories(rule_list)) { - c->Message(13, "Failed to list categories!"); + c->Message(Chat::Red, "Failed to list categories!"); return; } c->Message(0, "Rule Categories:"); @@ -8647,7 +8758,7 @@ void command_rules(Client *c, const Seperator *sep) { catfilt = sep->arg[2]; std::vector rule_list; if(!RuleManager::Instance()->ListRules(catfilt, rule_list)) { - c->Message(13, "Failed to list rules!"); + c->Message(Chat::Red, "Failed to list rules!"); return; } c->Message(0, "Rules in category %s:", sep->arg[2]); @@ -8658,11 +8769,11 @@ void command_rules(Client *c, const Seperator *sep) { c->Message(0, " %s", *cur); } } else { - c->Message(13, "Invalid argument count, see help."); + c->Message(Chat::Red, "Invalid argument count, see help."); } } else if(!strcasecmp(sep->arg[1], "values")) { if(sep->argnum != 2) { - c->Message(13, "Invalid argument count, see help."); + c->Message(Chat::Red, "Invalid argument count, see help."); return; } else { const char *catfilt = nullptr; @@ -8670,7 +8781,7 @@ void command_rules(Client *c, const Seperator *sep) { catfilt = sep->arg[2]; std::vector rule_list; if(!RuleManager::Instance()->ListRules(catfilt, rule_list)) { - c->Message(13, "Failed to list rules!"); + c->Message(Chat::Red, "Failed to list rules!"); return; } c->Message(0, "Rules & values in category %s:", sep->arg[2]); @@ -8684,7 +8795,7 @@ void command_rules(Client *c, const Seperator *sep) { } } else { - c->Message(15, "Invalid action specified. use '#rules help' for help"); + c->Message(Chat::Yellow, "Invalid action specified. use '#rules help' for help"); } } @@ -8724,44 +8835,44 @@ void command_task(Client *c, const Seperator *sep) { if(Count <= 0) Count = 1; } - c->Message(15, "Updating Task %i, Activity %i, Count %i", TaskID, ActivityID, Count); + c->Message(Chat::Yellow, "Updating Task %i, Activity %i, Count %i", TaskID, ActivityID, Count); c->UpdateTaskActivity(TaskID, ActivityID, Count); } return; } if(!strcasecmp(sep->arg[1], "reloadall")) { - c->Message(15, "Sending reloadtasks to world"); + c->Message(Chat::Yellow, "Sending reloadtasks to world"); worldserver.SendReloadTasks(RELOADTASKS); - c->Message(15, "Back again"); + c->Message(Chat::Yellow, "Back again"); return; } if(!strcasecmp(sep->arg[1], "reload")) { if(sep->arg[2][0] != '\0') { if(!strcasecmp(sep->arg[2], "lists")) { - c->Message(15, "Sending reload lists to world"); + c->Message(Chat::Yellow, "Sending reload lists to world"); worldserver.SendReloadTasks(RELOADTASKGOALLISTS); - c->Message(15, "Back again"); + c->Message(Chat::Yellow, "Back again"); return; } if(!strcasecmp(sep->arg[2], "prox")) { - c->Message(15, "Sending reload proximities to world"); + c->Message(Chat::Yellow, "Sending reload proximities to world"); worldserver.SendReloadTasks(RELOADTASKPROXIMITIES); - c->Message(15, "Back again"); + c->Message(Chat::Yellow, "Back again"); return; } if(!strcasecmp(sep->arg[2], "sets")) { - c->Message(15, "Sending reload task sets to world"); + c->Message(Chat::Yellow, "Sending reload task sets to world"); worldserver.SendReloadTasks(RELOADTASKSETS); - c->Message(15, "Back again"); + c->Message(Chat::Yellow, "Back again"); return; } if(!strcasecmp(sep->arg[2], "task") && (sep->arg[3][0] != '\0')) { int TaskID = atoi(sep->arg[3]); if((TaskID > 0) && (TaskID < MAXTASKS)) { - c->Message(15, "Sending reload task %i to world"); + c->Message(Chat::Yellow, "Sending reload task %i to world"); worldserver.SendReloadTasks(RELOADTASKS, TaskID); - c->Message(15, "Back again"); + c->Message(Chat::Yellow, "Back again"); return; } } @@ -8776,7 +8887,7 @@ void command_reloadtitles(Client *c, const Seperator *sep) auto pack = new ServerPacket(ServerOP_ReloadTitles, 0); worldserver.SendPacket(pack); safe_delete(pack); - c->Message(15, "Player Titles Reloaded."); + c->Message(Chat::Yellow, "Player Titles Reloaded."); } @@ -8820,7 +8931,7 @@ void command_traindisc(Client *c, const Seperator *sep) for( ; spell_id < SPDAT_RECORDS; ++spell_id) { if (spell_id < 0 || spell_id >= SPDAT_RECORDS) { - c->Message(13, "FATAL ERROR: Spell id out-of-range (id: %i, min: 0, max: %i)", spell_id, SPDAT_RECORDS); + c->Message(Chat::Red, "FATAL ERROR: Spell id out-of-range (id: %i, min: 0, max: %i)", spell_id, SPDAT_RECORDS); return; } @@ -8833,10 +8944,10 @@ void command_traindisc(Client *c, const Seperator *sep) break; if (spells[spell_id].skill == 52) break; - + uint16 spell_id_ = (uint16)spell_id; if ((spell_id_ != spell_id) || (spell_id != spell_id_)) { - c->Message(13, "FATAL ERROR: Type conversion data loss with spell_id (%i != %u)", spell_id, spell_id_); + c->Message(Chat::Red, "FATAL ERROR: Type conversion data loss with spell_id (%i != %u)", spell_id, spell_id_); return; } @@ -8845,7 +8956,7 @@ void command_traindisc(Client *c, const Seperator *sep) for (uint32 r = 0; r < MAX_PP_DISCIPLINES; ++r) { if (t->GetPP().disciplines.values[r] == spell_id_) { - t->Message(13, "You already know this discipline."); + t->Message(Chat::Red, "You already know this discipline."); break; // continue the 1st loop } else if (t->GetPP().disciplines.values[r] == 0) { @@ -9033,7 +9144,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep) auto results = database.QueryDatabase(query); if (!results.Success()) { c->Message(0, "Invalid Arguments -- MySQL gave the following error:"); - c->Message(13, results.ErrorMessage().c_str()); + c->Message(Chat::Red, results.ErrorMessage().c_str()); return; } @@ -9053,7 +9164,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep) auto results = database.QueryDatabase(query); if (!results.Success()) { c->Message(0, "Invalid Arguments -- MySQL gave the following error:"); - c->Message(13, results.ErrorMessage().c_str()); + c->Message(Chat::Red, results.ErrorMessage().c_str()); return; } @@ -9076,7 +9187,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep) auto results = database.QueryDatabase(query); if (!results.Success()) { c->Message(0, "Invalid Arguments -- MySQL gave the following error:"); - c->Message(13, results.ErrorMessage().c_str()); + c->Message(Chat::Red, results.ErrorMessage().c_str()); return; } @@ -9098,7 +9209,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep) auto results = database.QueryDatabase(query); if (!results.Success()) { c->Message(0, "Invalid Arguments -- MySQL gave the following error:"); - c->Message(13, results.ErrorMessage().c_str()); + c->Message(Chat::Red, results.ErrorMessage().c_str()); return; } @@ -9129,8 +9240,8 @@ void command_advnpcspawn(Client *c, const Seperator *sep) std::string query = StringFormat("DELETE FROM spawn2 WHERE id = '%i'", s2->GetID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - c->Message(13, "Update failed! MySQL gave the following error:"); - c->Message(13, results.ErrorMessage().c_str()); + c->Message(Chat::Red, "Update failed! MySQL gave the following error:"); + c->Message(Chat::Red, results.ErrorMessage().c_str()); return; } @@ -9158,8 +9269,8 @@ void command_advnpcspawn(Client *c, const Seperator *sep) c->GetX(), c->GetY(), c->GetZ(), c->GetHeading(),s2->GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - c->Message(13, "Update failed! MySQL gave the following error:"); - c->Message(13, results.ErrorMessage().c_str()); + c->Message(Chat::Red, "Update failed! MySQL gave the following error:"); + c->Message(Chat::Red, results.ErrorMessage().c_str()); return; } @@ -9198,8 +9309,8 @@ void command_advnpcspawn(Client *c, const Seperator *sep) "WHERE id = '%i'", new_rs, new_var, s2->GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - c->Message(13, "Update failed! MySQL gave the following error:"); - c->Message(13, results.ErrorMessage().c_str()); + c->Message(Chat::Red, "Update failed! MySQL gave the following error:"); + c->Message(Chat::Red, results.ErrorMessage().c_str()); return; } @@ -9227,8 +9338,8 @@ void command_advnpcspawn(Client *c, const Seperator *sep) version, c->GetTarget()->CastToNPC()->GetSp2()); auto results = database.QueryDatabase(query); if (!results.Success()) { - c->Message(13, "Update failed! MySQL gave the following error:"); - c->Message(13, results.ErrorMessage().c_str()); + c->Message(Chat::Red, "Update failed! MySQL gave the following error:"); + c->Message(Chat::Red, results.ErrorMessage().c_str()); return; } @@ -9508,26 +9619,26 @@ void command_netstats(Client *c, const Seperator *sep) if (c->GetTarget() && c->GetTarget()->IsClient()) { client = c->GetTarget()->CastToClient(); } - + if (strcasecmp(sep->arg[1], "reset") == 0) { auto connection = c->Connection(); c->Message(0, "Resetting client stats (packet loss will not read correctly after reset)."); connection->ResetStats(); return; } - + auto connection = c->Connection(); auto opts = connection->GetManager()->GetOptions(); auto eqs_stats = connection->GetStats(); auto &stats = eqs_stats.DaybreakStats; auto now = EQ::Net::Clock::now(); auto sec_since_stats_reset = std::chrono::duration_cast>(now - stats.created).count(); - + c->Message(0, "Netstats:"); c->Message(0, "--------------------------------------------------------------------"); c->Message(0, "Sent Bytes: %u (%.2f/sec)", stats.sent_bytes, stats.sent_bytes / sec_since_stats_reset); c->Message(0, "Recv Bytes: %u (%.2f/sec)", stats.recv_bytes, stats.recv_bytes / sec_since_stats_reset); - c->Message(0, "Bytes Before Encode (Sent): %u, Compression Rate: %.2f%%", stats.bytes_before_encode, + c->Message(0, "Bytes Before Encode (Sent): %u, Compression Rate: %.2f%%", stats.bytes_before_encode, static_cast(stats.bytes_before_encode - stats.sent_bytes) / static_cast(stats.bytes_before_encode) * 100.0); c->Message(0, "Bytes After Decode (Recv): %u, Compression Rate: %.2f%%", stats.bytes_after_decode, static_cast(stats.bytes_after_decode - stats.recv_bytes) / static_cast(stats.bytes_after_decode) * 100.0); @@ -9549,11 +9660,11 @@ void command_netstats(Client *c, const Seperator *sep) c->Message(0, "Resent Fragments: %u (%.2f/sec)", stats.resent_fragments, stats.resent_fragments / sec_since_stats_reset); c->Message(0, "Resent Non-Fragments: %u (%.2f/sec)", stats.resent_full, stats.resent_full / sec_since_stats_reset); c->Message(0, "Dropped Datarate Packets: %u (%.2f/sec)", stats.dropped_datarate_packets, stats.dropped_datarate_packets / sec_since_stats_reset); - + if (opts.daybreak_options.outgoing_data_rate > 0.0) { c->Message(0, "Outgoing Link Saturation %.2f%% (%.2fkb/sec)", 100.0 * (1.0 - ((opts.daybreak_options.outgoing_data_rate - stats.datarate_remaining) / opts.daybreak_options.outgoing_data_rate)), opts.daybreak_options.outgoing_data_rate); } - + if (strcasecmp(sep->arg[1], "full") == 0) { c->Message(0, "--------------------------------------------------------------------"); c->Message(0, "Sent Packet Types"); @@ -9573,7 +9684,7 @@ void command_netstats(Client *c, const Seperator *sep) } } } - + c->Message(0, "--------------------------------------------------------------------"); } } @@ -10761,22 +10872,22 @@ void command_raidloot(Client *c, const Seperator *sep) if(strcasecmp(sep->arg[1], "LEADER") == 0) { - c->Message(15, "Loot type changed to: 1"); + c->Message(Chat::Yellow, "Loot type changed to: 1"); r->ChangeLootType(1); } else if(strcasecmp(sep->arg[1], "GROUPLEADER") == 0) { - c->Message(15, "Loot type changed to: 2"); + c->Message(Chat::Yellow, "Loot type changed to: 2"); r->ChangeLootType(2); } else if(strcasecmp(sep->arg[1], "SELECTED") == 0) { - c->Message(15, "Loot type changed to: 3"); + c->Message(Chat::Yellow, "Loot type changed to: 3"); r->ChangeLootType(3); } else if(strcasecmp(sep->arg[1], "ALL") == 0) { - c->Message(15, "Loot type changed to: 4"); + c->Message(Chat::Yellow, "Loot type changed to: 4"); r->ChangeLootType(4); } else @@ -11052,7 +11163,7 @@ void command_reloadallrules(Client *c, const Seperator *sep) { auto pack = new ServerPacket(ServerOP_ReloadRules, 0); worldserver.SendPacket(pack); - c->Message(13, "Successfully sent the packet to world to reload rules globally. (including world)"); + c->Message(Chat::Red, "Successfully sent the packet to world to reload rules globally. (including world)"); safe_delete(pack); } @@ -11064,7 +11175,7 @@ void command_reloadworldrules(Client *c, const Seperator *sep) { auto pack = new ServerPacket(ServerOP_ReloadRulesWorld, 0); worldserver.SendPacket(pack); - c->Message(13, "Successfully sent the packet to world to reload rules. (only world)"); + c->Message(Chat::Red, "Successfully sent the packet to world to reload rules. (only world)"); safe_delete(pack); } } @@ -11080,11 +11191,11 @@ void command_camerashake(Client *c, const Seperator *sep) scss->duration = atoi(sep->arg[1]); scss->intensity = atoi(sep->arg[2]); worldserver.SendPacket(pack); - c->Message(13, "Successfully sent the packet to world! Shake it, world, shake it!"); + c->Message(Chat::Red, "Successfully sent the packet to world! Shake it, world, shake it!"); safe_delete(pack); } else { - c->Message(13, "Usage -- #camerashake [duration], [intensity [1-10])"); + c->Message(Chat::Red, "Usage -- #camerashake [duration], [intensity [1-10])"); } } return; @@ -11096,7 +11207,7 @@ void command_disarmtrap(Client *c, const Seperator *sep) if(!target) { - c->Message(13, "You must have a target."); + c->Message(Chat::Red, "You must have a target."); return; } @@ -11106,13 +11217,13 @@ void command_disarmtrap(Client *c, const Seperator *sep) { if(DistanceSquaredNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse)) { - c->Message(13, "%s is too far away.", target->GetCleanName()); + c->Message(Chat::Red, "%s is too far away.", target->GetCleanName()); return; } c->HandleLDoNDisarm(target->CastToNPC(), c->GetSkill(EQEmu::skills::SkillDisarmTraps), LDoNTypeMechanical); } else - c->Message(13, "You do not have the disarm trap skill."); + c->Message(Chat::Red, "You do not have the disarm trap skill."); } } @@ -11121,7 +11232,7 @@ void command_sensetrap(Client *c, const Seperator *sep) Mob * target = c->GetTarget(); if(!target) { - c->Message(13, "You must have a target."); + c->Message(Chat::Red, "You must have a target."); return; } @@ -11131,13 +11242,13 @@ void command_sensetrap(Client *c, const Seperator *sep) { if(DistanceSquaredNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse)) { - c->Message(13, "%s is too far away.", target->GetCleanName()); + c->Message(Chat::Red, "%s is too far away.", target->GetCleanName()); return; } c->HandleLDoNSenseTraps(target->CastToNPC(), c->GetSkill(EQEmu::skills::SkillSenseTraps), LDoNTypeMechanical); } else - c->Message(13, "You do not have the sense traps skill."); + c->Message(Chat::Red, "You do not have the sense traps skill."); } } @@ -11146,7 +11257,7 @@ void command_picklock(Client *c, const Seperator *sep) Mob * target = c->GetTarget(); if(!target) { - c->Message(13, "You must have a target."); + c->Message(Chat::Red, "You must have a target."); return; } @@ -11156,20 +11267,20 @@ void command_picklock(Client *c, const Seperator *sep) { if(DistanceSquaredNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse)) { - c->Message(13, "%s is too far away.", target->GetCleanName()); + c->Message(Chat::Red, "%s is too far away.", target->GetCleanName()); return; } c->HandleLDoNPickLock(target->CastToNPC(), c->GetSkill(EQEmu::skills::SkillPickLock), LDoNTypeMechanical); } else - c->Message(13, "You do not have the pick locks skill."); + c->Message(Chat::Red, "You do not have the pick locks skill."); } } void command_profanity(Client *c, const Seperator *sep) { std::string arg1(sep->arg[1]); - + while (true) { if (arg1.compare("list") == 0) { // do nothing @@ -11182,21 +11293,21 @@ void command_profanity(Client *c, const Seperator *sep) } else if (arg1.compare("add") == 0) { if (!EQEmu::ProfanityManager::AddProfanity(&database, sep->arg[2])) - c->Message(CC_Red, "Could not add '%s' to the profanity list.", sep->arg[2]); + c->Message(Chat::Red, "Could not add '%s' to the profanity list.", sep->arg[2]); auto pack = new ServerPacket(ServerOP_RefreshCensorship); worldserver.SendPacket(pack); safe_delete(pack); } else if (arg1.compare("del") == 0) { if (!EQEmu::ProfanityManager::RemoveProfanity(&database, sep->arg[2])) - c->Message(CC_Red, "Could not delete '%s' from the profanity list.", sep->arg[2]); + c->Message(Chat::Red, "Could not delete '%s' from the profanity list.", sep->arg[2]); auto pack = new ServerPacket(ServerOP_RefreshCensorship); worldserver.SendPacket(pack); safe_delete(pack); } else if (arg1.compare("reload") == 0) { if (!EQEmu::ProfanityManager::UpdateProfanityList(&database)) - c->Message(CC_Red, "Could not reload the profanity list."); + c->Message(Chat::Red, "Could not reload the profanity list."); auto pack = new ServerPacket(ServerOP_RefreshCensorship); worldserver.SendPacket(pack); safe_delete(pack); @@ -11217,10 +11328,10 @@ void command_profanity(Client *c, const Seperator *sep) popup.append("** End of List **
"); c->SendPopupToClient("Profanity List", popup.c_str()); - + return; } - + c->Message(0, "Usage: #profanity [list] - shows profanity list"); c->Message(0, "Usage: #profanity [clear] - deletes all entries"); c->Message(0, "Usage: #profanity [add] [] - adds entry"); @@ -11255,7 +11366,7 @@ void command_mysql(Client *c, const Seperator *sep) case 's': optionS = true; break; case 'h': optionH = true; break; default: - c->Message(15, "%s, there is no option '%c'", c->GetName(), sep->arg[argnum][1]); + c->Message(Chat::Yellow, "%s, there is no option '%c'", c->GetName(), sep->arg[argnum][1]); return; } ++argnum; @@ -11278,7 +11389,7 @@ void command_mysql(Client *c, const Seperator *sep) query.insert(pos, "%%"); pos = query.find('#'); } - c->Message(15, "---Running query: '%s'", query.c_str()); + c->Message(Chat::Yellow, "---Running query: '%s'", query.c_str()); for (auto row = results.begin(); row != results.end(); ++row) { std::stringstream lineText; @@ -11322,7 +11433,7 @@ void command_xtargets(Client *c, const Seperator *sep) if((NewMax < 5) || (NewMax > XTARGET_HARDCAP)) { - c->Message(13, "Number of XTargets must be between 5 and %i", XTARGET_HARDCAP); + c->Message(Chat::Red, "Number of XTargets must be between 5 and %i", XTARGET_HARDCAP); return; } t->SetMaxXTargets(NewMax); @@ -11359,7 +11470,7 @@ void command_zopp(Client *c, const Seperator *sep) const EQEmu::ItemData* FakeItem = database.GetItem(itemid); if (!FakeItem) { - c->Message(13, "Error: Item [%u] is not a valid item id.", itemid); + c->Message(Chat::Red, "Error: Item [%u] is not a valid item id.", itemid); return; } @@ -11369,12 +11480,12 @@ void command_zopp(Client *c, const Seperator *sep) item_status = static_cast(item->MinStatus); } if (item_status > c->Admin()) { - c->Message(13, "Error: Insufficient status to use this command."); + c->Message(Chat::Red, "Error: Insufficient status to use this command."); return; } if (charges < 0 || charges > FakeItem->StackSize) { - c->Message(13, "Warning: The specified charge count does not meet expected criteria!"); + c->Message(Chat::Red, "Warning: The specified charge count does not meet expected criteria!"); c->Message(0, "Processing request..results may cause unpredictable behavior."); } @@ -11601,7 +11712,7 @@ void command_tune(Client *c, const Seperator *sep) if (!pct_mitigation) { - c->Message(13, "#Tune - Error must enter the desired percent mitigation on defender. Ie. Defender to mitigate on average 20 pct of max damage."); + c->Message(Chat::Red, "#Tune - Error must enter the desired percent mitigation on defender. Ie. Defender to mitigate on average 20 pct of max damage."); return; } @@ -11636,7 +11747,7 @@ void command_tune(Client *c, const Seperator *sep) if (!pct_mitigation) { - c->Message(13, "#Tune - Error must enter the desired percent mitigation on defender. Ie. Defender to mitigate on average 20 pct of max damage."); + c->Message(Chat::Red, "#Tune - Error must enter the desired percent mitigation on defender. Ie. Defender to mitigate on average 20 pct of max damage."); return; } @@ -11672,7 +11783,7 @@ void command_tune(Client *c, const Seperator *sep) if (!hit_chance) { - c->Message(10, "#Tune - Error must enter the desired percent mitigation on defender. Ie. Defender to mitigate on average 20 pct of max damage."); + c->Message(Chat::NPCQuestSay, "#Tune - Error must enter the desired percent mitigation on defender. Ie. Defender to mitigate on average 20 pct of max damage."); return; } @@ -11687,7 +11798,7 @@ void command_tune(Client *c, const Seperator *sep) if (hit_chance > RuleR(Combat,MaxChancetoHit) || hit_chance < RuleR(Combat,MinChancetoHit)) { - c->Message(10, "#Tune - Error hit chance out of bounds. [Max %.2f Min .2f]", RuleR(Combat,MaxChancetoHit),RuleR(Combat,MinChancetoHit)); + c->Message(Chat::NPCQuestSay, "#Tune - Error hit chance out of bounds. [Max %.2f Min .2f]", RuleR(Combat,MaxChancetoHit),RuleR(Combat,MinChancetoHit)); return; } @@ -11729,7 +11840,7 @@ void command_tune(Client *c, const Seperator *sep) if (hit_chance > RuleR(Combat,MaxChancetoHit) || hit_chance < RuleR(Combat,MinChancetoHit)) { - c->Message(10, "#Tune - Error hit chance out of bounds. [Max %.2f Min .2f]", RuleR(Combat,MaxChancetoHit),RuleR(Combat,MinChancetoHit)); + c->Message(Chat::NPCQuestSay, "#Tune - Error hit chance out of bounds. [Max %.2f Min .2f]", RuleR(Combat,MaxChancetoHit),RuleR(Combat,MinChancetoHit)); return; } @@ -11776,7 +11887,7 @@ void command_logs(Client *c, const Seperator *sep){ if (strcasecmp(sep->arg[1], "reload_all") == 0){ auto pack = new ServerPacket(ServerOP_ReloadLogs, 0); worldserver.SendPacket(pack); - c->Message(13, "Successfully sent the packet to world to reload log settings from the database for all zones"); + c->Message(Chat::Red, "Successfully sent the packet to world to reload log settings from the database for all zones"); safe_delete(pack); } /* #logs list_settings */ @@ -11821,8 +11932,8 @@ void command_logs(Client *c, const Seperator *sep){ c->Message(0, "--- #logs set gmsay 20 1 - Would output Quest errors to gmsay"); } if (logs_set == 1){ - c->Message(15, "Your Log Settings have been applied"); - c->Message(15, "Output Method: %s :: Debug Level: %i - Category: %s", sep->arg[2], atoi(sep->arg[4]), Logs::LogCategoryName[atoi(sep->arg[3])]); + c->Message(Chat::Yellow, "Your Log Settings have been applied"); + c->Message(Chat::Yellow, "Output Method: %s :: Debug Level: %i - Category: %s", sep->arg[2], atoi(sep->arg[4]), Logs::LogCategoryName[atoi(sep->arg[3])]); } /* We use a general 'is_category_enabled' now, let's update when we update any output settings This is used in hot places of code to check if its enabled in any way before triggering logs @@ -11901,19 +12012,20 @@ void command_hotfix(Client *c, const Seperator *sep) { } c->Message(0, "Creating and applying hotfix"); - std::thread t1([c,hotfix_name]() { + std::thread t1( + [c, hotfix_name]() { #ifdef WIN32 - if(hotfix_name.length() > 0) { - system(StringFormat("shared_memory -hotfix=%s", hotfix_name.c_str()).c_str()); - } else { - system(StringFormat("shared_memory").c_str()); - } + if(hotfix_name.length() > 0) { + if(system(StringFormat("shared_memory -hotfix=%s", hotfix_name.c_str()).c_str())); + } else { + if(system(StringFormat("shared_memory").c_str())); + } #else if(hotfix_name.length() > 0) { - system(StringFormat("./shared_memory -hotfix=%s", hotfix_name.c_str()).c_str()); + if(system(StringFormat("./shared_memory -hotfix=%s", hotfix_name.c_str()).c_str())); } else { - system(StringFormat("./shared_memory").c_str()); + if(system(StringFormat("./shared_memory").c_str())); } #endif database.SetVariable("hotfix_name", hotfix_name); @@ -11945,16 +12057,16 @@ void command_load_shared_memory(Client *c, const Seperator *sep) { std::thread t1([c,hotfix_name]() { #ifdef WIN32 if(hotfix_name.length() > 0) { - system(StringFormat("shared_memory -hotfix=%s", hotfix_name.c_str()).c_str()); + if(system(StringFormat("shared_memory -hotfix=%s", hotfix_name.c_str()).c_str())); } else { - system(StringFormat("shared_memory").c_str()); + if(system(StringFormat("shared_memory").c_str())); } #else if(hotfix_name.length() > 0) { - system(StringFormat("./shared_memory -hotfix=%s", hotfix_name.c_str()).c_str()); + if(system(StringFormat("./shared_memory -hotfix=%s", hotfix_name.c_str()).c_str())); } else { - system(StringFormat("./shared_memory").c_str()); + if(system(StringFormat("./shared_memory").c_str())); } #endif c->Message(0, "Shared memory segment finished loading."); @@ -11984,7 +12096,7 @@ void command_reloadperlexportsettings(Client *c, const Seperator *sep) { auto pack = new ServerPacket(ServerOP_ReloadPerlExportSettings, 0); worldserver.SendPacket(pack); - c->Message(13, "Successfully sent the packet to world to reload Perl Export settings"); + c->Message(Chat::Red, "Successfully sent the packet to world to reload Perl Export settings"); safe_delete(pack); } @@ -11998,16 +12110,16 @@ void command_trapinfo(Client *c, const Seperator *sep) void command_reloadtraps(Client *c, const Seperator *sep) { entity_list.UpdateAllTraps(true, true); - c->Message(CC_Default, "Traps reloaded for %s.", zone->GetShortName()); + c->Message(Chat::Default, "Traps reloaded for %s.", zone->GetShortName()); } void command_scale(Client *c, const Seperator *sep) { if (sep->argnum == 0) { - c->Message(15, "# Usage # "); - c->Message(15, "#scale [static/dynamic] (With targeted NPC)"); - c->Message(15, "#scale [npc_name_search] [static/dynamic] (To make zone-wide changes)"); - c->Message(15, "#scale all [static/dynamic]"); + c->Message(Chat::Yellow, "# Usage # "); + c->Message(Chat::Yellow, "#scale [static/dynamic] (With targeted NPC)"); + c->Message(Chat::Yellow, "#scale [npc_name_search] [static/dynamic] (To make zone-wide changes)"); + c->Message(Chat::Yellow, "#scale all [static/dynamic]"); return; } @@ -12019,11 +12131,11 @@ void command_scale(Client *c, const Seperator *sep) bool apply_status = false; if (strcasecmp(sep->arg[1], "dynamic") == 0) { - c->Message(15, "Applying global base scaling to npc dynamically (All stats set to zeroes)..."); + c->Message(Chat::Yellow, "Applying global base scaling to npc dynamically (All stats set to zeroes)..."); apply_status = npc_scale_manager->ApplyGlobalBaseScalingToNPCDynamically(npc); } else if (strcasecmp(sep->arg[1], "static") == 0) { - c->Message(15, "Applying global base scaling to npc statically (Copying base stats onto NPC)..."); + c->Message(Chat::Yellow, "Applying global base scaling to npc statically (Copying base stats onto NPC)..."); apply_status = npc_scale_manager->ApplyGlobalBaseScalingToNPCStatically(npc); } else { @@ -12031,15 +12143,15 @@ void command_scale(Client *c, const Seperator *sep) } if (apply_status) { - c->Message(15, "Applied to NPC '%s' successfully!", npc->GetName()); + c->Message(Chat::Yellow, "Applied to NPC '%s' successfully!", npc->GetName()); } else { - c->Message(15, "Failed to load scaling data from the database " + c->Message(Chat::Yellow, "Failed to load scaling data from the database " "for this npc / type, see 'NPCScaling' log for more info"); } } else if (c->GetTarget() && sep->argnum < 2) { - c->Message(15, "Target must be an npc!"); + c->Message(Chat::Yellow, "Target must be an npc!"); } /** @@ -12056,9 +12168,9 @@ void command_scale(Client *c, const Seperator *sep) } if (scale_type.length() <= 0) { - c->Message(15, "You must first set if you intend on using static versus dynamic for these changes"); - c->Message(15, "#scale [npc_name_search] [static/dynamic]"); - c->Message(15, "#scale all [static/dynamic]"); + c->Message(Chat::Yellow, "You must first set if you intend on using static versus dynamic for these changes"); + c->Message(Chat::Yellow, "#scale [npc_name_search] [static/dynamic]"); + c->Message(Chat::Yellow, "#scale all [static/dynamic]"); return; } @@ -12108,7 +12220,7 @@ void command_scale(Client *c, const Seperator *sep) } if (strcasecmp(sep->arg[3], "apply") == 0) { - c->Message(15, "%s scaling applied against (%i) NPC's", sep->arg[2], found_count); + c->Message(Chat::Yellow, "%s scaling applied against (%i) NPC's", sep->arg[2], found_count); } else { @@ -12118,7 +12230,7 @@ void command_scale(Client *c, const Seperator *sep) sep->arg[2] ); - c->Message(15, "Found (%i) NPC's that match this search...", found_count); + c->Message(Chat::Yellow, "Found (%i) NPC's that match this search...", found_count); c->Message( 15, "To apply these changes, click <%s> or type %s", EQEmu::SayLinkEngine::GenerateQuestSaylink(saylink, false, "Apply").c_str(), @@ -12155,7 +12267,7 @@ void command_who(Client *c, const Seperator *sep) return; if (results.RowCount() == 0) { - c->Message(15, "No results found"); + c->Message(Chat::Yellow, "No results found"); return; } @@ -12167,8 +12279,8 @@ void command_who(Client *c, const Seperator *sep) int found_count = 0; - c->Message(5, "Players in EverQuest"); - c->Message(5, "--------------------"); + c->Message(Chat::Magenta, "Players in EverQuest"); + c->Message(Chat::Magenta, "--------------------"); for (auto row = results.begin(); row != results.end(); ++row) { auto account_id = static_cast(atoi(row[0])); @@ -12245,7 +12357,7 @@ void command_who(Client *c, const Seperator *sep) "There are no players in EverQuest that match those who filters." ); - c->Message(5, message.c_str()); + c->Message(Chat::Magenta, message.c_str()); } void command_network(Client *c, const Seperator *sep) @@ -12255,7 +12367,7 @@ void command_network(Client *c, const Seperator *sep) auto eqsi = c->Connection(); auto manager = eqsi->GetManager(); auto opts = manager->GetOptions(); - + if (!strcasecmp(sep->arg[2], "all")) { c->Message(0, "max_packet_size: %llu", (uint64_t)opts.daybreak_options.max_packet_size); @@ -12313,19 +12425,19 @@ void command_network(Client *c, const Seperator *sep) auto eqsi = c->Connection(); auto manager = eqsi->GetManager(); auto opts = manager->GetOptions(); - + if (!strcasecmp(sep->arg[3], "")) { c->Message(0, "Missing value for set"); return; } - + std::string value = sep->arg[3]; if (!strcasecmp(sep->arg[2], "max_connection_count")) { opts.daybreak_options.max_connection_count = std::stoull(value); manager->SetOptions(opts); - } + } else if (!strcasecmp(sep->arg[2], "keepalive_delay_ms")) { opts.daybreak_options.keepalive_delay_ms = std::stoull(value); @@ -12443,12 +12555,12 @@ void command_bot(Client *c, const Seperator *sep) if (parse->PlayerHasQuestSub(EVENT_COMMAND)) { int i = parse->EventPlayer(EVENT_COMMAND, c, bot_message, 0); if (i == 0 && !RuleB(Chat, SuppressCommandErrors)) { - c->Message(13, "Bot command '%s' not recognized.", bot_message.c_str()); + c->Message(Chat::Red, "Bot command '%s' not recognized.", bot_message.c_str()); } } else { if (!RuleB(Chat, SuppressCommandErrors)) - c->Message(13, "Bot command '%s' not recognized.", bot_message.c_str()); + c->Message(Chat::Red, "Bot command '%s' not recognized.", bot_message.c_str()); } } } diff --git a/zone/command.h b/zone/command.h index e11b7bcfb..d6ce90a23 100644 --- a/zone/command.h +++ b/zone/command.h @@ -182,6 +182,7 @@ void command_netstats(Client *c, const Seperator *sep); void command_network(Client *c, const Seperator *sep); void command_npccast(Client *c, const Seperator *sep); void command_npcedit(Client *c, const Seperator *sep); +void command_npceditmass(Client *c, const Seperator *sep); void command_npcemote(Client *c, const Seperator *sep); void command_npcloot(Client *c, const Seperator *sep); void command_npcsay(Client *c, const Seperator *sep); From 665efe09f310e0c62264a4a197992d35035d6b64 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 11 Aug 2019 00:27:04 -0500 Subject: [PATCH 4/7] Fill function calls using magic numbers --- zone/aggro.cpp | 46 +- zone/bot.cpp | 8 +- zone/client.cpp | 48 +- zone/command.cpp | 2642 +++++++++++++++++----------------- zone/corpse.cpp | 16 +- zone/entity.cpp | 12 +- zone/global_loot_manager.cpp | 4 +- zone/groups.cpp | 10 +- zone/guild_mgr.cpp | 36 +- zone/hate_list.cpp | 2 +- zone/inventory.cpp | 6 +- zone/mob.cpp | 64 +- zone/mob_ai.cpp | 2 +- zone/mob_info.cpp | 2 +- zone/npc.cpp | 30 +- zone/object.cpp | 2 +- zone/pathfinder_nav_mesh.cpp | 2 +- zone/pathfinder_waypoint.cpp | 10 +- zone/questmgr.cpp | 20 +- zone/raids.cpp | 2 +- zone/special_attacks.cpp | 2 +- zone/spell_effects.cpp | 10 +- zone/spells.cpp | 4 +- zone/tasks.cpp | 26 +- zone/tune.cpp | 98 +- zone/waypoints.cpp | 6 +- zone/worldserver.cpp | 2 +- zone/zone.cpp | 22 +- zone/zonedb.cpp | 4 +- zone/zoning.cpp | 6 +- 30 files changed, 1572 insertions(+), 1572 deletions(-) diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 8a3da1092..ca565e0b9 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -52,12 +52,12 @@ void EntityList::CheckClientAggro(Client *around) void EntityList::DescribeAggro(Client *towho, NPC *from_who, float d, bool verbose) { float d2 = d*d; - towho->Message(0, "Describing aggro for %s", from_who->GetName()); + towho->Message(Chat::White, "Describing aggro for %s", from_who->GetName()); bool engaged = from_who->IsEngaged(); if(engaged) { Mob *top = from_who->GetHateTop(); - towho->Message(0, ".. I am currently fighting with %s", top == nullptr?"(nullptr)":top->GetName()); + towho->Message(Chat::White, ".. I am currently fighting with %s", top == nullptr?"(nullptr)":top->GetName()); } bool check_npcs = from_who->WillAggroNPCs(); @@ -77,7 +77,7 @@ void EntityList::DescribeAggro(Client *towho, NPC *from_who, float d, bool verbo if(!database.GetFactionName(my_primary, namebuf, sizeof(namebuf))) strcpy(namebuf, "(Unknown)"); } - towho->Message(0, ".. I am on faction %s (%d)\n", namebuf, my_primary); + towho->Message(Chat::White, ".. I am on faction %s (%d)\n", namebuf, my_primary); } for (auto it = mob_list.begin(); it != mob_list.end(); ++it) { @@ -91,11 +91,11 @@ void EntityList::DescribeAggro(Client *towho, NPC *from_who, float d, bool verbo if (engaged) { uint32 amm = from_who->GetHateAmount(mob); if (amm == 0) - towho->Message(0, "... %s is not on my hate list.", mob->GetName()); + towho->Message(Chat::White, "... %s is not on my hate list.", mob->GetName()); else - towho->Message(0, "... %s is on my hate list with value %lu", mob->GetName(), (unsigned long)amm); + towho->Message(Chat::White, "... %s is on my hate list with value %lu", mob->GetName(), (unsigned long)amm); } else if (!check_npcs && mob->IsNPC()) { - towho->Message(0, "... %s is an NPC and my npc_aggro is disabled.", mob->GetName()); + towho->Message(Chat::White, "... %s is an NPC and my npc_aggro is disabled.", mob->GetName()); } else { from_who->DescribeAggro(towho, mob, verbose); } @@ -114,13 +114,13 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) { if(( t1 > iAggroRange) || ( t2 > iAggroRange) || ( t3 > iAggroRange) ) { - towho->Message(0, "...%s is out of range (fast). distances (%.3f,%.3f,%.3f), range %.3f", mob->GetName(), + towho->Message(Chat::White, "...%s is out of range (fast). distances (%.3f,%.3f,%.3f), range %.3f", mob->GetName(), t1, t2, t3, iAggroRange); return; } if(mob->IsInvisible(this)) { - towho->Message(0, "...%s is invisible to me. ", mob->GetName()); + towho->Message(Chat::White, "...%s is invisible to me. ", mob->GetName()); return; } if((mob->IsClient() && @@ -131,13 +131,13 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) { ) )) { - towho->Message(0, "...%s is my owner. ", mob->GetName()); + towho->Message(Chat::White, "...%s is my owner. ", mob->GetName()); return; } if(mob == GetOwner()) { - towho->Message(0, "...%s a GM or is not connected. ", mob->GetName()); + towho->Message(Chat::White, "...%s a GM or is not connected. ", mob->GetName()); return; } @@ -145,7 +145,7 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) { float iAggroRange2 = iAggroRange*iAggroRange; if( dist2 > iAggroRange2 ) { - towho->Message(0, "...%s is out of range. %.3f > %.3f ", mob->GetName(), + towho->Message(Chat::White, "...%s is out of range. %.3f > %.3f ", mob->GetName(), dist2, iAggroRange2); return; } @@ -154,14 +154,14 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) { { if (GetLevel() < RuleI(Aggro, MinAggroLevel) && mob->GetLevelCon(GetLevel()) == CON_GRAY && GetBodyType() != 3) { - towho->Message(0, "...%s is red to me (basically)", mob->GetName(), dist2, iAggroRange2); + towho->Message(Chat::White, "...%s is red to me (basically)", mob->GetName(), dist2, iAggroRange2); return; } } else { if(GetINT() > RuleI(Aggro, IntAggroThreshold) && mob->GetLevelCon(GetLevel()) == CON_GRAY ) { - towho->Message(0, "...%s is red to me (basically)", mob->GetName(), + towho->Message(Chat::White, "...%s is red to me (basically)", mob->GetName(), dist2, iAggroRange2); return; } @@ -178,9 +178,9 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) { mob_primary = own->GetPrimaryFaction(); if(mob_primary == 0) { - towho->Message(0, "...%s has no primary faction", mob->GetName()); + towho->Message(Chat::White, "...%s has no primary faction", mob->GetName()); } else if(mob_primary < 0) { - towho->Message(0, "...%s is on special faction %d", mob->GetName(), mob_primary); + towho->Message(Chat::White, "...%s is on special faction %d", mob->GetName(), mob_primary); } else { char namebuf[256]; if(!database.GetFactionName(mob_primary, namebuf, sizeof(namebuf))) @@ -193,22 +193,22 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) { struct NPCFaction* fac = *cur; if ((int32)fac->factionID == mob_primary) { if (fac->npc_value > 0) { - towho->Message(0, "...%s is on ALLY faction %s (%d) with %d", mob->GetName(), namebuf, mob_primary, fac->npc_value); + towho->Message(Chat::White, "...%s is on ALLY faction %s (%d) with %d", mob->GetName(), namebuf, mob_primary, fac->npc_value); res = true; break; } else if (fac->npc_value < 0) { - towho->Message(0, "...%s is on ENEMY faction %s (%d) with %d", mob->GetName(), namebuf, mob_primary, fac->npc_value); + towho->Message(Chat::White, "...%s is on ENEMY faction %s (%d) with %d", mob->GetName(), namebuf, mob_primary, fac->npc_value); res = true; break; } else { - towho->Message(0, "...%s is on NEUTRAL faction %s (%d) with 0", mob->GetName(), namebuf, mob_primary); + towho->Message(Chat::White, "...%s is on NEUTRAL faction %s (%d) with 0", mob->GetName(), namebuf, mob_primary); res = true; break; } } } if(!res) { - towho->Message(0, "...%s is on faction %s (%d), which I have no entry for.", mob->GetName(), namebuf, mob_primary); + towho->Message(Chat::White, "...%s is on faction %s (%d), which I have no entry for.", mob->GetName(), namebuf, mob_primary); } } } @@ -222,18 +222,18 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) { || fv == FACTION_THREATENLY )) { - towho->Message(0, "...%s faction not low enough. value='%s'", mob->GetName(), FactionValueToString(fv)); + towho->Message(Chat::White, "...%s faction not low enough. value='%s'", mob->GetName(), FactionValueToString(fv)); return; } if(fv == FACTION_THREATENLY) { - towho->Message(0, "...%s threatening to me, so they only have a %d chance per check of attacking.", mob->GetName()); + towho->Message(Chat::White, "...%s threatening to me, so they only have a %d chance per check of attacking.", mob->GetName()); } if(!CheckLosFN(mob)) { - towho->Message(0, "...%s is out of sight.", mob->GetName()); + towho->Message(Chat::White, "...%s is out of sight.", mob->GetName()); } - towho->Message(0, "...%s meets all conditions, I should be attacking them.", mob->GetName()); + towho->Message(Chat::White, "...%s meets all conditions, I should be attacking them.", mob->GetName()); } /* diff --git a/zone/bot.cpp b/zone/bot.cpp index daef58a9a..4398f2fd5 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -3256,7 +3256,7 @@ bool Bot::Spawn(Client* botCharacterOwner) { this->texture = 0; //0xFF; if(this->Save()) - this->GetBotOwner()->CastToClient()->Message(0, "%s saved.", this->GetCleanName()); + this->GetBotOwner()->CastToClient()->Message(Chat::White, "%s saved.", this->GetCleanName()); else this->GetBotOwner()->CastToClient()->Message(Chat::Red, "%s save failed!", this->GetCleanName()); @@ -5987,7 +5987,7 @@ bool Bot::ProcessGuildRemoval(Client* guildOfficer, std::string botName) { GuildManageRemove_Struct* gm = (GuildManageRemove_Struct*) outapp->pBuffer; gm->guildeqid = guildOfficer->GuildID(); strcpy(gm->member, botName.c_str()); - guildOfficer->Message(0, "%s successfully removed from your guild.", botName.c_str()); + guildOfficer->Message(Chat::White, "%s successfully removed from your guild.", botName.c_str()); entity_list.QueueClientsGuild(guildOfficer, outapp, false, gm->guildeqid); safe_delete(outapp); } @@ -8180,7 +8180,7 @@ void Bot::CalcBotStats(bool showtext) { } //if(this->Save()) - // this->GetBotOwner()->CastToClient()->Message(0, "%s saved.", this->GetCleanName()); + // this->GetBotOwner()->CastToClient()->Message(Chat::White, "%s saved.", this->GetCleanName()); //else // this->GetBotOwner()->CastToClient()->Message(Chat::Red, "%s save failed!", this->GetCleanName()); @@ -8868,7 +8868,7 @@ bool Bot::UseDiscipline(uint32 spell_id, uint32 target) { SetDisciplineRecastTimer(spells[spell_id].EndurTimerIndex, spell.recast_time); } else { uint32 remain = (GetDisciplineRemainingTime(this, spells[spell_id].EndurTimerIndex) / 1000); - GetOwner()->Message(0, "%s can use this discipline in %d minutes %d seconds.", GetCleanName(), (remain / 60), (remain % 60)); + GetOwner()->Message(Chat::White, "%s can use this discipline in %d minutes %d seconds.", GetCleanName(), (remain / 60), (remain % 60)); return false; } } diff --git a/zone/client.cpp b/zone/client.cpp index dfee9a340..bf2fb3a0d 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -3845,7 +3845,7 @@ void Client::SendRules(Client* client) auto lines = SplitString(rules, '\n'); for (auto&& e : lines) - client->Message(0, "%s", e.c_str()); + client->Message(Chat::White, "%s", e.c_str()); } void Client::SetEndurance(int32 newEnd) @@ -5748,7 +5748,7 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) { strcpy(insr->text, requestee->GetInspectMessage().text); // There could be an OP for this..or not... (Ti clients are not processed here..this message is generated client-side) - if(requestee->IsClient() && (requestee != requester)) { requestee->Message(0, "%s is looking at your equipment...", requester->GetName()); } + if(requestee->IsClient() && (requestee != requester)) { requestee->Message(Chat::White, "%s is looking at your equipment...", requester->GetName()); } requester->QueuePacket(outapp); // Send answer to requester safe_delete(outapp); @@ -6855,30 +6855,30 @@ void Client::SendStatsWindow(Client* client, bool use_window) } client->Message(Chat::Yellow, "~~~~~ %s %s ~~~~~", GetCleanName(), GetLastName()); - client->Message(0, " Level: %i Class: %i Race: %i DS: %i/%i Size: %1.1f Weight: %.1f/%d ", GetLevel(), GetClass(), GetRace(), GetDS(), RuleI(Character, ItemDamageShieldCap), GetSize(), (float)CalcCurrentWeight() / 10.0f, GetSTR()); - client->Message(0, " HP: %i/%i HP Regen: %i/%i",GetHP(), GetMaxHP(), CalcHPRegen(), CalcHPRegenCap()); - client->Message(0, " compute_tohit: %i TotalToHit: %i", compute_tohit(skill), GetTotalToHit(skill, 0)); - client->Message(0, " compute_defense: %i TotalDefense: %i", compute_defense(), GetTotalDefense()); - client->Message(0, " offense: %i mitigation ac: %i", offense(skill), GetMitigationAC()); + client->Message(Chat::White, " Level: %i Class: %i Race: %i DS: %i/%i Size: %1.1f Weight: %.1f/%d ", GetLevel(), GetClass(), GetRace(), GetDS(), RuleI(Character, ItemDamageShieldCap), GetSize(), (float)CalcCurrentWeight() / 10.0f, GetSTR()); + client->Message(Chat::White, " HP: %i/%i HP Regen: %i/%i",GetHP(), GetMaxHP(), CalcHPRegen(), CalcHPRegenCap()); + client->Message(Chat::White, " compute_tohit: %i TotalToHit: %i", compute_tohit(skill), GetTotalToHit(skill, 0)); + client->Message(Chat::White, " compute_defense: %i TotalDefense: %i", compute_defense(), GetTotalDefense()); + client->Message(Chat::White, " offense: %i mitigation ac: %i", offense(skill), GetMitigationAC()); if(CalcMaxMana() > 0) - client->Message(0, " Mana: %i/%i Mana Regen: %i/%i", GetMana(), GetMaxMana(), CalcManaRegen(), CalcManaRegenCap()); - client->Message(0, " End.: %i/%i End. Regen: %i/%i",GetEndurance(), GetMaxEndurance(), CalcEnduranceRegen(), CalcEnduranceRegenCap()); - client->Message(0, " ATK: %i Worn/Spell ATK %i/%i Server Side ATK: %i", GetTotalATK(), RuleI(Character, ItemATKCap), GetATKBonus(), GetATK()); - client->Message(0, " Haste: %i / %i (Item: %i + Spell: %i + Over: %i)", GetHaste(), RuleI(Character, HasteCap), itembonuses.haste, spellbonuses.haste + spellbonuses.hastetype2, spellbonuses.hastetype3 + ExtraHaste); - client->Message(0, " STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetSTR(), GetSTA(), GetDEX(), GetAGI(), GetINT(), GetWIS(), GetCHA()); - client->Message(0, " hSTR: %i hSTA: %i hDEX: %i hAGI: %i hINT: %i hWIS: %i hCHA: %i", GetHeroicSTR(), GetHeroicSTA(), GetHeroicDEX(), GetHeroicAGI(), GetHeroicINT(), GetHeroicWIS(), GetHeroicCHA()); - client->Message(0, " MR: %i PR: %i FR: %i CR: %i DR: %i Corruption: %i PhR: %i", GetMR(), GetPR(), GetFR(), GetCR(), GetDR(), GetCorrup(), GetPhR()); - client->Message(0, " hMR: %i hPR: %i hFR: %i hCR: %i hDR: %i hCorruption: %i", GetHeroicMR(), GetHeroicPR(), GetHeroicFR(), GetHeroicCR(), GetHeroicDR(), GetHeroicCorrup()); - client->Message(0, " Shielding: %i Spell Shield: %i DoT Shielding: %i Stun Resist: %i Strikethrough: %i Avoidance: %i Accuracy: %i Combat Effects: %i", GetShielding(), GetSpellShield(), GetDoTShield(), GetStunResist(), GetStrikeThrough(), GetAvoidance(), GetAccuracy(), GetCombatEffects()); - client->Message(0, " Heal Amt.: %i Spell Dmg.: %i Clairvoyance: %i DS Mitigation: %i", GetHealAmt(), GetSpellDmg(), GetClair(), GetDSMit()); + client->Message(Chat::White, " Mana: %i/%i Mana Regen: %i/%i", GetMana(), GetMaxMana(), CalcManaRegen(), CalcManaRegenCap()); + client->Message(Chat::White, " End.: %i/%i End. Regen: %i/%i",GetEndurance(), GetMaxEndurance(), CalcEnduranceRegen(), CalcEnduranceRegenCap()); + client->Message(Chat::White, " ATK: %i Worn/Spell ATK %i/%i Server Side ATK: %i", GetTotalATK(), RuleI(Character, ItemATKCap), GetATKBonus(), GetATK()); + client->Message(Chat::White, " Haste: %i / %i (Item: %i + Spell: %i + Over: %i)", GetHaste(), RuleI(Character, HasteCap), itembonuses.haste, spellbonuses.haste + spellbonuses.hastetype2, spellbonuses.hastetype3 + ExtraHaste); + client->Message(Chat::White, " STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetSTR(), GetSTA(), GetDEX(), GetAGI(), GetINT(), GetWIS(), GetCHA()); + client->Message(Chat::White, " hSTR: %i hSTA: %i hDEX: %i hAGI: %i hINT: %i hWIS: %i hCHA: %i", GetHeroicSTR(), GetHeroicSTA(), GetHeroicDEX(), GetHeroicAGI(), GetHeroicINT(), GetHeroicWIS(), GetHeroicCHA()); + client->Message(Chat::White, " MR: %i PR: %i FR: %i CR: %i DR: %i Corruption: %i PhR: %i", GetMR(), GetPR(), GetFR(), GetCR(), GetDR(), GetCorrup(), GetPhR()); + client->Message(Chat::White, " hMR: %i hPR: %i hFR: %i hCR: %i hDR: %i hCorruption: %i", GetHeroicMR(), GetHeroicPR(), GetHeroicFR(), GetHeroicCR(), GetHeroicDR(), GetHeroicCorrup()); + client->Message(Chat::White, " Shielding: %i Spell Shield: %i DoT Shielding: %i Stun Resist: %i Strikethrough: %i Avoidance: %i Accuracy: %i Combat Effects: %i", GetShielding(), GetSpellShield(), GetDoTShield(), GetStunResist(), GetStrikeThrough(), GetAvoidance(), GetAccuracy(), GetCombatEffects()); + client->Message(Chat::White, " Heal Amt.: %i Spell Dmg.: %i Clairvoyance: %i DS Mitigation: %i", GetHealAmt(), GetSpellDmg(), GetClair(), GetDSMit()); if(GetClass() == BARD) - client->Message(0, " Singing: %i Brass: %i String: %i Percussion: %i Wind: %i", GetSingMod(), GetBrassMod(), GetStringMod(), GetPercMod(), GetWindMod()); + client->Message(Chat::White, " Singing: %i Brass: %i String: %i Percussion: %i Wind: %i", GetSingMod(), GetBrassMod(), GetStringMod(), GetPercMod(), GetWindMod()); Extra_Info: - client->Message(0, " BaseRace: %i Gender: %i BaseGender: %i Texture: %i HelmTexture: %i", GetBaseRace(), GetGender(), GetBaseGender(), GetTexture(), GetHelmTexture()); + client->Message(Chat::White, " BaseRace: %i Gender: %i BaseGender: %i Texture: %i HelmTexture: %i", GetBaseRace(), GetGender(), GetBaseGender(), GetTexture(), GetHelmTexture()); if (client->Admin() >= 100) { - client->Message(0, " CharID: %i EntityID: %i PetID: %i OwnerID: %i AIControlled: %i Targetted: %i", CharacterID(), GetID(), GetPetID(), GetOwnerID(), IsAIControlled(), targeted); + client->Message(Chat::White, " CharID: %i EntityID: %i PetID: %i OwnerID: %i AIControlled: %i Targetted: %i", CharacterID(), GetID(), GetPetID(), GetOwnerID(), IsAIControlled(), targeted); } } @@ -7248,17 +7248,17 @@ void Client::ShowXTargets(Client *c) return; for(int i = 0; i < GetMaxXTargets(); ++i) - c->Message(0, "Xtarget Slot: %i, Type: %2i, ID: %4i, Name: %s", i, XTargets[i].Type, XTargets[i].ID, XTargets[i].Name); + c->Message(Chat::White, "Xtarget Slot: %i, Type: %2i, ID: %4i, Name: %s", i, XTargets[i].Type, XTargets[i].ID, XTargets[i].Name); auto &list = GetXTargetAutoMgr()->get_list(); // yeah, I kept having to do something for debugging to tell if managers were the same object or not :P // so lets use the address as an "ID" - c->Message(0, "XTargetAutoMgr ID %p size %d", GetXTargetAutoMgr(), list.size()); + c->Message(Chat::White, "XTargetAutoMgr ID %p size %d", GetXTargetAutoMgr(), list.size()); int count = 0; for (auto &e : list) { - c->Message(0, "spawn id %d count %d", e.spawn_id, e.count); + c->Message(Chat::White, "spawn id %d count %d", e.spawn_id, e.count); count++; if (count == 20) { // lets not spam too many ... - c->Message(0, " ... "); + c->Message(Chat::White, " ... "); break; } } diff --git a/zone/command.cpp b/zone/command.cpp index cf6cc6d6b..5ee0f1b1c 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -672,9 +672,9 @@ void command_setstat(Client* c, const Seperator* sep){ c->GetTarget()->CastToClient()->SetStats(atoi(sep->arg[1]),atoi(sep->arg[2])); } else{ - c->Message(0,"This command is used to permanently increase or decrease a players stats."); - c->Message(0,"Usage: #setstat {type} {value the stat should be}"); - c->Message(0,"Types: Str: 0, Sta: 1, Agi: 2, Dex: 3, Int: 4, Wis: 5, Cha: 6"); + c->Message(Chat::White,"This command is used to permanently increase or decrease a players stats."); + c->Message(Chat::White,"Usage: #setstat {type} {value the stat should be}"); + c->Message(Chat::White,"Types: Str: 0, Sta: 1, Agi: 2, Dex: 3, Int: 4, Wis: 5, Cha: 6"); } } @@ -683,10 +683,10 @@ void command_incstat(Client* c, const Seperator* sep){ c->GetTarget()->CastToClient()->IncStats(atoi(sep->arg[1]),atoi(sep->arg[2])); } else{ - c->Message(0,"This command is used to permanently increase or decrease a players stats."); - c->Message(0,"Usage: #setstat {type} {value by which to increase or decrease}"); - c->Message(0,"Note: The value is in increments of 2, so a value of 3 will actually increase the stat by 6"); - c->Message(0,"Types: Str: 0, Sta: 1, Agi: 2, Dex: 3, Int: 4, Wis: 5, Cha: 6"); + c->Message(Chat::White,"This command is used to permanently increase or decrease a players stats."); + c->Message(Chat::White,"Usage: #setstat {type} {value by which to increase or decrease}"); + c->Message(Chat::White,"Note: The value is in increments of 2, so a value of 3 will actually increase the stat by 6"); + c->Message(Chat::White,"Types: Str: 0, Sta: 1, Agi: 2, Dex: 3, Int: 4, Wis: 5, Cha: 6"); } } @@ -696,14 +696,14 @@ void command_resetaa(Client* c,const Seperator *sep) { c->Message(Chat::Red,"Successfully reset %s's AAs", c->GetTarget()->GetName()); } else - c->Message(0,"Usage: Target a client and use #resetaa to reset the AA data in their Profile."); + c->Message(Chat::White,"Usage: Target a client and use #resetaa to reset the AA data in their Profile."); } void command_help(Client *c, const Seperator *sep) { int commands_shown=0; - c->Message(0, "Available EQEMu commands:"); + c->Message(Chat::White, "Available EQEMu commands:"); std::map::iterator cur,end; cur = commandlist.begin(); @@ -719,24 +719,24 @@ void command_help(Client *c, const Seperator *sep) if(c->Admin() < cur->second->access) continue; commands_shown++; - c->Message(0, " %c%s %s", COMMAND_CHAR, cur->first.c_str(), cur->second->desc == nullptr?"":cur->second->desc); + c->Message(Chat::White, " %c%s %s", COMMAND_CHAR, cur->first.c_str(), cur->second->desc == nullptr?"":cur->second->desc); } - c->Message(0, "%d command%s listed.", commands_shown, commands_shown!=1?"s":""); + c->Message(Chat::White, "%d command%s listed.", commands_shown, commands_shown!=1?"s":""); } void command_version(Client *c, const Seperator *sep) { - c->Message(0, "Current version information."); - c->Message(0, " %s", CURRENT_VERSION); - c->Message(0, " Compiled on: %s at %s", COMPILE_DATE, COMPILE_TIME); - c->Message(0, " Last modified on: %s", LAST_MODIFIED); + c->Message(Chat::White, "Current version information."); + c->Message(Chat::White, " %s", CURRENT_VERSION); + c->Message(Chat::White, " Compiled on: %s at %s", COMPILE_DATE, COMPILE_TIME); + c->Message(Chat::White, " Last modified on: %s", LAST_MODIFIED); } void command_setfaction(Client *c, const Seperator *sep) { if((sep->arg[1][0] == 0 || strcasecmp(sep->arg[1],"*")==0) || ((c->GetTarget()==0) || (c->GetTarget()->IsClient()))) { - c->Message(0, "Usage: #setfaction [faction number]"); + c->Message(Chat::White, "Usage: #setfaction [faction number]"); return; } @@ -751,9 +751,9 @@ void command_setfaction(Client *c, const Seperator *sep) void command_serversidename(Client *c, const Seperator *sep) { if(c->GetTarget()) - c->Message(0, c->GetTarget()->GetName()); + c->Message(Chat::White, c->GetTarget()->GetName()); else - c->Message(0, "Error: no target"); + c->Message(Chat::White, "Error: no target"); } void command_wc(Client *c, const Seperator *sep) @@ -801,7 +801,7 @@ void command_wc(Client *c, const Seperator *sep) void command_heromodel(Client *c, const Seperator *sep) { if (sep->argnum < 1) { - c->Message(0, "Usage: #heromodel [hero forge model] [ [slot] ] (example: #heromodel 63)"); + c->Message(Chat::White, "Usage: #heromodel [hero forge model] [ [slot] ] (example: #heromodel 63)"); } else if (c->GetTarget() == nullptr) { c->Message(Chat::Red, "You must have a target to do a wear change for Hero's Forge Models."); @@ -836,12 +836,12 @@ void command_setanim(Client *c, const Seperator *sep) if (c->GetTarget() && sep->IsNumber(1)) { int num = atoi(sep->arg[1]); if (num < 0 || num >= _eaMaxAppearance) { - c->Message(0, "Invalid animation number, between 0 and %d", _eaMaxAppearance - 1); + c->Message(Chat::White, "Invalid animation number, between 0 and %d", _eaMaxAppearance - 1); } c->GetTarget()->SetAppearance(EmuAppearance(num)); } else { - c->Message(0, "Usage: #setanim [animnum]"); + c->Message(Chat::White, "Usage: #setanim [animnum]"); } } @@ -853,50 +853,50 @@ void command_serverinfo(Client *c, const Seperator *sep) auto rss = EQ::GetRSS(); auto uptime = EQ::GetUptime(); - c->Message(0, "Operating System Information"); - c->Message(0, "=================================================="); - c->Message(0, "System: %s", os.sysname.c_str()); - c->Message(0, "Release: %s", os.release.c_str()); - c->Message(0, "Version: %s", os.version.c_str()); - c->Message(0, "Machine: %s", os.machine.c_str()); - c->Message(0, "Uptime: %.2f seconds", uptime); - c->Message(0, "=================================================="); - c->Message(0, "CPU Information"); - c->Message(0, "=================================================="); + c->Message(Chat::White, "Operating System Information"); + c->Message(Chat::White, "=================================================="); + c->Message(Chat::White, "System: %s", os.sysname.c_str()); + c->Message(Chat::White, "Release: %s", os.release.c_str()); + c->Message(Chat::White, "Version: %s", os.version.c_str()); + c->Message(Chat::White, "Machine: %s", os.machine.c_str()); + c->Message(Chat::White, "Uptime: %.2f seconds", uptime); + c->Message(Chat::White, "=================================================="); + c->Message(Chat::White, "CPU Information"); + c->Message(Chat::White, "=================================================="); for (size_t i = 0; i < cpus.size(); ++i) { auto &cp = cpus[i]; - c->Message(0, "CPU #%i: %s, Speed: %.2fGhz", i, cp.model.c_str(), cp.speed); + c->Message(Chat::White, "CPU #%i: %s, Speed: %.2fGhz", i, cp.model.c_str(), cp.speed); } - c->Message(0, "=================================================="); - c->Message(0, "Process Information"); - c->Message(0, "=================================================="); - c->Message(0, "PID: %u", pid); - c->Message(0, "RSS: %.2f MB", rss / 1048576.0); - c->Message(0, "=================================================="); + c->Message(Chat::White, "=================================================="); + c->Message(Chat::White, "Process Information"); + c->Message(Chat::White, "=================================================="); + c->Message(Chat::White, "PID: %u", pid); + c->Message(Chat::White, "RSS: %.2f MB", rss / 1048576.0); + c->Message(Chat::White, "=================================================="); } void command_getvariable(Client *c, const Seperator *sep) { std::string tmp; if (database.GetVariable(sep->argplus[1], tmp)) - c->Message(0, "%s = %s", sep->argplus[1], tmp.c_str()); + c->Message(Chat::White, "%s = %s", sep->argplus[1], tmp.c_str()); else - c->Message(0, "GetVariable(%s) returned false", sep->argplus[1]); + c->Message(Chat::White, "GetVariable(%s) returned false", sep->argplus[1]); } void command_chat(Client *c, const Seperator *sep) { if (sep->arg[2][0] == 0) - c->Message(0, "Usage: #chat [channum] [message]"); + c->Message(Chat::White, "Usage: #chat [channum] [message]"); else if (!worldserver.SendChannelMessage(0, 0, (uint8) atoi(sep->arg[1]), 0, 0, 100, sep->argplus[2])) - c->Message(0, "Error: World server disconnected"); + c->Message(Chat::White, "Error: World server disconnected"); } void command_npcloot(Client *c, const Seperator *sep) { if (c->GetTarget() == 0) - c->Message(0, "Error: No target"); + c->Message(Chat::White, "Error: No target"); // #npcloot show else if (strcasecmp(sep->arg[1], "show") == 0) { @@ -905,11 +905,11 @@ void command_npcloot(Client *c, const Seperator *sep) else if (c->GetTarget()->IsCorpse()) c->GetTarget()->CastToCorpse()->QueryLoot(c); else - c->Message(0, "Error: Target's type doesnt have loot"); + c->Message(Chat::White, "Error: Target's type doesnt have loot"); } // These 2 types are *BAD* for the next few commands else if (c->GetTarget()->IsClient() || c->GetTarget()->IsCorpse()) - c->Message(0, "Error: Invalid target type, try a NPC =)."); + c->Message(Chat::White, "Error: Invalid target type, try a NPC =)."); // #npcloot add else if (strcasecmp(sep->arg[1], "add") == 0) { @@ -923,22 +923,22 @@ void command_npcloot(Client *c, const Seperator *sep) c->GetTarget()->CastToNPC()->AddItem(item, atoi(sep->arg[3]), 0); else c->GetTarget()->CastToNPC()->AddItem(item, 1, 0); - c->Message(0, "Added item(%i) to the %s's loot.", item, c->GetTarget()->GetName()); + c->Message(Chat::White, "Added item(%i) to the %s's loot.", item, c->GetTarget()->GetName()); } else - c->Message(0, "Error: #npcloot add: Item(%i) does not exist!", item); + c->Message(Chat::White, "Error: #npcloot add: Item(%i) does not exist!", item); } else if (!sep->IsNumber(2)) - c->Message(0, "Error: #npcloot add: Itemid must be a number."); + c->Message(Chat::White, "Error: #npcloot add: Itemid must be a number."); else - c->Message(0, "Error: #npcloot add: This is not a valid target."); + c->Message(Chat::White, "Error: #npcloot add: This is not a valid target."); } // #npcloot remove else if (strcasecmp(sep->arg[1], "remove") == 0) { //#npcloot remove all if (strcasecmp(sep->arg[2], "all") == 0) - c->Message(0, "Error: #npcloot remove all: Not yet implemented."); + c->Message(Chat::White, "Error: #npcloot remove all: Not yet implemented."); //#npcloot remove itemid else { @@ -946,12 +946,12 @@ void command_npcloot(Client *c, const Seperator *sep) { uint32 item = atoi(sep->arg[2]); c->GetTarget()->CastToNPC()->RemoveItem(item); - c->Message(0, "Removed item(%i) from the %s's loot.", item, c->GetTarget()->GetName()); + c->Message(Chat::White, "Removed item(%i) from the %s's loot.", item, c->GetTarget()->GetName()); } else if (!sep->IsNumber(2)) - c->Message(0, "Error: #npcloot remove: Item must be a number."); + c->Message(Chat::White, "Error: #npcloot remove: Item must be a number."); else - c->Message(0, "Error: #npcloot remove: This is not a valid target."); + c->Message(Chat::White, "Error: #npcloot remove: This is not a valid target."); } } // #npcloot money @@ -962,16 +962,16 @@ void command_npcloot(Client *c, const Seperator *sep) if ((atoi(sep->arg[2]) < 34465 && atoi(sep->arg[2]) >= 0) && (atoi(sep->arg[3]) < 34465 && atoi(sep->arg[3]) >= 0) && (atoi(sep->arg[4]) < 34465 && atoi(sep->arg[4]) >= 0) && (atoi(sep->arg[5]) < 34465 && atoi(sep->arg[5]) >= 0)) { c->GetTarget()->CastToNPC()->AddCash(atoi(sep->arg[5]), atoi(sep->arg[4]), atoi(sep->arg[3]), atoi(sep->arg[2])); - c->Message(0, "Set %i Platinum, %i Gold, %i Silver, and %i Copper as %s's money.", atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), c->GetTarget()->GetName()); + c->Message(Chat::White, "Set %i Platinum, %i Gold, %i Silver, and %i Copper as %s's money.", atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), c->GetTarget()->GetName()); } else - c->Message(0, "Error: #npcloot money: Values must be between 0-34465."); + c->Message(Chat::White, "Error: #npcloot money: Values must be between 0-34465."); } else - c->Message(0, "Usage: #npcloot money platinum gold silver copper"); + c->Message(Chat::White, "Usage: #npcloot money platinum gold silver copper"); } else - c->Message(0, "Usage: #npcloot [show/money/add/remove] [itemid/all/money: pp gp sp cp]"); + c->Message(Chat::White, "Usage: #npcloot [show/money/add/remove] [itemid/all/money: pp gp sp cp]"); } void command_gm(Client *c, const Seperator *sep) @@ -984,10 +984,10 @@ void command_gm(Client *c, const Seperator *sep) if(sep->arg[1][0] != 0) { t->SetGM(state); - c->Message(0, "%s is %s a GM.", t->GetName(), state?"now":"no longer"); + c->Message(Chat::White, "%s is %s a GM.", t->GetName(), state?"now":"no longer"); } else - c->Message(0, "Usage: #gm [on/off]"); + c->Message(Chat::White, "Usage: #gm [on/off]"); } // there's no need for this, as /summon already takes care of it @@ -1009,11 +1009,11 @@ void command_summon(Client *c, const Seperator *sep) else { if (!worldserver.Connected()) - c->Message(0, "Error: World server disconnected."); + c->Message(Chat::White, "Error: World server disconnected."); else { // player is in another zone //Taking this command out until we test the factor of 8 in ServerOP_ZonePlayer - //c->Message(0, "Summoning player from another zone not yet implemented."); + //c->Message(Chat::White, "Summoning player from another zone not yet implemented."); //return; auto pack = new ServerPacket(ServerOP_ZonePlayer, sizeof(ServerZonePlayer_Struct)); @@ -1038,9 +1038,9 @@ void command_summon(Client *c, const Seperator *sep) else { /*if(c->Admin() < 150) - c->Message(0, "You need a NPC/corpse target for this command"); + c->Message(Chat::White, "You need a NPC/corpse target for this command"); else*/ - c->Message(0, "Usage: #summon [charname] Either target or charname is required"); + c->Message(Chat::White, "Usage: #summon [charname] Either target or charname is required"); return; } @@ -1049,23 +1049,23 @@ void command_summon(Client *c, const Seperator *sep) if (t->IsNPC()) { // npc target - c->Message(0, "Summoning NPC %s to %1.1f, %1.1f, %1.1f", t->GetName(), c->GetX(), c->GetY(), c->GetZ()); + c->Message(Chat::White, "Summoning NPC %s to %1.1f, %1.1f, %1.1f", t->GetName(), c->GetX(), c->GetY(), c->GetZ()); t->CastToNPC()->GMMove(c->GetX(), c->GetY(), c->GetZ(), c->GetHeading()); t->CastToNPC()->SaveGuardSpot(glm::vec4(0.0f)); } else if (t->IsCorpse()) { // corpse target - c->Message(0, "Summoning corpse %s to %1.1f, %1.1f, %1.1f", t->GetName(), c->GetX(), c->GetY(), c->GetZ()); + c->Message(Chat::White, "Summoning corpse %s to %1.1f, %1.1f, %1.1f", t->GetName(), c->GetX(), c->GetY(), c->GetZ()); t->CastToCorpse()->GMMove(c->GetX(), c->GetY(), c->GetZ(), c->GetHeading()); } else if (t->IsClient()) { /*if(c->Admin() < 150) { - c->Message(0, "You may not summon a player."); + c->Message(Chat::White, "You may not summon a player."); return; }*/ - c->Message(0, "Summoning player %s to %1.1f, %1.1f, %1.1f", t->GetName(), c->GetX(), c->GetY(), c->GetZ()); + c->Message(Chat::White, "Summoning player %s to %1.1f, %1.1f, %1.1f", t->GetName(), c->GetX(), c->GetY(), c->GetZ()); t->CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), c->GetX(), c->GetY(), c->GetZ(), c->GetHeading(), 2, GMSummon); } } @@ -1074,7 +1074,7 @@ void command_zone(Client *c, const Seperator *sep) { if(c->Admin() < commandZoneToCoords && (sep->IsNumber(2) || sep->IsNumber(3) || sep->IsNumber(4))) { - c->Message(0, "Your status is not high enough to zone to specific coordinates."); + c->Message(Chat::White, "Your status is not high enough to zone to specific coordinates."); return; } @@ -1083,29 +1083,29 @@ void command_zone(Client *c, const Seperator *sep) if (sep->IsNumber(1)) { if(atoi(sep->arg[1])==26 && (c->Admin() < commandZoneToSpecials)){ //cshome - c->Message(0, "Only Guides and above can goto that zone."); + c->Message(Chat::White, "Only Guides and above can goto that zone."); return; } zoneid = atoi(sep->arg[1]); } else if (sep->arg[1][0] == 0) { - c->Message(0, "Usage: #zone [zonename]"); - c->Message(0, "Optional Usage: #zone [zonename] y x z"); + c->Message(Chat::White, "Usage: #zone [zonename]"); + c->Message(Chat::White, "Optional Usage: #zone [zonename] y x z"); return; } else if (zone->GetZoneID() == 184 && c->Admin() < commandZoneToSpecials) { // Zone: 'Load' - c->Message(0, "The Gods brought you here, only they can send you away."); + c->Message(Chat::White, "The Gods brought you here, only they can send you away."); return; } else { if((strcasecmp(sep->arg[1], "cshome")==0) && (c->Admin() < commandZoneToSpecials)){ - c->Message(0, "Only Guides and above can goto that zone."); + c->Message(Chat::White, "Only Guides and above can goto that zone."); return; } zoneid = database.GetZoneID(sep->arg[1]); if(zoneid == 0) { - c->Message(0, "Unable to locate zone '%s'", sep->arg[1]); + c->Message(Chat::White, "Unable to locate zone '%s'", sep->arg[1]); return; } } @@ -1130,14 +1130,14 @@ void command_zone_instance(Client *c, const Seperator *sep) { if(c->Admin() < commandZoneToCoords && (sep->IsNumber(2) || sep->IsNumber(3) || sep->IsNumber(4))) { - c->Message(0, "Your status is not high enough to zone to specific coordinates."); + c->Message(Chat::White, "Your status is not high enough to zone to specific coordinates."); return; } if (sep->arg[1][0] == 0) { - c->Message(0, "Usage: #zoneinstance [instance id]"); - c->Message(0, "Optional Usage: #zoneinstance [instance id] y x z"); + c->Message(Chat::White, "Usage: #zoneinstance [instance id]"); + c->Message(Chat::White, "Optional Usage: #zoneinstance [instance id] y x z"); return; } @@ -1149,26 +1149,26 @@ void command_zone_instance(Client *c, const Seperator *sep) instanceid = atoi(sep->arg[1]); if(!instanceid) { - c->Message(0, "Must enter a valid instance id."); + c->Message(Chat::White, "Must enter a valid instance id."); return; } zoneid = database.ZoneIDFromInstanceID(instanceid); if(!zoneid) { - c->Message(0, "Instance not found or zone is set to null."); + c->Message(Chat::White, "Instance not found or zone is set to null."); return; } } else { - c->Message(0, "Must enter a valid instance id."); + c->Message(Chat::White, "Must enter a valid instance id."); return; } if(!database.VerifyInstanceAlive(instanceid, c->CharacterID())) { - c->Message(0, "Instance ID expiried or you are not apart of this instance."); + c->Message(Chat::White, "Instance ID expiried or you are not apart of this instance."); return; } @@ -1199,7 +1199,7 @@ void command_peqzone(Client *c, const Seperator *sep) } if(c->GetHPRatio() < 75) { - c->Message(0, "You cannot use this command with less than 75 percent health."); + c->Message(Chat::White, "You cannot use this command with less than 75 percent health."); return; } @@ -1212,7 +1212,7 @@ void command_peqzone(Client *c, const Seperator *sep) || c->AutoAttackEnabled() || c->GetInvul() ) { - c->Message(0, "You cannot use this command in your current state. Settle down and wait."); + c->Message(Chat::White, "You cannot use this command in your current state. Settle down and wait."); return; } @@ -1233,15 +1233,15 @@ void command_peqzone(Client *c, const Seperator *sep) } else if (sep->arg[1][0] == 0 || sep->IsNumber(2) || sep->IsNumber(3) || sep->IsNumber(4) || sep->IsNumber(5)) { - c->Message(0, "Usage: #peqzone [zonename]"); - c->Message(0, "Optional Usage: #peqzone [zoneid]"); + c->Message(Chat::White, "Usage: #peqzone [zonename]"); + c->Message(Chat::White, "Optional Usage: #peqzone [zoneid]"); return; } else { zoneid = database.GetZoneID(sep->arg[1]); destzone = database.GetPEQZone(zoneid, 0); if(zoneid == 0) { - c->Message(0, "Unable to locate zone '%s'", sep->arg[1]); + c->Message(Chat::White, "Unable to locate zone '%s'", sep->arg[1]); return; } if(destzone == 0){ @@ -1267,9 +1267,9 @@ void command_peqzone(Client *c, const Seperator *sep) void command_movechar(Client *c, const Seperator *sep) { if(sep->arg[1][0]==0 || sep->arg[2][0] == 0) - c->Message(0, "Usage: #movechar [charactername] [zonename]"); + c->Message(Chat::White, "Usage: #movechar [charactername] [zonename]"); else if (c->Admin() < commandMovecharToSpecials && strcasecmp(sep->arg[2], "cshome") == 0 || strcasecmp(sep->arg[2], "load") == 0 || strcasecmp(sep->arg[2], "load2") == 0) - c->Message(0, "Invalid zone name"); + c->Message(Chat::White, "Invalid zone name"); else { uint32 tmp = database.GetAccountIDByChar(sep->arg[1]); @@ -1277,14 +1277,14 @@ void command_movechar(Client *c, const Seperator *sep) { if (c->Admin() >= commandMovecharSelfOnly || tmp == c->AccountID()) if (!database.MoveCharacterToZone((char*) sep->arg[1], (char*) sep->arg[2])) - c->Message(0, "Character Move Failed!"); + c->Message(Chat::White, "Character Move Failed!"); else - c->Message(0, "Character has been moved."); + c->Message(Chat::White, "Character has been moved."); else c->Message(Chat::Red,"You cannot move characters that are not on your account."); } else - c->Message(0, "Character Does Not Exist"); + c->Message(Chat::White, "Character Does Not Exist"); } } @@ -1293,7 +1293,7 @@ void command_movement(Client *c, const Seperator *sep) auto &mgr = MobMovementManager::Get(); if (sep->arg[1][0] == 0) { - c->Message(0, "Usage: #movement stats/clearstats/walkto/runto/rotateto/stop/packet"); + c->Message(Chat::White, "Usage: #movement stats/clearstats/walkto/runto/rotateto/stop/packet"); return; } @@ -1309,7 +1309,7 @@ void command_movement(Client *c, const Seperator *sep) { auto target = c->GetTarget(); if (target == nullptr) { - c->Message(0, "No target found."); + c->Message(Chat::White, "No target found."); return; } @@ -1319,7 +1319,7 @@ void command_movement(Client *c, const Seperator *sep) { auto target = c->GetTarget(); if (target == nullptr) { - c->Message(0, "No target found."); + c->Message(Chat::White, "No target found."); return; } @@ -1329,7 +1329,7 @@ void command_movement(Client *c, const Seperator *sep) { auto target = c->GetTarget(); if (target == nullptr) { - c->Message(0, "No target found."); + c->Message(Chat::White, "No target found."); return; } @@ -1339,7 +1339,7 @@ void command_movement(Client *c, const Seperator *sep) { auto target = c->GetTarget(); if (target == nullptr) { - c->Message(0, "No target found."); + c->Message(Chat::White, "No target found."); return; } @@ -1349,21 +1349,21 @@ void command_movement(Client *c, const Seperator *sep) { auto target = c->GetTarget(); if (target == nullptr) { - c->Message(0, "No target found."); + c->Message(Chat::White, "No target found."); return; } mgr.SendCommandToClients(target, atof(sep->arg[2]), atof(sep->arg[3]), atof(sep->arg[4]), atof(sep->arg[5]), atoi(sep->arg[6]), ClientRangeAny); } else { - c->Message(0, "Usage: #movement stats/clearstats/walkto/runto/rotateto/stop/packet"); + c->Message(Chat::White, "Usage: #movement stats/clearstats/walkto/runto/rotateto/stop/packet"); } } void command_viewpetition(Client *c, const Seperator *sep) { if (sep->arg[1][0] == 0) { - c->Message(0, "Usage: #viewpetition (petition number) Type #listpetition for a list"); + c->Message(Chat::White, "Usage: #viewpetition (petition number) Type #listpetition for a list"); return; } @@ -1390,7 +1390,7 @@ void command_viewpetition(Client *c, const Seperator *sep) void command_petitioninfo(Client *c, const Seperator *sep) { if (sep->arg[1][0] == 0) { - c->Message(0, "Usage: #petitioninfo (petition number) Type #listpetition for a list"); + c->Message(Chat::White, "Usage: #petitioninfo (petition number) Type #listpetition for a list"); return; } @@ -1415,7 +1415,7 @@ void command_petitioninfo(Client *c, const Seperator *sep) void command_delpetition(Client *c, const Seperator *sep) { if (sep->arg[1][0] == 0 || strcasecmp(sep->arg[1],"*") == 0) { - c->Message(0, "Usage: #delpetition (petition number) Type #listpetition for a list"); + c->Message(Chat::White, "Usage: #delpetition (petition number) Type #listpetition for a list"); return; } @@ -1431,7 +1431,7 @@ void command_delpetition(Client *c, const Seperator *sep) void command_listnpcs(Client *c, const Seperator *sep) { - c->Message(0, "Deprecated, use the #list command (#list npcs )"); + c->Message(Chat::White, "Deprecated, use the #list command (#list npcs )"); } void command_list(Client *c, const Seperator *sep) @@ -1688,9 +1688,9 @@ void command_list(Client *c, const Seperator *sep) } } else { - c->Message(0, "Usage of #list"); - c->Message(0, "- #list [npcs|players|corpses|doors|objects] [search]"); - c->Message(0, "- Example: #list npc (Blank for all)"); + c->Message(Chat::White, "Usage of #list"); + c->Message(Chat::White, "- #list [npcs|players|corpses|doors|objects] [search]"); + c->Message(Chat::White, "- Example: #list npc (Blank for all)"); } } @@ -1752,10 +1752,10 @@ void command_invul(Client *c, const Seperator *sep) if(sep->arg[1][0] != 0) { t->SetInvul(state); - c->Message(0, "%s is %s invulnerable from attack.", t->GetName(), state?"now":"no longer"); + c->Message(Chat::White, "%s is %s invulnerable from attack.", t->GetName(), state?"now":"no longer"); } else - c->Message(0, "Usage: #invulnerable [on/off]"); + c->Message(Chat::White, "Usage: #invulnerable [on/off]"); } void command_hideme(Client *c, const Seperator *sep) @@ -1763,7 +1763,7 @@ void command_hideme(Client *c, const Seperator *sep) bool state=atobool(sep->arg[1]); if(sep->arg[1][0]==0) - c->Message(0, "Usage: #hideme [on/off]"); + c->Message(Chat::White, "Usage: #hideme [on/off]"); else { c->SetHideMe(state); @@ -1774,7 +1774,7 @@ void command_hideme(Client *c, const Seperator *sep) void command_emote(Client *c, const Seperator *sep) { if (sep->arg[3][0] == 0) - c->Message(0, "Usage: #emote [name | world | zone] type# message"); + c->Message(Chat::White, "Usage: #emote [name | world | zone] type# message"); else { if (strcasecmp(sep->arg[1], "zone") == 0){ char* newmessage=0; @@ -1786,7 +1786,7 @@ void command_emote(Client *c, const Seperator *sep) } } else if (!worldserver.Connected()) - c->Message(0, "Error: World server disconnected"); + c->Message(Chat::White, "Error: World server disconnected"); else if (strcasecmp(sep->arg[1], "world") == 0) worldserver.SendEmoteMessage(0, 0, atoi(sep->arg[2]), sep->argplus[3]); else @@ -1798,42 +1798,42 @@ void command_fov(Client *c, const Seperator *sep) { if(c->GetTarget()) if(c->BehindMob(c->GetTarget(), c->GetX(), c->GetY())) - c->Message(0, "You are behind mob %s, it is looking to %d", c->GetTarget()->GetName(), c->GetTarget()->GetHeading()); + c->Message(Chat::White, "You are behind mob %s, it is looking to %d", c->GetTarget()->GetName(), c->GetTarget()->GetHeading()); else - c->Message(0, "You are NOT behind mob %s, it is looking to %d", c->GetTarget()->GetName(), c->GetTarget()->GetHeading()); + c->Message(Chat::White, "You are NOT behind mob %s, it is looking to %d", c->GetTarget()->GetName(), c->GetTarget()->GetHeading()); else - c->Message(0, "I Need a target!"); + c->Message(Chat::White, "I Need a target!"); } void command_npcstats(Client *c, const Seperator *sep) { if (c->GetTarget() == 0) - c->Message(0, "ERROR: No target!"); + c->Message(Chat::White, "ERROR: No target!"); else if (!c->GetTarget()->IsNPC()) - c->Message(0, "ERROR: Target is not a NPC!"); + c->Message(Chat::White, "ERROR: Target is not a NPC!"); else { auto target_npc = c->GetTarget()->CastToNPC(); - c->Message(0, "# NPC Stats"); - c->Message(0, "- Name: %s NpcID: %u", target_npc->GetName(), target_npc->GetNPCTypeID()); - c->Message(0, "- Race: %i Level: %i Class: %i Material: %i", target_npc->GetRace(), target_npc->GetLevel(), target_npc->GetClass(), target_npc->GetTexture()); - c->Message(0, "- Current HP: %i Max HP: %i", target_npc->GetHP(), target_npc->GetMaxHP()); - //c->Message(0, "Weapon Item Number: %s", target_npc->GetWeapNo()); - c->Message(0, "- Gender: %i Size: %f Bodytype: %d", target_npc->GetGender(), target_npc->GetSize(), target_npc->GetBodyType()); - c->Message(0, "- Runspeed: %.3f Walkspeed: %.3f", static_cast(0.025f * target_npc->GetRunspeed()), static_cast(0.025f * target_npc->GetWalkspeed())); - c->Message(0, "- Spawn Group: %i Grid: %i", target_npc->GetSp2(), target_npc->GetGrid()); + c->Message(Chat::White, "# NPC Stats"); + c->Message(Chat::White, "- Name: %s NpcID: %u", target_npc->GetName(), target_npc->GetNPCTypeID()); + c->Message(Chat::White, "- Race: %i Level: %i Class: %i Material: %i", target_npc->GetRace(), target_npc->GetLevel(), target_npc->GetClass(), target_npc->GetTexture()); + c->Message(Chat::White, "- Current HP: %i Max HP: %i", target_npc->GetHP(), target_npc->GetMaxHP()); + //c->Message(Chat::White, "Weapon Item Number: %s", target_npc->GetWeapNo()); + c->Message(Chat::White, "- Gender: %i Size: %f Bodytype: %d", target_npc->GetGender(), target_npc->GetSize(), target_npc->GetBodyType()); + c->Message(Chat::White, "- Runspeed: %.3f Walkspeed: %.3f", static_cast(0.025f * target_npc->GetRunspeed()), static_cast(0.025f * target_npc->GetWalkspeed())); + c->Message(Chat::White, "- Spawn Group: %i Grid: %i", target_npc->GetSp2(), target_npc->GetGrid()); if (target_npc->proximity) { - c->Message(0, "- Proximity: Enabled"); - c->Message(0, "-- Cur_X: %1.3f, Cur_Y: %1.3f, Cur_Z: %1.3f", target_npc->GetX(), target_npc->GetY(), target_npc->GetZ()); - c->Message(0, "-- Min_X: %1.3f(%1.3f), Max_X: %1.3f(%1.3f), X_Range: %1.3f", target_npc->proximity->min_x, (target_npc->proximity->min_x - target_npc->GetX()), target_npc->proximity->max_x, (target_npc->proximity->max_x - target_npc->GetX()), (target_npc->proximity->max_x - target_npc->proximity->min_x)); - c->Message(0, "-- Min_Y: %1.3f(%1.3f), Max_Y: %1.3f(%1.3f), Y_Range: %1.3f", target_npc->proximity->min_y, (target_npc->proximity->min_y - target_npc->GetY()), target_npc->proximity->max_y, (target_npc->proximity->max_y - target_npc->GetY()), (target_npc->proximity->max_y - target_npc->proximity->min_y)); - c->Message(0, "-- Min_Z: %1.3f(%1.3f), Max_Z: %1.3f(%1.3f), Z_Range: %1.3f", target_npc->proximity->min_z, (target_npc->proximity->min_z - target_npc->GetZ()), target_npc->proximity->max_z, (target_npc->proximity->max_z - target_npc->GetZ()), (target_npc->proximity->max_z - target_npc->proximity->min_z)); - c->Message(0, "-- Say: %s", (target_npc->proximity->say ? "Enabled" : "Disabled")); + c->Message(Chat::White, "- Proximity: Enabled"); + c->Message(Chat::White, "-- Cur_X: %1.3f, Cur_Y: %1.3f, Cur_Z: %1.3f", target_npc->GetX(), target_npc->GetY(), target_npc->GetZ()); + c->Message(Chat::White, "-- Min_X: %1.3f(%1.3f), Max_X: %1.3f(%1.3f), X_Range: %1.3f", target_npc->proximity->min_x, (target_npc->proximity->min_x - target_npc->GetX()), target_npc->proximity->max_x, (target_npc->proximity->max_x - target_npc->GetX()), (target_npc->proximity->max_x - target_npc->proximity->min_x)); + c->Message(Chat::White, "-- Min_Y: %1.3f(%1.3f), Max_Y: %1.3f(%1.3f), Y_Range: %1.3f", target_npc->proximity->min_y, (target_npc->proximity->min_y - target_npc->GetY()), target_npc->proximity->max_y, (target_npc->proximity->max_y - target_npc->GetY()), (target_npc->proximity->max_y - target_npc->proximity->min_y)); + c->Message(Chat::White, "-- Min_Z: %1.3f(%1.3f), Max_Z: %1.3f(%1.3f), Z_Range: %1.3f", target_npc->proximity->min_z, (target_npc->proximity->min_z - target_npc->GetZ()), target_npc->proximity->max_z, (target_npc->proximity->max_z - target_npc->GetZ()), (target_npc->proximity->max_z - target_npc->proximity->min_z)); + c->Message(Chat::White, "-- Say: %s", (target_npc->proximity->say ? "Enabled" : "Disabled")); } else { - c->Message(0, "-Proximity: Disabled"); + c->Message(Chat::White, "-Proximity: Disabled"); } - c->Message(0, ""); - c->Message(0, "EmoteID: %i", target_npc->GetEmoteID()); + c->Message(Chat::White, ""); + c->Message(Chat::White, "EmoteID: %i", target_npc->GetEmoteID()); target_npc->QueryLoot(c); } } @@ -1842,13 +1842,13 @@ void command_zclip(Client *c, const Seperator *sep) { // modifys and resends zhdr packet if(sep->arg[2][0]==0) - c->Message(0, "Usage: #zclip "); + c->Message(Chat::White, "Usage: #zclip "); else if(atoi(sep->arg[1])<=0) - c->Message(0, "ERROR: Min clip can not be zero or less!"); + c->Message(Chat::White, "ERROR: Min clip can not be zero or less!"); else if(atoi(sep->arg[2])<=0) - c->Message(0, "ERROR: Max clip can not be zero or less!"); + c->Message(Chat::White, "ERROR: Max clip can not be zero or less!"); else if(atoi(sep->arg[1])>atoi(sep->arg[2])) - c->Message(0, "ERROR: Min clip is greater than max clip!"); + c->Message(Chat::White, "ERROR: Min clip is greater than max clip!"); else { zone->newzone_data.minclip = atof(sep->arg[1]); zone->newzone_data.maxclip = atof(sep->arg[2]); @@ -1874,27 +1874,27 @@ void command_npccast(Client *c, const Seperator *sep) if (spelltar) c->GetTarget()->CastSpell(atoi(sep->arg[2]), spelltar->GetID()); else - c->Message(0, "Error: %s not found", sep->arg[1]); + c->Message(Chat::White, "Error: %s not found", sep->arg[1]); } else if (c->GetTarget() && c->GetTarget()->IsNPC() && sep->IsNumber(1) && sep->IsNumber(2) ) { Mob* spelltar = entity_list.GetMob(atoi(sep->arg[1])); if (spelltar) c->GetTarget()->CastSpell(atoi(sep->arg[2]), spelltar->GetID()); else - c->Message(0, "Error: target ID %i not found", atoi(sep->arg[1])); + c->Message(Chat::White, "Error: target ID %i not found", atoi(sep->arg[1])); } else - c->Message(0, "Usage: (needs NPC targeted) #npccast targetname/entityid spellid"); + c->Message(Chat::White, "Usage: (needs NPC targeted) #npccast targetname/entityid spellid"); } void command_zstats(Client *c, const Seperator *sep) { - c->Message(0, "Zone Header Data:"); - c->Message(0, "Sky Type: %i", zone->newzone_data.sky); - c->Message(0, "Fog Colour: Red: %i; Blue: %i; Green %i", zone->newzone_data.fog_red[0], zone->newzone_data.fog_green[0], zone->newzone_data.fog_blue[0]); - c->Message(0, "Safe Coords: %f, %f, %f", zone->newzone_data.safe_x, zone->newzone_data.safe_y, zone->newzone_data.safe_z); - c->Message(0, "Underworld Coords: %f", zone->newzone_data.underworld); - c->Message(0, "Clip Plane: %f - %f", zone->newzone_data.minclip, zone->newzone_data.maxclip); + c->Message(Chat::White, "Zone Header Data:"); + c->Message(Chat::White, "Sky Type: %i", zone->newzone_data.sky); + c->Message(Chat::White, "Fog Colour: Red: %i; Blue: %i; Green %i", zone->newzone_data.fog_red[0], zone->newzone_data.fog_green[0], zone->newzone_data.fog_blue[0]); + c->Message(Chat::White, "Safe Coords: %f, %f, %f", zone->newzone_data.safe_x, zone->newzone_data.safe_y, zone->newzone_data.safe_z); + c->Message(Chat::White, "Underworld Coords: %f", zone->newzone_data.underworld); + c->Message(Chat::White, "Clip Plane: %f - %f", zone->newzone_data.minclip, zone->newzone_data.maxclip); } void command_permaclass(Client *c, const Seperator *sep) @@ -1905,12 +1905,12 @@ void command_permaclass(Client *c, const Seperator *sep) t=c->GetTarget()->CastToClient(); if(sep->arg[1][0]==0) { - c->Message(0,"Usage: #permaclass "); + c->Message(Chat::White,"Usage: #permaclass "); } else if(!t->IsClient()) - c->Message(0,"Target is not a client."); + c->Message(Chat::White,"Target is not a client."); else { - c->Message(0, "Setting %s's class...Sending to char select.", t->GetName()); + c->Message(Chat::White, "Setting %s's class...Sending to char select.", t->GetName()); Log(Logs::General, Logs::Normal, "Class change request from %s for %s, requested class:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); t->SetBaseClass(atoi(sep->arg[1])); t->Save(); @@ -1926,13 +1926,13 @@ void command_permarace(Client *c, const Seperator *sep) t=c->GetTarget()->CastToClient(); if(sep->arg[1][0]==0) { - c->Message(0,"Usage: #permarace "); - c->Message(0,"NOTE: Not all models are global. If a model is not global, it will appear as a human on character select and in zones without the model."); + c->Message(Chat::White,"Usage: #permarace "); + c->Message(Chat::White,"NOTE: Not all models are global. If a model is not global, it will appear as a human on character select and in zones without the model."); } else if(!t->IsClient()) - c->Message(0,"Target is not a client."); + c->Message(Chat::White,"Target is not a client."); else { - c->Message(0, "Setting %s's race - zone to take effect", t->GetName()); + c->Message(Chat::White, "Setting %s's race - zone to take effect", t->GetName()); Log(Logs::General, Logs::Normal, "Permanant race change request from %s for %s, requested race:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); uint32 tmp = Mob::GetDefaultGender(atoi(sep->arg[1]), t->GetBaseGender()); t->SetBaseRace(atoi(sep->arg[1])); @@ -1950,13 +1950,13 @@ void command_permagender(Client *c, const Seperator *sep) t=c->GetTarget()->CastToClient(); if(sep->arg[1][0]==0) { - c->Message(0,"Usage: #permagender "); - c->Message(0,"Gender Numbers: 0=Male, 1=Female, 2=Neuter"); + c->Message(Chat::White,"Usage: #permagender "); + c->Message(Chat::White,"Gender Numbers: 0=Male, 1=Female, 2=Neuter"); } else if(!t->IsClient()) - c->Message(0,"Target is not a client."); + c->Message(Chat::White,"Target is not a client."); else { - c->Message(0, "Setting %s's gender - zone to take effect", t->GetName()); + c->Message(Chat::White, "Setting %s's gender - zone to take effect", t->GetName()); Log(Logs::General, Logs::Normal, "Permanant gender change request from %s for %s, requested gender:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); t->SetBaseGender(atoi(sep->arg[1])); t->Save(); @@ -1967,12 +1967,12 @@ void command_permagender(Client *c, const Seperator *sep) void command_weather(Client *c, const Seperator *sep) { if (!(sep->arg[1][0] == '0' || sep->arg[1][0] == '1' || sep->arg[1][0] == '2' || sep->arg[1][0] == '3')) { - c->Message(0, "Usage: #weather <0/1/2/3> - Off/Rain/Snow/Manual."); + c->Message(Chat::White, "Usage: #weather <0/1/2/3> - Off/Rain/Snow/Manual."); } else if(zone->zone_weather == 0) { if(sep->arg[1][0] == '3') { // Put in modifications here because it had a very good chance at screwing up the client's weather system if rain was sent during snow -T7 if(sep->arg[2][0] != 0 && sep->arg[3][0] != 0) { - c->Message(0, "Sending weather packet... TYPE=%s, INTENSITY=%s", sep->arg[2], sep->arg[3]); + c->Message(Chat::White, "Sending weather packet... TYPE=%s, INTENSITY=%s", sep->arg[2], sep->arg[3]); zone->zone_weather = atoi(sep->arg[2]); auto outapp = new EQApplicationPacket(OP_Weather, 8); outapp->pBuffer[0] = atoi(sep->arg[2]); @@ -1981,7 +1981,7 @@ void command_weather(Client *c, const Seperator *sep) safe_delete(outapp); } else { - c->Message(0, "Manual Usage: #weather 3 "); + c->Message(Chat::White, "Manual Usage: #weather 3 "); } } else if(sep->arg[1][0] == '2') { @@ -2035,16 +2035,16 @@ void command_zheader(Client *c, const Seperator *sep) { // sends zhdr packet if(sep->arg[1][0]==0) { - c->Message(0, "Usage: #zheader "); + c->Message(Chat::White, "Usage: #zheader "); } else if(database.GetZoneID(sep->argplus[1])==0) - c->Message(0, "Invalid Zone Name: %s", sep->argplus[1]); + c->Message(Chat::White, "Invalid Zone Name: %s", sep->argplus[1]); else { if (zone->LoadZoneCFG(sep->argplus[1], 0)) - c->Message(0, "Successfully loaded zone header for %s from database.", sep->argplus[1]); + c->Message(Chat::White, "Successfully loaded zone header for %s from database.", sep->argplus[1]); else - c->Message(0, "Failed to load zone header %s from database", sep->argplus[1]); + c->Message(Chat::White, "Failed to load zone header %s from database", sep->argplus[1]); auto outapp = new EQApplicationPacket(OP_NewZone, sizeof(NewZone_Struct)); memcpy(outapp->pBuffer, &zone->newzone_data, outapp->size); entity_list.QueueClients(c, outapp); @@ -2056,9 +2056,9 @@ void command_zsky(Client *c, const Seperator *sep) { // modifys and resends zhdr packet if(sep->arg[1][0]==0) - c->Message(0, "Usage: #zsky "); + c->Message(Chat::White, "Usage: #zsky "); else if(atoi(sep->arg[1])<0||atoi(sep->arg[1])>255) - c->Message(0, "ERROR: Sky type can not be less than 0 or greater than 255!"); + c->Message(Chat::White, "ERROR: Sky type can not be less than 0 or greater than 255!"); else { zone->newzone_data.sky = atoi(sep->arg[1]); auto outapp = new EQApplicationPacket(OP_NewZone, sizeof(NewZone_Struct)); @@ -2072,13 +2072,13 @@ void command_zcolor(Client *c, const Seperator *sep) { // modifys and resends zhdr packet if (sep->arg[3][0]==0) - c->Message(0, "Usage: #zcolor "); + c->Message(Chat::White, "Usage: #zcolor "); else if (atoi(sep->arg[1])<0||atoi(sep->arg[1])>255) - c->Message(0, "ERROR: Red can not be less than 0 or greater than 255!"); + c->Message(Chat::White, "ERROR: Red can not be less than 0 or greater than 255!"); else if (atoi(sep->arg[2])<0||atoi(sep->arg[2])>255) - c->Message(0, "ERROR: Green can not be less than 0 or greater than 255!"); + c->Message(Chat::White, "ERROR: Green can not be less than 0 or greater than 255!"); else if (atoi(sep->arg[3])<0||atoi(sep->arg[3])>255) - c->Message(0, "ERROR: Blue can not be less than 0 or greater than 255!"); + c->Message(Chat::White, "ERROR: Blue can not be less than 0 or greater than 255!"); else { for (int z=0; z<4; z++) { zone->newzone_data.fog_red[z] = atoi(sep->arg[1]); @@ -2131,7 +2131,7 @@ void command_gassign(Client *c, const Seperator *sep) database.AssignGrid(c, atoi(sep->arg[1]), spawn2id); } else - c->Message(0, "Usage: #gassign [num] - must have an npc target!"); + c->Message(Chat::White, "Usage: #gassign [num] - must have an npc target!"); } void command_ai(Client *c, const Seperator *sep) @@ -2143,37 +2143,37 @@ void command_ai(Client *c, const Seperator *sep) if (target->IsNPC()) target->CastToNPC()->SetNPCFactionID(atoi(sep->arg[2])); else - c->Message(0, "%s is not an NPC.", target->GetName()); + c->Message(Chat::White, "%s is not an NPC.", target->GetName()); } else - c->Message(0, "Usage: (targeted) #ai factionid [factionid]"); + c->Message(Chat::White, "Usage: (targeted) #ai factionid [factionid]"); } else if (strcasecmp(sep->arg[1], "spellslist") == 0) { if (target && sep->IsNumber(2) && atoi(sep->arg[2]) >= 0) { if (target->IsNPC()) target->CastToNPC()->AI_AddNPCSpells(atoi(sep->arg[2])); else - c->Message(0, "%s is not an NPC.", target->GetName()); + c->Message(Chat::White, "%s is not an NPC.", target->GetName()); } else - c->Message(0, "Usage: (targeted) #ai spellslist [npc_spells_id]"); + c->Message(Chat::White, "Usage: (targeted) #ai spellslist [npc_spells_id]"); } else if (strcasecmp(sep->arg[1], "con") == 0) { if (target && sep->arg[2][0] != 0) { Mob* tar2 = entity_list.GetMob(sep->arg[2]); if (tar2) - c->Message(0, "%s considering %s: %i", target->GetName(), tar2->GetName(), tar2->GetReverseFactionCon(target)); + c->Message(Chat::White, "%s considering %s: %i", target->GetName(), tar2->GetName(), tar2->GetReverseFactionCon(target)); else - c->Message(0, "Error: %s not found.", sep->arg[2]); + c->Message(Chat::White, "Error: %s not found.", sep->arg[2]); } else - c->Message(0, "Usage: (targeted) #ai con [mob name]"); + c->Message(Chat::White, "Usage: (targeted) #ai con [mob name]"); } else if (strcasecmp(sep->arg[1], "guard") == 0) { if (target && target->IsNPC()) target->CastToNPC()->SaveGuardSpot(target->GetPosition()); else - c->Message(0, "Usage: (targeted) #ai guard - sets npc to guard the current location (use #summon to move)"); + c->Message(Chat::White, "Usage: (targeted) #ai guard - sets npc to guard the current location (use #summon to move)"); } else if (strcasecmp(sep->arg[1], "roambox") == 0) { if (target && target->IsAIControlled() && target->IsNPC()) { @@ -2196,39 +2196,39 @@ void command_ai(Client *c, const Seperator *sep) target->CastToNPC()->AI_SetRoambox(atof(sep->arg[2]), atof(sep->arg[3]), tmp, tmp2); } else { - c->Message(0, "Usage: #ai roambox dist max_x min_x max_y min_y [delay] [mindelay]"); - c->Message(0, "Usage: #ai roambox dist roamdist [delay] [mindelay]"); + c->Message(Chat::White, "Usage: #ai roambox dist max_x min_x max_y min_y [delay] [mindelay]"); + c->Message(Chat::White, "Usage: #ai roambox dist roamdist [delay] [mindelay]"); } } else - c->Message(0, "You need a AI NPC targeted"); + c->Message(Chat::White, "You need a AI NPC targeted"); } else if (strcasecmp(sep->arg[1], "stop") == 0 && c->Admin() >= commandToggleAI) { if (target) { if (target->IsAIControlled()) target->AI_Stop(); else - c->Message(0, "Error: Target is not AI controlled"); + c->Message(Chat::White, "Error: Target is not AI controlled"); } else - c->Message(0, "Usage: Target a Mob with AI enabled and use this to turn off their AI."); + c->Message(Chat::White, "Usage: Target a Mob with AI enabled and use this to turn off their AI."); } else if (strcasecmp(sep->arg[1], "start") == 0 && c->Admin() >= commandToggleAI) { if (target) { if (!target->IsAIControlled()) target->AI_Start(); else - c->Message(0, "Error: Target is already AI controlled"); + c->Message(Chat::White, "Error: Target is already AI controlled"); } else - c->Message(0, "Usage: Target a Mob with AI disabled and use this to turn on their AI."); + c->Message(Chat::White, "Usage: Target a Mob with AI disabled and use this to turn on their AI."); } else { - c->Message(0, "#AI Sub-commands"); - c->Message(0, " factionid"); - c->Message(0, " spellslist"); - c->Message(0, " con"); - c->Message(0, " guard"); + c->Message(Chat::White, "#AI Sub-commands"); + c->Message(Chat::White, " factionid"); + c->Message(Chat::White, " spellslist"); + c->Message(Chat::White, " con"); + c->Message(Chat::White, " guard"); } } @@ -2240,7 +2240,7 @@ void command_worldshutdown(Client *c, const Seperator *sep) if (worldserver.Connected()) { if(sep->IsNumber(1) && sep->IsNumber(2) && ((time=atoi(sep->arg[1]))>0) && ((interval=atoi(sep->arg[2]))>0)) { worldserver.SendEmoteMessage(0,0,15,":SYSTEM MSG:World coming down in %i minutes, everyone log out before this time.", (time / 60 )); - c->Message(0, "Sending shutdown packet now, World will shutdown in: %i minutes with an interval of: %i seconds", (time / 60), interval); + c->Message(Chat::White, "Sending shutdown packet now, World will shutdown in: %i minutes with an interval of: %i seconds", (time / 60), interval); auto pack = new ServerPacket(ServerOP_ShutdownAll, sizeof(WorldShutDown_Struct)); WorldShutDown_Struct* wsd = (WorldShutDown_Struct*)pack->pBuffer; wsd->time=time*1000; @@ -2250,7 +2250,7 @@ void command_worldshutdown(Client *c, const Seperator *sep) } else if(strcasecmp(sep->arg[1], "now") == 0){ worldserver.SendEmoteMessage(0,0,15,":SYSTEM MSG:World coming down, everyone log out now."); - c->Message(0, "Sending shutdown packet"); + c->Message(Chat::White, "Sending shutdown packet"); auto pack = new ServerPacket; pack->opcode = ServerOP_ShutdownAll; pack->size=0; @@ -2258,7 +2258,7 @@ void command_worldshutdown(Client *c, const Seperator *sep) safe_delete(pack); } else if(strcasecmp(sep->arg[1], "disable") == 0){ - c->Message(0, "Shutdown prevented, next time I may not be so forgiving..."); + c->Message(Chat::White, "Shutdown prevented, next time I may not be so forgiving..."); auto pack = new ServerPacket(ServerOP_ShutdownAll, sizeof(WorldShutDown_Struct)); WorldShutDown_Struct* wsd = (WorldShutDown_Struct*)pack->pBuffer; wsd->time=0; @@ -2267,14 +2267,14 @@ void command_worldshutdown(Client *c, const Seperator *sep) safe_delete(pack); } else{ - c->Message(0,"#worldshutdown - Shuts down the server and all zones."); - c->Message(0,"Usage: #worldshutdown now - Shuts down the server and all zones immediately."); - c->Message(0,"Usage: #worldshutdown disable - Stops the server from a previously scheduled shut down."); - c->Message(0,"Usage: #worldshutdown [timer] [interval] - Shuts down the server and all zones after [timer] seconds and sends warning every [interval] seconds."); + c->Message(Chat::White,"#worldshutdown - Shuts down the server and all zones."); + c->Message(Chat::White,"Usage: #worldshutdown now - Shuts down the server and all zones immediately."); + c->Message(Chat::White,"Usage: #worldshutdown disable - Stops the server from a previously scheduled shut down."); + c->Message(Chat::White,"Usage: #worldshutdown [timer] [interval] - Shuts down the server and all zones after [timer] seconds and sends warning every [interval] seconds."); } } else - c->Message(0, "Error: World server disconnected"); + c->Message(Chat::White, "Error: World server disconnected"); } void command_sendzonespawns(Client *c, const Seperator *sep) @@ -2307,7 +2307,7 @@ void command_dbspawn2(Client *c, const Seperator *sep) database.CreateSpawn2(c, atoi(sep->arg[1]), zone->GetShortName(), c->GetPosition(), atoi(sep->arg[2]), atoi(sep->arg[3]), cond, cond_min); } else { - c->Message(0, "Usage: #dbspawn2 spawngroup respawn variance [condition_id] [condition_min]"); + c->Message(Chat::White, "Usage: #dbspawn2 spawngroup respawn variance [condition_id] [condition_min]"); } } @@ -2319,36 +2319,36 @@ void command_shutdown(Client *c, const Seperator *sep) void command_delacct(Client *c, const Seperator *sep) { if(sep->arg[1][0] == 0) - c->Message(0, "Format: #delacct accountname"); + c->Message(Chat::White, "Format: #delacct accountname"); else if (database.DeleteAccount(sep->arg[1])) - c->Message(0, "The account was deleted."); + c->Message(Chat::White, "The account was deleted."); else - c->Message(0, "Unable to delete account."); + c->Message(Chat::White, "Unable to delete account."); } void command_setpass(Client *c, const Seperator *sep) { if(sep->argnum != 2) - c->Message(0, "Format: #setpass accountname password"); + c->Message(Chat::White, "Format: #setpass accountname password"); else { int16 tmpstatus = 0; uint32 tmpid = database.GetAccountIDByName(sep->arg[1], &tmpstatus); if (!tmpid) - c->Message(0, "Error: Account not found"); + c->Message(Chat::White, "Error: Account not found"); else if (tmpstatus > c->Admin()) - c->Message(0, "Cannot change password: Account's status is higher than yours"); + c->Message(Chat::White, "Cannot change password: Account's status is higher than yours"); else if (database.SetLocalPassword(tmpid, sep->arg[2])) - c->Message(0, "Password changed."); + c->Message(Chat::White, "Password changed."); else - c->Message(0, "Error changing password."); + c->Message(Chat::White, "Error changing password."); } } void command_setlsinfo(Client *c, const Seperator *sep) { if(sep->argnum != 2) - c->Message(0, "Format: #setlsinfo email password"); + c->Message(Chat::White, "Format: #setlsinfo email password"); else { auto pack = new ServerPacket(ServerOP_LSAccountUpdate, sizeof(ServerLSAccountUpdate_Struct)); ServerLSAccountUpdate_Struct* s = (ServerLSAccountUpdate_Struct *) pack->pBuffer; @@ -2357,14 +2357,14 @@ void command_setlsinfo(Client *c, const Seperator *sep) strn0cpy(s->useremail, sep->arg[1], 100); strn0cpy(s->userpassword, sep->arg[2], 50); worldserver.SendPacket(pack); - c->Message(0, "Login Server update packet sent."); + c->Message(Chat::White, "Login Server update packet sent."); } } void command_grid(Client *c, const Seperator *sep) { if (strcasecmp("max", sep->arg[1]) == 0) { - c->Message(0, "Highest grid ID in this zone: %d", database.GetHighestGrid(zone->GetZoneID())); + c->Message(Chat::White, "Highest grid ID in this zone: %d", database.GetHighestGrid(zone->GetZoneID())); } else if (strcasecmp("add", sep->arg[1]) == 0) { database.ModifyGrid(c, false, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), zone->GetZoneID()); @@ -2374,7 +2374,7 @@ void command_grid(Client *c, const Seperator *sep) Mob *target = c->GetTarget(); if (!target || !target->IsNPC()) { - c->Message(0, "You need a NPC target!"); + c->Message(Chat::White, "You need a NPC target!"); return; } @@ -2389,12 +2389,12 @@ void command_grid(Client *c, const Seperator *sep) auto results = database.QueryDatabase(query); if (!results.Success()) { - c->Message(0, "Error querying database."); - c->Message(0, query.c_str()); + c->Message(Chat::White, "Error querying database."); + c->Message(Chat::White, query.c_str()); } if (results.RowCount() == 0) { - c->Message(0, "No grid found"); + c->Message(Chat::White, "No grid found"); return; } @@ -2430,8 +2430,8 @@ void command_grid(Client *c, const Seperator *sep) database.ModifyGrid(c, true, atoi(sep->arg[2]), 0, 0, zone->GetZoneID()); } else { - c->Message(0, "Usage: #grid add/delete grid_num wandertype pausetype"); - c->Message(0, "Usage: #grid max - displays the highest grid ID used in this zone (for add)"); + c->Message(Chat::White, "Usage: #grid add/delete grid_num wandertype pausetype"); + c->Message(Chat::White, "Usage: #grid max - displays the highest grid ID used in this zone (for add)"); } } @@ -2454,7 +2454,7 @@ void command_wp(Client *c, const Seperator *sep) else if (strcasecmp("delete", sep->arg[1]) == 0) database.DeleteWaypoint(c, atoi(sep->arg[2]),wp,zone->GetZoneID()); else - c->Message(0,"Usage: #wp add/delete grid_num pause wp_num [-h]"); + c->Message(Chat::White,"Usage: #wp add/delete grid_num pause wp_num [-h]"); } void command_iplookup(Client *c, const Seperator *sep) @@ -2474,15 +2474,15 @@ void command_size(Client *c, const Seperator *sep) { Mob *target=c->GetTarget(); if (!sep->IsNumber(1)) - c->Message(0, "Usage: #size [0 - 255] (Decimal increments are allowed)"); + c->Message(Chat::White, "Usage: #size [0 - 255] (Decimal increments are allowed)"); else { float newsize = atof(sep->arg[1]); if (newsize > 255) - c->Message(0, "Error: #size: Size can not be greater than 255."); + c->Message(Chat::White, "Error: #size: Size can not be greater than 255."); else if (newsize < 0) - c->Message(0, "Error: #size: Size can not be less than 0."); + c->Message(Chat::White, "Error: #size: Size can not be less than 0."); else if (!target) - c->Message(0,"Error: this command requires a target"); + c->Message(Chat::White,"Error: this command requires a target"); else { uint16 Race = target->GetRace(); uint8 Gender = target->GetGender(); @@ -2503,7 +2503,7 @@ void command_size(Client *c, const Seperator *sep) EyeColor1, EyeColor2, HairStyle, LuclinFace, Beard, 0xFF, DrakkinHeritage, DrakkinTattoo, DrakkinDetails, newsize); - c->Message(0,"Size = %f", atof(sep->arg[1])); + c->Message(Chat::White,"Size = %f", atof(sep->arg[1])); } } } @@ -2525,7 +2525,7 @@ void command_flymode(Client *c, const Seperator *sep) Mob *t = c; if (strlen(sep->arg[1]) == 1 && !(sep->arg[1][0] == '0' || sep->arg[1][0] == '1' || sep->arg[1][0] == '2' || sep->arg[1][0] == '3' || sep->arg[1][0] == '4' || sep->arg[1][0] == '5')) - c->Message(0, "#flymode [0/1/2/3/4/5]"); + c->Message(Chat::White, "#flymode [0/1/2/3/4/5]"); else { if (c->GetTarget()) { t = c->GetTarget(); @@ -2536,22 +2536,22 @@ void command_flymode(Client *c, const Seperator *sep) t->SetFlyMode(static_cast(fm)); t->SendAppearancePacket(AT_Levitate, fm); if (sep->arg[1][0] == '0') { - c->Message(0, "Setting %s to Grounded", t->GetName()); + c->Message(Chat::White, "Setting %s to Grounded", t->GetName()); } else if (sep->arg[1][0] == '1') { - c->Message(0, "Setting %s to Flying", t->GetName()); + c->Message(Chat::White, "Setting %s to Flying", t->GetName()); } else if (sep->arg[1][0] == '2') { - c->Message(0, "Setting %s to Levitating", t->GetName()); + c->Message(Chat::White, "Setting %s to Levitating", t->GetName()); } else if (sep->arg[1][0] == '3') { - c->Message(0, "Setting %s to In Water", t->GetName()); + c->Message(Chat::White, "Setting %s to In Water", t->GetName()); } else if (sep->arg[1][0] == '4') { - c->Message(0, "Setting %s to Floating(Boat)", t->GetName()); + c->Message(Chat::White, "Setting %s to Floating(Boat)", t->GetName()); } else if (sep->arg[1][0] == '5') { - c->Message(0, "Setting %s to Levitating While Running", t->GetName()); + c->Message(Chat::White, "Setting %s to Levitating While Running", t->GetName()); } } } @@ -2563,24 +2563,24 @@ void command_showskills(Client *c, const Seperator *sep) if(c->GetTarget() && c->GetTarget()->IsClient()) t=c->GetTarget()->CastToClient(); - c->Message(0, "Skills for %s", t->GetName()); + c->Message(Chat::White, "Skills for %s", t->GetName()); for (EQEmu::skills::SkillType i = EQEmu::skills::Skill1HBlunt; i <= EQEmu::skills::HIGHEST_SKILL; i = (EQEmu::skills::SkillType)(i + 1)) - c->Message(0, "Skill [%d] is at [%d] - %u", i, t->GetSkill(i), t->GetRawSkill(i)); + c->Message(Chat::White, "Skill [%d] is at [%d] - %u", i, t->GetSkill(i), t->GetRawSkill(i)); } void command_findspell(Client *c, const Seperator *sep) { if (sep->arg[1][0] == 0) - c->Message(0, "Usage: #FindSpell [spellname]"); + c->Message(Chat::White, "Usage: #FindSpell [spellname]"); else if (SPDAT_RECORDS <= 0) - c->Message(0, "Spells not loaded"); + c->Message(Chat::White, "Spells not loaded"); else if (Seperator::IsNumber(sep->argplus[1])) { int spellid = atoi(sep->argplus[1]); if (spellid <= 0 || spellid >= SPDAT_RECORDS) { - c->Message(0, "Error: Number out of range"); + c->Message(Chat::White, "Error: Number out of range"); } else { - c->Message(0, " %i: %s", spellid, spells[spellid].name); + c->Message(Chat::White, " %i: %s", spellid, spells[spellid].name); } } else { @@ -2597,7 +2597,7 @@ void command_findspell(Client *c, const Seperator *sep) strupr(sName); char* pdest = strstr(sName, sCriteria); if ((pdest != nullptr) && (count <=20)) { - c->Message(0, " %i: %s", i, spells[i].name); + c->Message(Chat::White, " %i: %s", i, spells[i].name); count++; } else if (count > 20) @@ -2605,16 +2605,16 @@ void command_findspell(Client *c, const Seperator *sep) } } if (count > 20) - c->Message(0, "20 spells found... max reached."); + c->Message(Chat::White, "20 spells found... max reached."); else - c->Message(0, "%i spells found.", count); + c->Message(Chat::White, "%i spells found.", count); } } void command_castspell(Client *c, const Seperator *sep) { if (!sep->IsNumber(1)) - c->Message(0, "Usage: #CastSpell spellid"); + c->Message(Chat::White, "Usage: #CastSpell spellid"); else { uint16 spellid = atoi(sep->arg[1]); /* @@ -2629,7 +2629,7 @@ void command_castspell(Client *c, const Seperator *sep) c->Admin() < commandCastSpecials) c->Message(Chat::Red, "Unable to cast spell."); else if (spellid >= SPDAT_RECORDS) - c->Message(0, "Error: #CastSpell: Argument out of range"); + c->Message(Chat::White, "Error: #CastSpell: Argument out of range"); else if (c->GetTarget() == 0) if(c->Admin() >= commandInstacast) @@ -2648,51 +2648,51 @@ void command_setlanguage(Client *c, const Seperator *sep) { if (strcasecmp(sep->arg[1], "list" ) == 0 ) { - c->Message(0, "Languages:"); - c->Message(0, "(0) Common Tongue"); - c->Message(0, "(1) Barbarian"); - c->Message(0, "(2) Erudian"); - c->Message(0, "(3) Elvish"); - c->Message(0, "(4) Dark Elvish"); - c->Message(0, "(5) Dwarvish"); - c->Message(0, "(6) Troll"); - c->Message(0, "(7) Ogre"); - c->Message(0, "(8) Gnomish"); - c->Message(0, "(9) Halfling"); - c->Message(0, "(10) Thieves Cant"); - c->Message(0, "(11) Old Erudian"); - c->Message(0, "(12) Elder Elvish"); - c->Message(0, "(13) Froglok"); - c->Message(0, "(14) Goblin"); - c->Message(0, "(15) Gnoll"); - c->Message(0, "(16) Combine Tongue"); - c->Message(0, "(17) Elder Teir`Dal"); - c->Message(0, "(18) Lizardman"); - c->Message(0, "(19) Orcish"); - c->Message(0, "(20) Faerie"); - c->Message(0, "(21) Dragon"); - c->Message(0, "(22) Elder Dragon"); - c->Message(0, "(23) Dark Speech"); - c->Message(0, "(24) Vah Shir"); - c->Message(0, "(25) Alaran"); - c->Message(0, "(26) Hadal"); - c->Message(0, "(27) Unknown1"); + c->Message(Chat::White, "Languages:"); + c->Message(Chat::White, "(0) Common Tongue"); + c->Message(Chat::White, "(1) Barbarian"); + c->Message(Chat::White, "(2) Erudian"); + c->Message(Chat::White, "(3) Elvish"); + c->Message(Chat::White, "(4) Dark Elvish"); + c->Message(Chat::White, "(5) Dwarvish"); + c->Message(Chat::White, "(6) Troll"); + c->Message(Chat::White, "(7) Ogre"); + c->Message(Chat::White, "(8) Gnomish"); + c->Message(Chat::White, "(9) Halfling"); + c->Message(Chat::White, "(10) Thieves Cant"); + c->Message(Chat::White, "(11) Old Erudian"); + c->Message(Chat::White, "(12) Elder Elvish"); + c->Message(Chat::White, "(13) Froglok"); + c->Message(Chat::White, "(14) Goblin"); + c->Message(Chat::White, "(15) Gnoll"); + c->Message(Chat::White, "(16) Combine Tongue"); + c->Message(Chat::White, "(17) Elder Teir`Dal"); + c->Message(Chat::White, "(18) Lizardman"); + c->Message(Chat::White, "(19) Orcish"); + c->Message(Chat::White, "(20) Faerie"); + c->Message(Chat::White, "(21) Dragon"); + c->Message(Chat::White, "(22) Elder Dragon"); + c->Message(Chat::White, "(23) Dark Speech"); + c->Message(Chat::White, "(24) Vah Shir"); + c->Message(Chat::White, "(25) Alaran"); + c->Message(Chat::White, "(26) Hadal"); + c->Message(Chat::White, "(27) Unknown1"); } else if( c->GetTarget() == 0 ) { - c->Message(0, "Error: #setlanguage: No target."); + c->Message(Chat::White, "Error: #setlanguage: No target."); } else if( !c->GetTarget()->IsClient() ) { - c->Message(0, "Error: Target must be a player."); + c->Message(Chat::White, "Error: Target must be a player."); } else if ( !sep->IsNumber(1) || atoi(sep->arg[1]) < 0 || atoi(sep->arg[1]) > 27 || !sep->IsNumber(2) || atoi(sep->arg[2]) < 0 || atoi(sep->arg[2]) > 100 ) { - c->Message(0, "Usage: #setlanguage [language ID] [value] (0-27, 0-100)"); - c->Message(0, "Try #setlanguage list for a list of language IDs"); + c->Message(Chat::White, "Usage: #setlanguage [language ID] [value] (0-27, 0-100)"); + c->Message(Chat::White, "Try #setlanguage list for a list of language IDs"); } else { @@ -2706,19 +2706,19 @@ void command_setlanguage(Client *c, const Seperator *sep) void command_setskill(Client *c, const Seperator *sep) { if (c->GetTarget() == nullptr) { - c->Message(0, "Error: #setskill: No target."); + c->Message(Chat::White, "Error: #setskill: No target."); } else if (!c->GetTarget()->IsClient()) { - c->Message(0, "Error: #setskill: Target must be a client."); + c->Message(Chat::White, "Error: #setskill: Target must be a client."); } else if ( !sep->IsNumber(1) || atoi(sep->arg[1]) < 0 || atoi(sep->arg[1]) > EQEmu::skills::HIGHEST_SKILL || !sep->IsNumber(2) || atoi(sep->arg[2]) < 0 || atoi(sep->arg[2]) > HIGHEST_CAN_SET_SKILL ) { - c->Message(0, "Usage: #setskill skill x "); - c->Message(0, " skill = 0 to %d", EQEmu::skills::HIGHEST_SKILL); - c->Message(0, " x = 0 to %d", HIGHEST_CAN_SET_SKILL); + c->Message(Chat::White, "Usage: #setskill skill x "); + c->Message(Chat::White, " skill = 0 to %d", EQEmu::skills::HIGHEST_SKILL); + c->Message(Chat::White, " x = 0 to %d", HIGHEST_CAN_SET_SKILL); } else { Log(Logs::General, Logs::Normal, "Set skill request from %s, target:%s skill_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); @@ -2732,12 +2732,12 @@ void command_setskill(Client *c, const Seperator *sep) void command_setskillall(Client *c, const Seperator *sep) { if (c->GetTarget() == 0) - c->Message(0, "Error: #setallskill: No target."); + c->Message(Chat::White, "Error: #setallskill: No target."); else if (!c->GetTarget()->IsClient()) - c->Message(0, "Error: #setskill: Target must be a client."); + c->Message(Chat::White, "Error: #setskill: Target must be a client."); else if (!sep->IsNumber(1) || atoi(sep->arg[1]) < 0 || atoi(sep->arg[1]) > HIGHEST_CAN_SET_SKILL) { - c->Message(0, "Usage: #setskillall value "); - c->Message(0, " value = 0 to %d", HIGHEST_CAN_SET_SKILL); + c->Message(Chat::White, "Usage: #setskillall value "); + c->Message(Chat::White, " value = 0 to %d", HIGHEST_CAN_SET_SKILL); } else { if (c->Admin() >= commandSetSkillsOther || c->GetTarget()==c || c->GetTarget()==0) { @@ -2748,7 +2748,7 @@ void command_setskillall(Client *c, const Seperator *sep) } } else - c->Message(0, "Error: Your status is not high enough to set anothers skills"); + c->Message(Chat::White, "Error: Your status is not high enough to set anothers skills"); } } @@ -2765,11 +2765,11 @@ void command_race(Client *c, const Seperator *sep) target->SendIllusionPacket(race); } else { - c->Message(0, "Usage: #race [0-732, 2253-2259] (0 for back to normal)"); + c->Message(Chat::White, "Usage: #race [0-732, 2253-2259] (0 for back to normal)"); } } else { - c->Message(0, "Usage: #race [0-732, 2253-2259] (0 for back to normal)"); + c->Message(Chat::White, "Usage: #race [0-732, 2253-2259] (0 for back to normal)"); } } @@ -2783,13 +2783,13 @@ void command_gender(Client *c, const Seperator *sep) t->SendIllusionPacket(t->GetRace(), atoi(sep->arg[1])); } else - c->Message(0, "Usage: #gender [0/1/2]"); + c->Message(Chat::White, "Usage: #gender [0/1/2]"); } void command_makepet(Client *c, const Seperator *sep) { if (sep->arg[1][0] == '\0') - c->Message(0, "Usage: #makepet pet_type_name (will not survive across zones)"); + c->Message(Chat::White, "Usage: #makepet pet_type_name (will not survive across zones)"); else c->MakePet(0, sep->arg[1]); } @@ -2799,7 +2799,7 @@ void command_level(Client *c, const Seperator *sep) uint16 level = atoi(sep->arg[1]); if ((level <= 0) || ((level > RuleI(Character, MaxLevel)) && (c->Admin() < commandLevelAboveCap))) { - c->Message(0, "Error: #Level: Invalid Level"); + c->Message(Chat::White, "Error: #Level: Invalid Level"); } else if (c->Admin() < RuleI(GM, MinStatusToLevelTarget)) { c->SetLevel(level, true); @@ -2809,11 +2809,11 @@ void command_level(Client *c, const Seperator *sep) #endif } else if (!c->GetTarget()) { - c->Message(0, "Error: #Level: No target"); + c->Message(Chat::White, "Error: #Level: No target"); } else { if (!c->GetTarget()->IsNPC() && ((c->Admin() < commandLevelNPCAboveCap) && (level > RuleI(Character, MaxLevel)))) { - c->Message(0, "Error: #Level: Invalid Level"); + c->Message(Chat::White, "Error: #Level: Invalid Level"); } else { c->GetTarget()->SetLevel(level, true); @@ -2833,16 +2833,16 @@ void command_spawn(Client *c, const Seperator *sep) if (sep->arg[1][0] != 0){ Client* client = entity_list.GetClientByName(sep->arg[1]); if(client){ - c->Message(0,"You cannot spawn a mob with the same name as a character!"); + c->Message(Chat::White,"You cannot spawn a mob with the same name as a character!"); return; } } NPC* npc = NPC::SpawnNPC(sep->argplus[1], c->GetPosition(), c); if (!npc) { - c->Message(0, "Format: #spawn name race level material hp gender class priweapon secweapon merchantid bodytype - spawns a npc those parameters."); - c->Message(0, "Name Format: NPCFirstname_NPCLastname - All numbers in a name are stripped and \"_\" characters become a space."); - c->Message(0, "Note: Using \"-\" for gender will autoselect the gender for the race. Using \"-\" for HP will use the calculated maximum HP."); + c->Message(Chat::White, "Format: #spawn name race level material hp gender class priweapon secweapon merchantid bodytype - spawns a npc those parameters."); + c->Message(Chat::White, "Name Format: NPCFirstname_NPCLastname - All numbers in a name are stripped and \"_\" characters become a space."); + c->Message(Chat::White, "Note: Using \"-\" for gender will autoselect the gender for the race. Using \"-\" for HP will use the calculated maximum HP."); } } @@ -2900,7 +2900,7 @@ void command_texture(Client *c, const Seperator *sep) } } else - c->Message(0, "Usage: #texture [texture] [helmtexture] (0-255, 255 for show equipment)"); + c->Message(Chat::White, "Usage: #texture [texture] [helmtexture] (0-255, 255 for show equipment)"); } void command_npctypespawn(Client *c, const Seperator *sep) @@ -2919,17 +2919,17 @@ void command_npctypespawn(Client *c, const Seperator *sep) entity_list.AddNPC(npc); } else - c->Message(0, "NPC Type %i not found", atoi(sep->arg[1])); + c->Message(Chat::White, "NPC Type %i not found", atoi(sep->arg[1])); } else - c->Message(0, "Usage: #npctypespawn npctypeid factionid"); + c->Message(Chat::White, "Usage: #npctypespawn npctypeid factionid"); } void command_heal(Client *c, const Seperator *sep) { if (c->GetTarget()==0) - c->Message(0, "Error: #Heal: No Target."); + c->Message(Chat::White, "Error: #Heal: No Target."); else c->GetTarget()->Heal(); } @@ -2941,12 +2941,12 @@ void command_appearance(Client *c, const Seperator *sep) // sends any appearance packet // Dev debug command, for appearance types if (sep->arg[2][0] == 0) - c->Message(0, "Usage: #appearance type value"); + c->Message(Chat::White, "Usage: #appearance type value"); else { if ((c->GetTarget())) t=c->GetTarget(); t->SendAppearancePacket(atoi(sep->arg[1]), atoi(sep->arg[2])); - c->Message(0, "Sending appearance packet: target=%s, type=%s, value=%s", t->GetName(), sep->arg[1], sep->arg[2]); + c->Message(Chat::White, "Sending appearance packet: target=%s, type=%s, value=%s", t->GetName(), sep->arg[1], sep->arg[2]); } } @@ -2957,10 +2957,10 @@ void command_nukeitem(Client *c, const Seperator *sep) if (c->GetTarget() && c->GetTarget()->IsClient() && (sep->IsNumber(1) || sep->IsHexNumber(1))) { itemid=sep->IsNumber(1)?atoi(sep->arg[1]):hextoi(sep->arg[1]); numitems = c->GetTarget()->CastToClient()->NukeItem(itemid); - c->Message(0, " %u items deleted", numitems); + c->Message(Chat::White, " %u items deleted", numitems); } else - c->Message(0, "Usage: (targted) #nukeitem itemnum - removes the item from the player's inventory"); + c->Message(Chat::White, "Usage: (targted) #nukeitem itemnum - removes the item from the player's inventory"); } void command_peekinv(Client *c, const Seperator *sep) @@ -3000,7 +3000,7 @@ void command_peekinv(Client *c, const Seperator *sep) return; if (c->GetTarget() && !c->GetTarget()->IsClient()) { - c->Message(0, "You must target a PC for this command."); + c->Message(Chat::White, "You must target a PC for this command."); return; } @@ -3021,9 +3021,9 @@ void command_peekinv(Client *c, const Seperator *sep) else if (strcasecmp(sep->arg[1], "world") == 0) { scopeMask |= peekWorld; } if (!scopeMask) { - c->Message(0, "Usage: #peekinv [equip|gen|cursor|poss|limbo|curlim|trib|bank|shbank|allbank|trade|world|all]"); - c->Message(0, "- Displays a portion of the targeted user's inventory"); - c->Message(0, "- Caution: 'all' is a lot of information!"); + c->Message(Chat::White, "Usage: #peekinv [equip|gen|cursor|poss|limbo|curlim|trib|bank|shbank|allbank|trade|world|all]"); + c->Message(Chat::White, "- Displays a portion of the targeted user's inventory"); + c->Message(Chat::White, "- Caution: 'all' is a lot of information!"); return; } @@ -3039,7 +3039,7 @@ void command_peekinv(Client *c, const Seperator *sep) EQEmu::SayLinkEngine linker; linker.SetLinkType(EQEmu::saylink::SayLinkItemInst); - c->Message(0, "Displaying inventory for %s...", targetClient->GetName()); + c->Message(Chat::White, "Displaying inventory for %s...", targetClient->GetName()); Object* objectTradeskill = targetClient->GetTradeskillObject(); @@ -3051,11 +3051,11 @@ void command_peekinv(Client *c, const Seperator *sep) if (scopeBit & peekWorld) { if (objectTradeskill == nullptr) { - c->Message(1, "No world tradeskill object selected..."); + c->Message(Chat::Default, "No world tradeskill object selected..."); continue; } else { - c->Message(0, "[WorldObject DBID: %i (entityid: %i)]", objectTradeskill->GetDBID(), objectTradeskill->GetID()); + c->Message(Chat::White, "[WorldObject DBID: %i (entityid: %i)]", objectTradeskill->GetDBID(), objectTradeskill->GetID()); } } @@ -3259,7 +3259,7 @@ void command_peekinv(Client *c, const Seperator *sep) } if (!itemsFound) - c->Message(0, "No items found."); + c->Message(Chat::White, "No items found."); } void command_interrogateinv(Client *c, const Seperator *sep) @@ -3278,14 +3278,14 @@ void command_interrogateinv(Client *c, const Seperator *sep) if (strcasecmp(sep->arg[1], "help") == 0) { if (c->Admin() < commandInterrogateInv) { - c->Message(0, "Usage: #interrogateinv"); - c->Message(0, " Displays your inventory's current in-memory nested storage references"); + c->Message(Chat::White, "Usage: #interrogateinv"); + c->Message(Chat::White, " Displays your inventory's current in-memory nested storage references"); } else { - c->Message(0, "Usage: #interrogateinv [log] [silent]"); - c->Message(0, " Displays your or your Player target inventory's current in-memory nested storage references"); - c->Message(0, " [log] - Logs interrogation to file"); - c->Message(0, " [silent] - Omits the in-game message portion of the interrogation"); + c->Message(Chat::White, "Usage: #interrogateinv [log] [silent]"); + c->Message(Chat::White, " Displays your or your Player target inventory's current in-memory nested storage references"); + c->Message(Chat::White, " [log] - Logs interrogation to file"); + c->Message(Chat::White, " [silent] - Omits the in-game message portion of the interrogation"); } return; } @@ -3314,7 +3314,7 @@ void command_interrogateinv(Client *c, const Seperator *sep) target = c->GetTarget()->CastToClient(); } else { - c->Message(1, "Use of this command is limited to Client entities"); + c->Message(Chat::Default, "Use of this command is limited to Client entities"); return; } @@ -3413,7 +3413,7 @@ void command_invsnapshot(Client *c, const Seperator *sep) if (strcmp(sep->arg[1], "gcount") == 0) { auto is_count = database.CountInvSnapshots(); - c->Message(0, "There %s %i inventory snapshot%s.", (is_count == 1 ? "is" : "are"), is_count, (is_count == 1 ? "" : "s")); + c->Message(Chat::White, "There %s %i inventory snapshot%s.", (is_count == 1 ? "is" : "are"), is_count, (is_count == 1 ? "" : "s")); return; } @@ -3421,11 +3421,11 @@ void command_invsnapshot(Client *c, const Seperator *sep) if (strcmp(sep->arg[1], "gclear") == 0) { if (strcmp(sep->arg[2], "now") == 0) { database.ClearInvSnapshots(true); - c->Message(0, "Inventory snapshots cleared using current time."); + c->Message(Chat::White, "Inventory snapshots cleared using current time."); } else { database.ClearInvSnapshots(); - c->Message(0, "Inventory snapshots cleared using RuleI(Character, InvSnapshotHistoryD) (%i day%s).", + c->Message(Chat::White, "Inventory snapshots cleared using RuleI(Character, InvSnapshotHistoryD) (%i day%s).", RuleI(Character, InvSnapshotHistoryD), (RuleI(Character, InvSnapshotHistoryD) == 1 ? "" : "s")); } @@ -3434,7 +3434,7 @@ void command_invsnapshot(Client *c, const Seperator *sep) } if (!c->GetTarget() || !c->GetTarget()->IsClient()) { - c->Message(0, "Target must be a client."); + c->Message(Chat::White, "Target must be a client."); return; } @@ -3443,12 +3443,12 @@ void command_invsnapshot(Client *c, const Seperator *sep) if (strcmp(sep->arg[1], "capture") == 0) { if (database.SaveCharacterInvSnapshot(tc->CharacterID())) { tc->SetNextInvSnapshot(RuleI(Character, InvSnapshotMinIntervalM)); - c->Message(0, "Successful inventory snapshot taken of %s - setting next interval for %i minute%s.", + c->Message(Chat::White, "Successful inventory snapshot taken of %s - setting next interval for %i minute%s.", tc->GetName(), RuleI(Character, InvSnapshotMinIntervalM), (RuleI(Character, InvSnapshotMinIntervalM) == 1 ? "" : "s")); } else { tc->SetNextInvSnapshot(RuleI(Character, InvSnapshotMinRetryM)); - c->Message(0, "Failed to take inventory snapshot of %s - retrying in %i minute%s.", + c->Message(Chat::White, "Failed to take inventory snapshot of %s - retrying in %i minute%s.", tc->GetName(), RuleI(Character, InvSnapshotMinRetryM), (RuleI(Character, InvSnapshotMinRetryM) == 1 ? "" : "s")); } @@ -3458,7 +3458,7 @@ void command_invsnapshot(Client *c, const Seperator *sep) if (c->Admin() >= commandInvSnapshot) { if (strcmp(sep->arg[1], "count") == 0) { auto is_count = database.CountCharacterInvSnapshots(tc->CharacterID()); - c->Message(0, "%s (id: %u) has %i inventory snapshot%s.", tc->GetName(), tc->CharacterID(), is_count, (is_count == 1 ? "" : "s")); + c->Message(Chat::White, "%s (id: %u) has %i inventory snapshot%s.", tc->GetName(), tc->CharacterID(), is_count, (is_count == 1 ? "" : "s")); return; } @@ -3466,11 +3466,11 @@ void command_invsnapshot(Client *c, const Seperator *sep) if (strcmp(sep->arg[1], "clear") == 0) { if (strcmp(sep->arg[2], "now") == 0) { database.ClearCharacterInvSnapshots(tc->CharacterID(), true); - c->Message(0, "%s\'s (id: %u) inventory snapshots cleared using current time.", tc->GetName(), tc->CharacterID()); + c->Message(Chat::White, "%s\'s (id: %u) inventory snapshots cleared using current time.", tc->GetName(), tc->CharacterID()); } else { database.ClearCharacterInvSnapshots(tc->CharacterID()); - c->Message(0, "%s\'s (id: %u) inventory snapshots cleared using RuleI(Character, InvSnapshotHistoryD) (%i day%s).", + c->Message(Chat::White, "%s\'s (id: %u) inventory snapshots cleared using RuleI(Character, InvSnapshotHistoryD) (%i day%s).", tc->GetName(), tc->CharacterID(), RuleI(Character, InvSnapshotHistoryD), (RuleI(Character, InvSnapshotHistoryD) == 1 ? "" : "s")); } @@ -3482,7 +3482,7 @@ void command_invsnapshot(Client *c, const Seperator *sep) database.ListCharacterInvSnapshots(tc->CharacterID(), is_list); if (is_list.empty()) { - c->Message(0, "No inventory snapshots for %s (id: %u)", tc->GetName(), tc->CharacterID()); + c->Message(Chat::White, "No inventory snapshots for %s (id: %u)", tc->GetName(), tc->CharacterID()); return; } @@ -3528,14 +3528,14 @@ void command_invsnapshot(Client *c, const Seperator *sep) if (strcmp(sep->arg[1], "parse") == 0) { if (!sep->IsNumber(2)) { - c->Message(0, "A timestamp is required to use this option."); + c->Message(Chat::White, "A timestamp is required to use this option."); return; } uint32 timestamp = atoul(sep->arg[2]); if (!database.ValidateCharacterInvSnapshotTimestamp(tc->CharacterID(), timestamp)) { - c->Message(0, "No inventory snapshots for %s (id: %u) exist at %u.", tc->GetName(), tc->CharacterID(), timestamp); + c->Message(Chat::White, "No inventory snapshots for %s (id: %u) exist at %u.", tc->GetName(), tc->CharacterID(), timestamp); return; } @@ -3554,7 +3554,7 @@ void command_invsnapshot(Client *c, const Seperator *sep) window_text.append(window_line); } else { - c->Message(0, "Too many snapshot entries to list..."); + c->Message(Chat::White, "Too many snapshot entries to list..."); break; } } @@ -3566,14 +3566,14 @@ void command_invsnapshot(Client *c, const Seperator *sep) if (strcmp(sep->arg[1], "compare") == 0) { if (!sep->IsNumber(2)) { - c->Message(0, "A timestamp is required to use this option."); + c->Message(Chat::White, "A timestamp is required to use this option."); return; } uint32 timestamp = atoul(sep->arg[2]); if (!database.ValidateCharacterInvSnapshotTimestamp(tc->CharacterID(), timestamp)) { - c->Message(0, "No inventory snapshots for %s (id: %u) exist at %u.", tc->GetName(), tc->CharacterID(), timestamp); + c->Message(Chat::White, "No inventory snapshots for %s (id: %u) exist at %u.", tc->GetName(), tc->CharacterID(), timestamp); return; } @@ -3624,7 +3624,7 @@ void command_invsnapshot(Client *c, const Seperator *sep) window_text.append(window_line); } else { - c->Message(0, "Too many comparison entries to list..."); + c->Message(Chat::White, "Too many comparison entries to list..."); break; } } @@ -3636,14 +3636,14 @@ void command_invsnapshot(Client *c, const Seperator *sep) if (strcmp(sep->arg[1], "restore") == 0) { if (!sep->IsNumber(2)) { - c->Message(0, "A timestamp is required to use this option."); + c->Message(Chat::White, "A timestamp is required to use this option."); return; } uint32 timestamp = atoul(sep->arg[2]); if (!database.ValidateCharacterInvSnapshotTimestamp(tc->CharacterID(), timestamp)) { - c->Message(0, "No inventory snapshots for %s (id: %u) exist at %u.", tc->GetName(), tc->CharacterID(), timestamp); + c->Message(Chat::White, "No inventory snapshots for %s (id: %u) exist at %u.", tc->GetName(), tc->CharacterID(), timestamp); return; } @@ -3660,7 +3660,7 @@ void command_invsnapshot(Client *c, const Seperator *sep) // cannot delete all valid item slots from client..so, we worldkick tc->WorldKick(); // self restores update before the 'kick' is processed - c->Message(0, "Successfully applied snapshot %u to %s's (id: %u) inventory.", + c->Message(Chat::White, "Successfully applied snapshot %u to %s's (id: %u) inventory.", timestamp, tc->GetName(), tc->CharacterID()); } else { @@ -3676,7 +3676,7 @@ void command_invsnapshot(Client *c, const Seperator *sep) void command_findnpctype(Client *c, const Seperator *sep) { if(sep->arg[1][0] == 0) { - c->Message(0, "Usage: #findnpctype [search criteria]"); + c->Message(Chat::White, "Usage: #findnpctype [search criteria]"); return; } @@ -3721,7 +3721,7 @@ void command_findnpctype(Client *c, const Seperator *sep) void command_findzone(Client *c, const Seperator *sep) { if(sep->arg[1][0] == 0) { - c->Message(0, "Usage: #findzone [search criteria]"); + c->Message(Chat::White, "Usage: #findzone [search criteria]"); return; } @@ -3768,27 +3768,27 @@ void command_findzone(Client *c, const Seperator *sep) void command_viewnpctype(Client *c, const Seperator *sep) { if (!sep->IsNumber(1)) - c->Message(0, "Usage: #viewnpctype [npctype id]"); + c->Message(Chat::White, "Usage: #viewnpctype [npctype id]"); else { uint32 npctypeid=atoi(sep->arg[1]); const NPCType* npct = database.LoadNPCTypesData(npctypeid); if (npct) { - c->Message(0, " NPCType Info, "); - c->Message(0, " NPCTypeID: %u", npct->npc_id); - c->Message(0, " Name: %s", npct->name); - c->Message(0, " Level: %i", npct->level); - c->Message(0, " Race: %i", npct->race); - c->Message(0, " Class: %i", npct->class_); - c->Message(0, " MinDmg: %i", npct->min_dmg); - c->Message(0, " MaxDmg: %i", npct->max_dmg); - c->Message(0, " Special Abilities: %s", npct->special_abilities); - c->Message(0, " Spells: %i", npct->npc_spells_id); - c->Message(0, " Loot Table: %i", npct->loottable_id); - c->Message(0, " NPCFactionID: %i", npct->npc_faction_id); + c->Message(Chat::White, " NPCType Info, "); + c->Message(Chat::White, " NPCTypeID: %u", npct->npc_id); + c->Message(Chat::White, " Name: %s", npct->name); + c->Message(Chat::White, " Level: %i", npct->level); + c->Message(Chat::White, " Race: %i", npct->race); + c->Message(Chat::White, " Class: %i", npct->class_); + c->Message(Chat::White, " MinDmg: %i", npct->min_dmg); + c->Message(Chat::White, " MaxDmg: %i", npct->max_dmg); + c->Message(Chat::White, " Special Abilities: %s", npct->special_abilities); + c->Message(Chat::White, " Spells: %i", npct->npc_spells_id); + c->Message(Chat::White, " Loot Table: %i", npct->loottable_id); + c->Message(Chat::White, " NPCFactionID: %i", npct->npc_faction_id); } else - c->Message(0, "NPC #%d not found", npctypeid); + c->Message(Chat::White, "NPC #%d not found", npctypeid); } } @@ -3796,13 +3796,13 @@ void command_reloadqst(Client *c, const Seperator *sep) { if (sep->arg[1][0] == 0) { - c->Message(0, "Clearing quest memory cache."); + c->Message(Chat::White, "Clearing quest memory cache."); entity_list.ClearAreas(); parse->ReloadQuests(); } else { - c->Message(0, "Clearing quest memory cache and stopping timers."); + c->Message(Chat::White, "Clearing quest memory cache and stopping timers."); entity_list.ClearAreas(); parse->ReloadQuests(true); } @@ -3816,7 +3816,7 @@ void command_corpsefix(Client *c, const Seperator *sep) void command_reloadworld(Client *c, const Seperator *sep) { - c->Message(0, "Reloading quest cache and repopping zones worldwide."); + c->Message(Chat::White, "Reloading quest cache and repopping zones worldwide."); auto pack = new ServerPacket(ServerOP_ReloadWorld, sizeof(ReloadWorld_Struct)); ReloadWorld_Struct* RW = (ReloadWorld_Struct*) pack->pBuffer; RW->Option = ((atoi(sep->arg[1]) == 1) ? 1 : 0); @@ -3845,15 +3845,15 @@ void command_reloadlevelmods(Client *c, const Seperator *sep) void command_reloadzps(Client *c, const Seperator *sep) { database.LoadStaticZonePoints(&zone->zone_point_list, zone->GetShortName(), zone->GetInstanceVersion()); - c->Message(0, "Reloading server zone_points."); + c->Message(Chat::White, "Reloading server zone_points."); } void command_zoneshutdown(Client *c, const Seperator *sep) { if (!worldserver.Connected()) - c->Message(0, "Error: World server disconnected"); + c->Message(Chat::White, "Error: World server disconnected"); else if (sep->arg[1][0] == 0) - c->Message(0, "Usage: #zoneshutdown zoneshortname"); + c->Message(Chat::White, "Usage: #zoneshutdown zoneshortname"); else { auto pack = new ServerPacket(ServerOP_ZoneShutdown, sizeof(ServerZoneStateChange_struct)); ServerZoneStateChange_struct* s = (ServerZoneStateChange_struct *) pack->pBuffer; @@ -3870,9 +3870,9 @@ void command_zoneshutdown(Client *c, const Seperator *sep) void command_zonebootup(Client *c, const Seperator *sep) { if (!worldserver.Connected()) - c->Message(0, "Error: World server disconnected"); + c->Message(Chat::White, "Error: World server disconnected"); else if (sep->arg[2][0] == 0) { - c->Message(0, "Usage: #zonebootup ZoneServerID# zoneshortname"); + c->Message(Chat::White, "Usage: #zonebootup ZoneServerID# zoneshortname"); } else { auto pack = new ServerPacket(ServerOP_ZoneBootup, sizeof(ServerZoneStateChange_struct)); @@ -3889,20 +3889,20 @@ void command_zonebootup(Client *c, const Seperator *sep) void command_kick(Client *c, const Seperator *sep) { if (sep->arg[1][0] == 0) - c->Message(0, "Usage: #kick [charname]"); + c->Message(Chat::White, "Usage: #kick [charname]"); else { Client* client = entity_list.GetClientByName(sep->arg[1]); if (client != 0) { if (client->Admin() <= c->Admin()) { - client->Message(0, "You have been kicked by %s", c->GetName()); + client->Message(Chat::White, "You have been kicked by %s", c->GetName()); auto outapp = new EQApplicationPacket(OP_GMKick, 0); client->QueuePacket(outapp); client->Kick("Ordered kicked by command"); - c->Message(0, "Kick: local: kicking %s", sep->arg[1]); + c->Message(Chat::White, "Kick: local: kicking %s", sep->arg[1]); } } else if (!worldserver.Connected()) - c->Message(0, "Error: World server disconnected"); + c->Message(Chat::White, "Error: World server disconnected"); else { auto pack = new ServerPacket(ServerOP_KickPlayer, sizeof(ServerKickPlayer_Struct)); ServerKickPlayer_Struct* skp = (ServerKickPlayer_Struct*) pack->pBuffer; @@ -3922,10 +3922,10 @@ void command_attack(Client *c, const Seperator *sep) if (sictar) c->GetTarget()->CastToNPC()->AddToHateList(sictar, 1, 0); else - c->Message(0, "Error: %s not found", sep->arg[1]); + c->Message(Chat::White, "Error: %s not found", sep->arg[1]); } else - c->Message(0, "Usage: (needs NPC targeted) #attack targetname"); + c->Message(Chat::White, "Usage: (needs NPC targeted) #attack targetname"); } void command_lock(Client *c, const Seperator *sep) @@ -4027,7 +4027,7 @@ void command_equipitem(Client *c, const Seperator *sep) // di->to_slot = 0xFFFFFFFF; // di->number_in_stack = 0xFFFFFFFF; - // c->Message(0, "Deleting %i charges from stack", movecount); // debug line..delete + // c->Message(Chat::White, "Deleting %i charges from stack", movecount); // debug line..delete // for (int16 deletecount=0; deletecount < movecount; deletecount++) // have to use 'movecount' because mi->number_in_stack is 'ENCODED' at this point (i.e., 99 charges returns 22...) @@ -4049,7 +4049,7 @@ void command_equipitem(Client *c, const Seperator *sep) c->Message(Chat::Red, "Error: Item on your cursor cannot be equipped"); } else - c->Message(0, "Usage: #equipitem slotid[0-21] - equips the item on your cursor to the position"); + c->Message(Chat::White, "Usage: #equipitem slotid[0-21] - equips the item on your cursor to the position"); } void command_zonelock(Client *c, const Seperator *sep) @@ -4069,7 +4069,7 @@ void command_zonelock(Client *c, const Seperator *sep) worldserver.SendPacket(pack); } else - c->Message(0, "Usage: #zonelock lock [zonename]"); + c->Message(Chat::White, "Usage: #zonelock lock [zonename]"); } else if (strcasecmp(sep->arg[1], "unlock") == 0 && c->Admin() >= commandLockZones) { uint16 tmp = database.GetZoneID(sep->arg[2]); @@ -4079,15 +4079,15 @@ void command_zonelock(Client *c, const Seperator *sep) worldserver.SendPacket(pack); } else - c->Message(0, "Usage: #zonelock unlock [zonename]"); + c->Message(Chat::White, "Usage: #zonelock unlock [zonename]"); } else { - c->Message(0, "#zonelock sub-commands"); - c->Message(0, " list"); + c->Message(Chat::White, "#zonelock sub-commands"); + c->Message(Chat::White, " list"); if(c->Admin() >= commandLockZones) { - c->Message(0, " lock [zonename]"); - c->Message(0, " unlock [zonename]"); + c->Message(Chat::White, " lock [zonename]"); + c->Message(Chat::White, " unlock [zonename]"); } } safe_delete(pack); @@ -4100,24 +4100,24 @@ void command_corpse(Client *c, const Seperator *sep) if (strcasecmp(sep->arg[1], "DeletePlayerCorpses") == 0 && c->Admin() >= commandEditPlayerCorpses) { int32 tmp = entity_list.DeletePlayerCorpses(); if (tmp >= 0) - c->Message(0, "%i corpses deleted.", tmp); + c->Message(Chat::White, "%i corpses deleted.", tmp); else - c->Message(0, "DeletePlayerCorpses Error #%i", tmp); + c->Message(Chat::White, "DeletePlayerCorpses Error #%i", tmp); } else if (strcasecmp(sep->arg[1], "delete") == 0) { if (target == 0 || !target->IsCorpse()) - c->Message(0, "Error: Target the corpse you wish to delete"); + c->Message(Chat::White, "Error: Target the corpse you wish to delete"); else if (target->IsNPCCorpse()) { - c->Message(0, "Depoping %s.", target->GetName()); + c->Message(Chat::White, "Depoping %s.", target->GetName()); target->CastToCorpse()->Delete(); } else if (c->Admin() >= commandEditPlayerCorpses) { - c->Message(0, "Deleting %s.", target->GetName()); + c->Message(Chat::White, "Deleting %s.", target->GetName()); target->CastToCorpse()->Delete(); } else - c->Message(0, "Insufficient status to delete player corpse."); + c->Message(Chat::White, "Insufficient status to delete player corpse."); } else if (strcasecmp(sep->arg[1], "ListNPC") == 0) { entity_list.ListNPCCorpses(c); @@ -4128,101 +4128,101 @@ void command_corpse(Client *c, const Seperator *sep) else if (strcasecmp(sep->arg[1], "DeleteNPCCorpses") == 0) { int32 tmp = entity_list.DeleteNPCCorpses(); if (tmp >= 0) - c->Message(0, "%d corpses deleted.", tmp); + c->Message(Chat::White, "%d corpses deleted.", tmp); else - c->Message(0, "DeletePlayerCorpses Error #%d", tmp); + c->Message(Chat::White, "DeletePlayerCorpses Error #%d", tmp); } else if (strcasecmp(sep->arg[1], "charid") == 0 && c->Admin() >= commandEditPlayerCorpses) { if (target == 0 || !target->IsPlayerCorpse()) - c->Message(0, "Error: Target must be a player corpse."); + c->Message(Chat::White, "Error: Target must be a player corpse."); else if (!sep->IsNumber(2)) - c->Message(0, "Error: charid must be a number."); + c->Message(Chat::White, "Error: charid must be a number."); else - c->Message(0, "Setting CharID=%u on PlayerCorpse '%s'", target->CastToCorpse()->SetCharID(atoi(sep->arg[2])), target->GetName()); + c->Message(Chat::White, "Setting CharID=%u on PlayerCorpse '%s'", target->CastToCorpse()->SetCharID(atoi(sep->arg[2])), target->GetName()); } else if (strcasecmp(sep->arg[1], "ResetLooter") == 0) { if (target == 0 || !target->IsCorpse()) - c->Message(0, "Error: Target the corpse you wish to reset"); + c->Message(Chat::White, "Error: Target the corpse you wish to reset"); else target->CastToCorpse()->ResetLooter(); } else if (strcasecmp(sep->arg[1], "RemoveCash") == 0) { if (target == 0 || !target->IsCorpse()) - c->Message(0, "Error: Target the corpse you wish to remove the cash from"); + c->Message(Chat::White, "Error: Target the corpse you wish to remove the cash from"); else if (!target->IsPlayerCorpse() || c->Admin() >= commandEditPlayerCorpses) { - c->Message(0, "Removing Cash from %s.", target->GetName()); + c->Message(Chat::White, "Removing Cash from %s.", target->GetName()); target->CastToCorpse()->RemoveCash(); } else - c->Message(0, "Insufficient status to modify player corpse."); + c->Message(Chat::White, "Insufficient status to modify player corpse."); } else if (strcasecmp(sep->arg[1], "InspectLoot") == 0) { if (target == 0 || !target->IsCorpse()) - c->Message(0, "Error: Target must be a corpse."); + c->Message(Chat::White, "Error: Target must be a corpse."); else target->CastToCorpse()->QueryLoot(c); } else if (strcasecmp(sep->arg[1], "lock") == 0) { if (target == 0 || !target->IsCorpse()) - c->Message(0, "Error: Target must be a corpse."); + c->Message(Chat::White, "Error: Target must be a corpse."); else { target->CastToCorpse()->Lock(); - c->Message(0, "Locking %s...", target->GetName()); + c->Message(Chat::White, "Locking %s...", target->GetName()); } } else if (strcasecmp(sep->arg[1], "unlock") == 0) { if (target == 0 || !target->IsCorpse()) - c->Message(0, "Error: Target must be a corpse."); + c->Message(Chat::White, "Error: Target must be a corpse."); else { target->CastToCorpse()->UnLock(); - c->Message(0, "Unlocking %s...", target->GetName()); + c->Message(Chat::White, "Unlocking %s...", target->GetName()); } } else if (strcasecmp(sep->arg[1], "depop") == 0) { if (target == 0 || !target->IsPlayerCorpse()) - c->Message(0, "Error: Target must be a player corpse."); + c->Message(Chat::White, "Error: Target must be a player corpse."); else if (c->Admin() >= commandEditPlayerCorpses && target->IsPlayerCorpse()) { - c->Message(0, "Depoping %s.", target->GetName()); + c->Message(Chat::White, "Depoping %s.", target->GetName()); target->CastToCorpse()->DepopPlayerCorpse(); if(!sep->arg[2][0] || atoi(sep->arg[2]) != 0) target->CastToCorpse()->Bury(); } else - c->Message(0, "Insufficient status to depop player corpse."); + c->Message(Chat::White, "Insufficient status to depop player corpse."); } else if (strcasecmp(sep->arg[1], "depopall") == 0) { if (target == 0 || !target->IsClient()) - c->Message(0, "Error: Target must be a player."); + c->Message(Chat::White, "Error: Target must be a player."); else if (c->Admin() >= commandEditPlayerCorpses && target->IsClient()) { - c->Message(0, "Depoping %s\'s corpses.", target->GetName()); + c->Message(Chat::White, "Depoping %s\'s corpses.", target->GetName()); target->CastToClient()->DepopAllCorpses(); if(!sep->arg[2][0] || atoi(sep->arg[2]) != 0) target->CastToClient()->BuryPlayerCorpses(); } else - c->Message(0, "Insufficient status to depop player corpse."); + c->Message(Chat::White, "Insufficient status to depop player corpse."); } else if (sep->arg[1][0] == 0 || strcasecmp(sep->arg[1], "help") == 0) { - c->Message(0, "#Corpse Sub-Commands:"); - c->Message(0, " DeleteNPCCorpses"); - c->Message(0, " Delete - Delete targetted corpse"); - c->Message(0, " ListNPC"); - c->Message(0, " ListPlayer"); - c->Message(0, " Lock - GM locks the corpse - cannot be looted by non-GM"); - c->Message(0, " UnLock"); - c->Message(0, " RemoveCash"); - c->Message(0, " InspectLoot"); - c->Message(0, " [to remove items from corpses, loot them]"); - c->Message(0, "Lead-GM status required to delete/modify player corpses"); - c->Message(0, " DeletePlayerCorpses"); - c->Message(0, " CharID [charid] - change player corpse's owner"); - c->Message(0, " Depop [bury] - Depops single target corpse."); - c->Message(0, " Depopall [bury] - Depops all target player's corpses."); - c->Message(0, "Set bury to 0 to skip burying the corpses."); + c->Message(Chat::White, "#Corpse Sub-Commands:"); + c->Message(Chat::White, " DeleteNPCCorpses"); + c->Message(Chat::White, " Delete - Delete targetted corpse"); + c->Message(Chat::White, " ListNPC"); + c->Message(Chat::White, " ListPlayer"); + c->Message(Chat::White, " Lock - GM locks the corpse - cannot be looted by non-GM"); + c->Message(Chat::White, " UnLock"); + c->Message(Chat::White, " RemoveCash"); + c->Message(Chat::White, " InspectLoot"); + c->Message(Chat::White, " [to remove items from corpses, loot them]"); + c->Message(Chat::White, "Lead-GM status required to delete/modify player corpses"); + c->Message(Chat::White, " DeletePlayerCorpses"); + c->Message(Chat::White, " CharID [charid] - change player corpse's owner"); + c->Message(Chat::White, " Depop [bury] - Depops single target corpse."); + c->Message(Chat::White, " Depopall [bury] - Depops all target player's corpses."); + c->Message(Chat::White, "Set bury to 0 to skip burying the corpses."); } else - c->Message(0, "Error, #corpse sub-command not found"); + c->Message(Chat::White, "Error, #corpse sub-command not found"); } void command_fixmob(Client *c, const Seperator *sep) @@ -4231,9 +4231,9 @@ void command_fixmob(Client *c, const Seperator *sep) const char* Usage = "Usage: #fixmob [race|gender|texture|helm|face|hair|haircolor|beard|beardcolor|heritage|tattoo|detail] [next|prev]"; if (!sep->arg[1]) - c->Message(0,Usage); + c->Message(Chat::White,Usage); else if (!target) - c->Message(0,"Error: this command requires a target"); + c->Message(Chat::White,"Error: this command requires a target"); else { @@ -4435,7 +4435,7 @@ void command_fixmob(Client *c, const Seperator *sep) if (ChangeType == nullptr) { - c->Message(0,Usage); + c->Message(Chat::White,Usage); } else { @@ -4443,7 +4443,7 @@ void command_fixmob(Client *c, const Seperator *sep) EyeColor1, EyeColor2, HairStyle, LuclinFace, Beard, 0xFF, DrakkinHeritage, DrakkinTattoo, DrakkinDetails); - c->Message(0, "%s=%i", ChangeType, ChangeSetting); + c->Message(Chat::White, "%s=%i", ChangeType, ChangeSetting); } } } @@ -4459,19 +4459,19 @@ void command_gmspeed(Client *c, const Seperator *sep) if (sep->arg[1][0] != 0) { database.SetGMSpeed(t->AccountID(), state ? 1 : 0); - c->Message(0, "Turning GMSpeed %s for %s (zone to take effect)", state ? "On" : "Off", t->GetName()); + c->Message(Chat::White, "Turning GMSpeed %s for %s (zone to take effect)", state ? "On" : "Off", t->GetName()); } else { - c->Message(0, "Usage: #gmspeed [on/off]"); + c->Message(Chat::White, "Usage: #gmspeed [on/off]"); } } void command_gmzone(Client *c, const Seperator *sep) { if (!sep->arg[1]) { - c->Message(0, "Usage"); - c->Message(0, "-------"); - c->Message(0, "#gmzone [zone_short_name] [zone_version=0]"); + c->Message(Chat::White, "Usage"); + c->Message(Chat::White, "-------"); + c->Message(Chat::White, "#gmzone [zone_short_name] [zone_version=0]"); return; } @@ -4543,7 +4543,7 @@ void command_gmzone(Client *c, const Seperator *sep) void command_title(Client *c, const Seperator *sep) { if (sep->arg[1][0]==0) - c->Message(0, "Usage: #title [remove|text] [1 = Create row in title table] - remove or set title to 'text'"); + c->Message(Chat::White, "Usage: #title [remove|text] [1 = Create row in title table] - remove or set title to 'text'"); else { bool Save = (atoi(sep->arg[2]) == 1); @@ -4593,7 +4593,7 @@ void command_title(Client *c, const Seperator *sep) void command_titlesuffix(Client *c, const Seperator *sep) { if (sep->arg[1][0]==0) - c->Message(0, "Usage: #titlesuffix [remove|text] [1 = create row in title table] - remove or set title suffix to 'text'"); + c->Message(Chat::White, "Usage: #titlesuffix [remove|text] [1 = create row in title table] - remove or set title suffix to 'text'"); else { bool Save = (atoi(sep->arg[2]) == 1); @@ -4643,53 +4643,53 @@ void command_titlesuffix(Client *c, const Seperator *sep) void command_spellinfo(Client *c, const Seperator *sep) { if(sep->arg[1][0]==0) - c->Message(0, "Usage: #spellinfo [spell_id]"); + c->Message(Chat::White, "Usage: #spellinfo [spell_id]"); else { short int spell_id=atoi(sep->arg[1]); const struct SPDat_Spell_Struct *s=&spells[spell_id]; - c->Message(0, "Spell info for spell #%d:", spell_id); - c->Message(0, " name: %s", s->name); - c->Message(0, " player_1: %s", s->player_1); - c->Message(0, " teleport_zone: %s", s->teleport_zone); - c->Message(0, " you_cast: %s", s->you_cast); - c->Message(0, " other_casts: %s", s->other_casts); - c->Message(0, " cast_on_you: %s", s->cast_on_you); - c->Message(0, " spell_fades: %s", s->spell_fades); - c->Message(0, " range: %f", s->range); - c->Message(0, " aoerange: %f", s->aoerange); - c->Message(0, " pushback: %f", s->pushback); - c->Message(0, " pushup: %f", s->pushup); - c->Message(0, " cast_time: %d", s->cast_time); - c->Message(0, " recovery_time: %d", s->recovery_time); - c->Message(0, " recast_time: %d", s->recast_time); - c->Message(0, " buffdurationformula: %d", s->buffdurationformula); - c->Message(0, " buffduration: %d", s->buffduration); - c->Message(0, " AEDuration: %d", s->AEDuration); - c->Message(0, " mana: %d", s->mana); - c->Message(0, " base[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", s->base[0], s->base[1], s->base[2], s->base[3], s->base[4], s->base[5], s->base[6], s->base[7], s->base[8], s->base[9], s->base[10], s->base[11]); - c->Message(0, " base22[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", s->base2[0], s->base2[1], s->base2[2], s->base2[3], s->base2[4], s->base2[5], s->base2[6], s->base2[7], s->base2[8], s->base2[9], s->base2[10], s->base2[11]); - c->Message(0, " max[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", s->max[0], s->max[1], s->max[2], s->max[3], s->max[4], s->max[5], s->max[6], s->max[7], s->max[8], s->max[9], s->max[10], s->max[11]); - c->Message(0, " components[4]: %d, %d, %d, %d", s->components[0], s->components[1], s->components[2], s->components[3]); - c->Message(0, " component_counts[4]: %d, %d, %d, %d", s->component_counts[0], s->component_counts[1], s->component_counts[2], s->component_counts[3]); - c->Message(0, " NoexpendReagent[4]: %d, %d, %d, %d", s->NoexpendReagent[0], s->NoexpendReagent[1], s->NoexpendReagent[2], s->NoexpendReagent[3]); - c->Message(0, " formula[12]: 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x", s->formula[0], s->formula[1], s->formula[2], s->formula[3], s->formula[4], s->formula[5], s->formula[6], s->formula[7], s->formula[8], s->formula[9], s->formula[10], s->formula[11]); - c->Message(0, " goodEffect: %d", s->goodEffect); - c->Message(0, " Activated: %d", s->Activated); - c->Message(0, " resisttype: %d", s->resisttype); - c->Message(0, " effectid[12]: 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x", s->effectid[0], s->effectid[1], s->effectid[2], s->effectid[3], s->effectid[4], s->effectid[5], s->effectid[6], s->effectid[7], s->effectid[8], s->effectid[9], s->effectid[10], s->effectid[11]); - c->Message(0, " targettype: %d", s->targettype); - c->Message(0, " basediff: %d", s->basediff); - c->Message(0, " skill: %d", s->skill); - c->Message(0, " zonetype: %d", s->zonetype); - c->Message(0, " EnvironmentType: %d", s->EnvironmentType); - c->Message(0, " TimeOfDay: %d", s->TimeOfDay); - c->Message(0, " classes[15]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", + c->Message(Chat::White, "Spell info for spell #%d:", spell_id); + c->Message(Chat::White, " name: %s", s->name); + c->Message(Chat::White, " player_1: %s", s->player_1); + c->Message(Chat::White, " teleport_zone: %s", s->teleport_zone); + c->Message(Chat::White, " you_cast: %s", s->you_cast); + c->Message(Chat::White, " other_casts: %s", s->other_casts); + c->Message(Chat::White, " cast_on_you: %s", s->cast_on_you); + c->Message(Chat::White, " spell_fades: %s", s->spell_fades); + c->Message(Chat::White, " range: %f", s->range); + c->Message(Chat::White, " aoerange: %f", s->aoerange); + c->Message(Chat::White, " pushback: %f", s->pushback); + c->Message(Chat::White, " pushup: %f", s->pushup); + c->Message(Chat::White, " cast_time: %d", s->cast_time); + c->Message(Chat::White, " recovery_time: %d", s->recovery_time); + c->Message(Chat::White, " recast_time: %d", s->recast_time); + c->Message(Chat::White, " buffdurationformula: %d", s->buffdurationformula); + c->Message(Chat::White, " buffduration: %d", s->buffduration); + c->Message(Chat::White, " AEDuration: %d", s->AEDuration); + c->Message(Chat::White, " mana: %d", s->mana); + c->Message(Chat::White, " base[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", s->base[0], s->base[1], s->base[2], s->base[3], s->base[4], s->base[5], s->base[6], s->base[7], s->base[8], s->base[9], s->base[10], s->base[11]); + c->Message(Chat::White, " base22[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", s->base2[0], s->base2[1], s->base2[2], s->base2[3], s->base2[4], s->base2[5], s->base2[6], s->base2[7], s->base2[8], s->base2[9], s->base2[10], s->base2[11]); + c->Message(Chat::White, " max[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", s->max[0], s->max[1], s->max[2], s->max[3], s->max[4], s->max[5], s->max[6], s->max[7], s->max[8], s->max[9], s->max[10], s->max[11]); + c->Message(Chat::White, " components[4]: %d, %d, %d, %d", s->components[0], s->components[1], s->components[2], s->components[3]); + c->Message(Chat::White, " component_counts[4]: %d, %d, %d, %d", s->component_counts[0], s->component_counts[1], s->component_counts[2], s->component_counts[3]); + c->Message(Chat::White, " NoexpendReagent[4]: %d, %d, %d, %d", s->NoexpendReagent[0], s->NoexpendReagent[1], s->NoexpendReagent[2], s->NoexpendReagent[3]); + c->Message(Chat::White, " formula[12]: 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x", s->formula[0], s->formula[1], s->formula[2], s->formula[3], s->formula[4], s->formula[5], s->formula[6], s->formula[7], s->formula[8], s->formula[9], s->formula[10], s->formula[11]); + c->Message(Chat::White, " goodEffect: %d", s->goodEffect); + c->Message(Chat::White, " Activated: %d", s->Activated); + c->Message(Chat::White, " resisttype: %d", s->resisttype); + c->Message(Chat::White, " effectid[12]: 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x", s->effectid[0], s->effectid[1], s->effectid[2], s->effectid[3], s->effectid[4], s->effectid[5], s->effectid[6], s->effectid[7], s->effectid[8], s->effectid[9], s->effectid[10], s->effectid[11]); + c->Message(Chat::White, " targettype: %d", s->targettype); + c->Message(Chat::White, " basediff: %d", s->basediff); + c->Message(Chat::White, " skill: %d", s->skill); + c->Message(Chat::White, " zonetype: %d", s->zonetype); + c->Message(Chat::White, " EnvironmentType: %d", s->EnvironmentType); + c->Message(Chat::White, " TimeOfDay: %d", s->TimeOfDay); + c->Message(Chat::White, " classes[15]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", s->classes[0], s->classes[1], s->classes[2], s->classes[3], s->classes[4], s->classes[5], s->classes[6], s->classes[7], s->classes[8], s->classes[9], s->classes[10], s->classes[11], s->classes[12], s->classes[13], s->classes[14]); - c->Message(0, " CastingAnim: %d", s->CastingAnim); - c->Message(0, " SpellAffectIndex: %d", s->SpellAffectIndex); - c->Message(0, " RecourseLink: %d", s->RecourseLink); + c->Message(Chat::White, " CastingAnim: %d", s->CastingAnim); + c->Message(Chat::White, " SpellAffectIndex: %d", s->SpellAffectIndex); + c->Message(Chat::White, " RecourseLink: %d", s->RecourseLink); } } @@ -4704,7 +4704,7 @@ void command_lastname(Client *c, const Seperator *sep) if(strlen(sep->arg[1]) <= 70) t->ChangeLastName(sep->arg[1]); else - c->Message(0, "Usage: #lastname where is less than 70 chars long"); + c->Message(Chat::White, "Usage: #lastname where is less than 70 chars long"); } void command_memspell(Client *c, const Seperator *sep) @@ -4714,7 +4714,7 @@ void command_memspell(Client *c, const Seperator *sep) if (!(sep->IsNumber(1) && sep->IsNumber(2))) { - c->Message(0, "Usage: #MemSpell slotid spellid"); + c->Message(Chat::White, "Usage: #MemSpell slotid spellid"); } else { @@ -4722,12 +4722,12 @@ void command_memspell(Client *c, const Seperator *sep) spell_id = atoi(sep->arg[2]); if (slot > EQEmu::spells::SPELL_GEM_COUNT || spell_id >= SPDAT_RECORDS) { - c->Message(0, "Error: #MemSpell: Arguement out of range"); + c->Message(Chat::White, "Error: #MemSpell: Arguement out of range"); } else { c->MemSpell(spell_id, slot); - c->Message(0, "Spell slot changed, have fun!"); + c->Message(Chat::White, "Spell slot changed, have fun!"); } } } @@ -4735,21 +4735,21 @@ void command_memspell(Client *c, const Seperator *sep) void command_save(Client *c, const Seperator *sep) { if (c->GetTarget() == 0) - c->Message(0, "Error: no target"); + c->Message(Chat::White, "Error: no target"); else if (c->GetTarget()->IsClient()) { if (c->GetTarget()->CastToClient()->Save(2)) - c->Message(0, "%s successfully saved.", c->GetTarget()->GetName()); + c->Message(Chat::White, "%s successfully saved.", c->GetTarget()->GetName()); else - c->Message(0, "Manual save for %s failed.", c->GetTarget()->GetName()); + c->Message(Chat::White, "Manual save for %s failed.", c->GetTarget()->GetName()); } else if (c->GetTarget()->IsPlayerCorpse()) { if (c->GetTarget()->CastToMob()->Save()) - c->Message(0, "%s successfully saved. (dbid=%u)", c->GetTarget()->GetName(), c->GetTarget()->CastToCorpse()->GetCorpseDBID()); + c->Message(Chat::White, "%s successfully saved. (dbid=%u)", c->GetTarget()->GetName(), c->GetTarget()->CastToCorpse()->GetCorpseDBID()); else - c->Message(0, "Manual save for %s failed.", c->GetTarget()->GetName()); + c->Message(Chat::White, "Manual save for %s failed.", c->GetTarget()->GetName()); } else - c->Message(0, "Error: target not a Client/PlayerCorpse"); + c->Message(Chat::White, "Error: target not a Client/PlayerCorpse"); } void command_showstats(Client *c, const Seperator *sep) @@ -4762,7 +4762,7 @@ void command_showstats(Client *c, const Seperator *sep) void command_showzonegloballoot(Client *c, const Seperator *sep) { - c->Message(0, "GlobalLoot for %s (%d:%d)", zone->GetShortName(), zone->GetZoneID(), zone->GetInstanceVersion()); + c->Message(Chat::White, "GlobalLoot for %s (%d:%d)", zone->GetShortName(), zone->GetZoneID(), zone->GetInstanceVersion()); zone->ShowZoneGlobalLoot(c); } @@ -4789,7 +4789,7 @@ void command_bind(Client *c, const Seperator *sep) if (c->GetTarget()->IsClient()) c->GetTarget()->CastToClient()->SetBindPoint(); else - c->Message(0, "Error: target not a Player"); + c->Message(Chat::White, "Error: target not a Player"); } else c->SetBindPoint(); } @@ -4797,9 +4797,9 @@ void command_bind(Client *c, const Seperator *sep) void command_depop(Client *c, const Seperator *sep) { if (c->GetTarget() == 0 || !(c->GetTarget()->IsNPC() || c->GetTarget()->IsNPCCorpse())) - c->Message(0, "You must have a NPC target for this command. (maybe you meant #depopzone?)"); + c->Message(Chat::White, "You must have a NPC target for this command. (maybe you meant #depopzone?)"); else { - c->Message(0, "Depoping '%s'.", c->GetTarget()->GetName()); + c->Message(Chat::White, "Depoping '%s'.", c->GetTarget()->GetName()); c->GetTarget()->Depop(); } } @@ -4807,7 +4807,7 @@ void command_depop(Client *c, const Seperator *sep) void command_depopzone(Client *c, const Seperator *sep) { zone->Depop(); - c->Message(0, "Zone depoped."); + c->Message(Chat::White, "Zone depoped."); } void command_devtools(Client *c, const Seperator *sep) @@ -4849,8 +4849,8 @@ void command_devtools(Client *c, const Seperator *sep) /** * Print menu */ - c->Message(0, "| [Devtools] Window %s", window_toggle_command.c_str()); - c->Message(0, "| [Devtools] Search %s", menu_commands_search.c_str()); + c->Message(Chat::White, "| [Devtools] Window %s", window_toggle_command.c_str()); + c->Message(Chat::White, "| [Devtools] Search %s", menu_commands_search.c_str()); } void command_repop(Client *c, const Seperator *sep) @@ -4872,11 +4872,11 @@ void command_repop(Client *c, const Seperator *sep) auto results = database.QueryDatabase(query); iterator.Advance(); } - c->Message(0, "Zone depop: Force resetting spawn timers."); + c->Message(Chat::White, "Zone depop: Force resetting spawn timers."); } if (!sep->IsNumber(timearg)) { - c->Message(0, "Zone depopped - repopping now."); + c->Message(Chat::White, "Zone depopped - repopping now."); zone->Repop(); @@ -4885,7 +4885,7 @@ void command_repop(Client *c, const Seperator *sep) return; } - c->Message(0, "Zone depoped. Repop in %i seconds", atoi(sep->arg[timearg])); + c->Message(Chat::White, "Zone depoped. Repop in %i seconds", atoi(sep->arg[timearg])); zone->Repop(atoi(sep->arg[timearg]) * 1000); zone->spawn2_timer.Trigger(); @@ -4908,13 +4908,13 @@ void command_repopclose(Client *c, const Seperator *sep) auto results = database.QueryDatabase(query); iterator.Advance(); } - c->Message(0, "Zone depop: Force resetting spawn timers."); + c->Message(Chat::White, "Zone depop: Force resetting spawn timers."); } if (sep->IsNumber(1)) { repop_distance = atoi(sep->arg[1]); } - c->Message(0, "Zone depoped. Repopping NPC's within %i distance units", repop_distance); + c->Message(Chat::White, "Zone depoped. Repopping NPC's within %i distance units", repop_distance); zone->RepopClose(c->GetPosition(), repop_distance); } @@ -4942,7 +4942,7 @@ void command_spawnstatus(Client *c, const Seperator *sep) } else if(strcmp(sep->arg[1], "help") == 0) { - c->Message(0, "Usage: #spawnstatus <[a]ll | [d]isabled | [e]nabled | {Spawn2 ID}>"); + c->Message(Chat::White, "Usage: #spawnstatus <[a]ll | [d]isabled | [e]nabled | {Spawn2 ID}>"); } else { zone->SpawnStatus(c); @@ -4961,7 +4961,7 @@ void command_zuwcoords(Client *c, const Seperator *sep) { // modifys and resends zhdr packet if(sep->arg[1][0]==0) - c->Message(0, "Usage: #zuwcoords "); + c->Message(Chat::White, "Usage: #zuwcoords "); else { zone->newzone_data.underworld = atof(sep->arg[1]); //float newdata = atof(sep->arg[1]); @@ -4976,7 +4976,7 @@ void command_zuwcoords(Client *c, const Seperator *sep) void command_zunderworld(Client *c, const Seperator *sep) { if(sep->arg[1][0]==0) - c->Message(0, "Usage: #zunderworld "); + c->Message(Chat::White, "Usage: #zunderworld "); else { zone->newzone_data.underworld = atof(sep->arg[1]); } @@ -4986,7 +4986,7 @@ void command_zsafecoords(Client *c, const Seperator *sep) { // modifys and resends zhdr packet if(sep->arg[3][0]==0) - c->Message(0, "Usage: #zsafecoords "); + c->Message(Chat::White, "Usage: #zsafecoords "); else { zone->newzone_data.safe_x = atof(sep->arg[1]); zone->newzone_data.safe_y = atof(sep->arg[2]); @@ -5010,7 +5010,7 @@ void command_freeze(Client *c, const Seperator *sep) if (c->GetTarget() != 0) c->GetTarget()->SendAppearancePacket(AT_Anim, ANIM_FREEZE); else - c->Message(0, "ERROR: Freeze requires a target."); + c->Message(Chat::White, "ERROR: Freeze requires a target."); } void command_unfreeze(Client *c, const Seperator *sep) @@ -5018,7 +5018,7 @@ void command_unfreeze(Client *c, const Seperator *sep) if (c->GetTarget() != 0) c->GetTarget()->SendAppearancePacket(AT_Anim, ANIM_STAND); else - c->Message(0, "ERROR: Unfreeze requires a target."); + c->Message(Chat::White, "ERROR: Unfreeze requires a target."); } void command_push(Client *c, const Seperator *sep) @@ -5028,7 +5028,7 @@ void command_push(Client *c, const Seperator *sep) t = c->GetTarget(); if (!sep->arg[1] || !sep->IsNumber(1)) { - c->Message(0, "ERROR: Must provide at least a push back."); + c->Message(Chat::White, "ERROR: Must provide at least a push back."); return; } @@ -5051,7 +5051,7 @@ void command_push(Client *c, const Seperator *sep) void command_proximity(Client *c, const Seperator *sep) { if (!c->GetTarget() && !c->GetTarget()->IsNPC()) { - c->Message(0, "You must target an NPC"); + c->Message(Chat::White, "You must target an NPC"); return; } @@ -5130,10 +5130,10 @@ void command_pvp(Client *c, const Seperator *sep) if(sep->arg[1][0] != 0) { t->SetPVP(state); - c->Message(0, "%s now follows the ways of %s.", t->GetName(), state?"discord":"order"); + c->Message(Chat::White, "%s now follows the ways of %s.", t->GetName(), state?"discord":"order"); } else - c->Message(0, "Usage: #pvp [on/off]"); + c->Message(Chat::White, "Usage: #pvp [on/off]"); } void command_setxp(Client *c, const Seperator *sep) @@ -5145,12 +5145,12 @@ void command_setxp(Client *c, const Seperator *sep) if (sep->IsNumber(1)) { if (atoi(sep->arg[1]) > 9999999) - c->Message(0, "Error: Value too high."); + c->Message(Chat::White, "Error: Value too high."); else t->AddEXP(atoi(sep->arg[1])); } else - c->Message(0, "Usage: #setxp number"); + c->Message(Chat::White, "Usage: #setxp number"); } void command_setpvppoints(Client *c, const Seperator *sep) @@ -5162,7 +5162,7 @@ void command_setpvppoints(Client *c, const Seperator *sep) if (sep->IsNumber(1)) { if (atoi(sep->arg[1]) > 9999999) - c->Message(0, "Error: Value too high."); + c->Message(Chat::White, "Error: Value too high."); else { t->SetPVPPoints(atoi(sep->arg[1])); @@ -5171,7 +5171,7 @@ void command_setpvppoints(Client *c, const Seperator *sep) } } else - c->Message(0, "Usage: #setpvppoints number"); + c->Message(Chat::White, "Usage: #setpvppoints number"); } void command_name(Client *c, const Seperator *sep) @@ -5179,16 +5179,16 @@ void command_name(Client *c, const Seperator *sep) Client *target; if( (strlen(sep->arg[1]) == 0) || (!(c->GetTarget() && c->GetTarget()->IsClient())) ) - c->Message(0, "Usage: #name newname (requires player target)"); + c->Message(Chat::White, "Usage: #name newname (requires player target)"); else { target = c->GetTarget()->CastToClient(); char *oldname = strdup(target->GetName()); if(target->ChangeFirstName(sep->arg[1], c->GetName())) { - c->Message(0, "Successfully renamed %s to %s", oldname, sep->arg[1]); + c->Message(Chat::White, "Successfully renamed %s to %s", oldname, sep->arg[1]); // until we get the name packet working right this will work - c->Message(0, "Sending player to char select."); + c->Message(Chat::White, "Sending player to char select."); target->Kick("Name was changed"); } else @@ -5203,17 +5203,17 @@ void command_tempname(Client *c, const Seperator *sep) target = c->GetTarget(); if(!target) - c->Message(0, "Usage: #tempname newname (requires a target)"); + c->Message(Chat::White, "Usage: #tempname newname (requires a target)"); else if(strlen(sep->arg[1]) > 0) { char *oldname = strdup(target->GetName()); target->TempName(sep->arg[1]); - c->Message(0, "Renamed %s to %s", oldname, sep->arg[1]); + c->Message(Chat::White, "Renamed %s to %s", oldname, sep->arg[1]); free(oldname); } else { target->TempName(); - c->Message(0, "Restored the original name"); + c->Message(Chat::White, "Restored the original name"); } } @@ -5223,34 +5223,34 @@ void command_petname(Client *c, const Seperator *sep) target = c->GetTarget(); if(!target) - c->Message(0, "Usage: #petname newname (requires a target)"); + c->Message(Chat::White, "Usage: #petname newname (requires a target)"); else if(target->IsPet() && (target->GetOwnerID() == c->GetID()) && strlen(sep->arg[1]) > 0) { char *oldname = strdup(target->GetName()); target->TempName(sep->arg[1]); - c->Message(0, "Renamed %s to %s", oldname, sep->arg[1]); + c->Message(Chat::White, "Renamed %s to %s", oldname, sep->arg[1]); free(oldname); } else { target->TempName(); - c->Message(0, "Restored the original name"); + c->Message(Chat::White, "Restored the original name"); } } void command_npcspecialattk(Client *c, const Seperator *sep) { if (c->GetTarget()==0 || c->GetTarget()->IsClient() || strlen(sep->arg[1]) <= 0 || strlen(sep->arg[2]) <= 0) - c->Message(0, "Usage: #npcspecialattk *flagchar* *permtag* (Flags are E(nrage) F(lurry) R(ampage) S(ummon), permtag is 1 = True, 0 = False)."); + c->Message(Chat::White, "Usage: #npcspecialattk *flagchar* *permtag* (Flags are E(nrage) F(lurry) R(ampage) S(ummon), permtag is 1 = True, 0 = False)."); else { c->GetTarget()->CastToNPC()->NPCSpecialAttacks(sep->arg[1],atoi(sep->arg[2])); - c->Message(0, "NPC Special Attack set."); + c->Message(Chat::White, "NPC Special Attack set."); } } void command_kill(Client *c, const Seperator *sep) { if (!c->GetTarget()) { - c->Message(0, "Error: #Kill: No target."); + c->Message(Chat::White, "Error: #Kill: No target."); } else if (!c->GetTarget()->IsClient() || c->GetTarget()->CastToClient()->Admin() <= c->Admin()) @@ -5310,23 +5310,23 @@ void command_haste(Client *c, const Seperator *sep) c->SetExtraHaste(Haste); // SetAttackTimer must be called to make this take effect, so player needs to change // the primary weapon. - c->Message(0, "Haste set to %d%% - Need to re-equip primary weapon before it takes effect", Haste); + c->Message(Chat::White, "Haste set to %d%% - Need to re-equip primary weapon before it takes effect", Haste); } else - c->Message(0, "Usage: #haste [percentage]"); + c->Message(Chat::White, "Usage: #haste [percentage]"); } void command_damage(Client *c, const Seperator *sep) { if (c->GetTarget()==0) - c->Message(0, "Error: #Damage: No Target."); + c->Message(Chat::White, "Error: #Damage: No Target."); else if (!sep->IsNumber(1)) { - c->Message(0, "Usage: #damage x"); + c->Message(Chat::White, "Usage: #damage x"); } else { int32 nkdmg = atoi(sep->arg[1]); if (nkdmg > 2100000000) - c->Message(0, "Enter a value less then 2,100,000,000."); + c->Message(Chat::White, "Enter a value less then 2,100,000,000."); else c->GetTarget()->Damage(c, nkdmg, SPELL_UNKNOWN, EQEmu::skills::SkillHandtoHand, false); } @@ -5334,7 +5334,7 @@ void command_damage(Client *c, const Seperator *sep) void command_zonespawn(Client *c, const Seperator *sep) { - c->Message(0, "This command is not yet implemented."); + c->Message(Chat::White, "This command is not yet implemented."); return; /* this was kept from client.cpp verbatim (it was commented out) */ @@ -5383,7 +5383,7 @@ void command_npcspawn(Client *c, const Seperator *sep) extra = 1; } database.NPCSpawnDB(0, zone->GetShortName(), zone->GetInstanceVersion(), c, target->CastToNPC(), extra); - c->Message(0, "%s created successfully!", target->GetName()); + c->Message(Chat::White, "%s created successfully!", target->GetName()); } else if (strcasecmp(sep->arg[1], "add") == 0) { if (atoi(sep->arg[2])) @@ -5396,42 +5396,42 @@ void command_npcspawn(Client *c, const Seperator *sep) extra = 1200; } database.NPCSpawnDB(1, zone->GetShortName(), zone->GetInstanceVersion(), c, target->CastToNPC(), extra); - c->Message(0, "%s added successfully!", target->GetName()); + c->Message(Chat::White, "%s added successfully!", target->GetName()); } else if (strcasecmp(sep->arg[1], "update") == 0) { database.NPCSpawnDB(2, zone->GetShortName(), zone->GetInstanceVersion(), c, target->CastToNPC()); - c->Message(0, "%s updated!", target->GetName()); + c->Message(Chat::White, "%s updated!", target->GetName()); } else if (strcasecmp(sep->arg[1], "remove") == 0) { database.NPCSpawnDB(3, zone->GetShortName(), zone->GetInstanceVersion(), c, target->CastToNPC()); - c->Message(0, "%s removed successfully from database!", target->GetName()); + c->Message(Chat::White, "%s removed successfully from database!", target->GetName()); target->Depop(false); } else if (strcasecmp(sep->arg[1], "delete") == 0) { database.NPCSpawnDB(4, zone->GetShortName(), zone->GetInstanceVersion(), c, target->CastToNPC()); - c->Message(0, "%s deleted from database!", target->GetName()); + c->Message(Chat::White, "%s deleted from database!", target->GetName()); target->Depop(false); } else { - c->Message(0, "Error: #npcspawn: Invalid command."); - c->Message(0, "Usage: #npcspawn [create|add|update|remove|delete]"); + c->Message(Chat::White, "Error: #npcspawn: Invalid command."); + c->Message(Chat::White, "Usage: #npcspawn [create|add|update|remove|delete]"); } } else - c->Message(0, "Error: #npcspawn: You must have a NPC targeted!"); + c->Message(Chat::White, "Error: #npcspawn: You must have a NPC targeted!"); } void command_spawnfix(Client *c, const Seperator *sep) { Mob *targetMob = c->GetTarget(); if (!targetMob || !targetMob->IsNPC()) { - c->Message(0, "Error: #spawnfix: Need an NPC target."); + c->Message(Chat::White, "Error: #spawnfix: Need an NPC target."); return; } Spawn2* s2 = targetMob->CastToNPC()->respawn2; if(!s2) { - c->Message(0, "#spawnfix FAILED -- cannot determine which spawn entry in the database this mob came from."); + c->Message(Chat::White, "#spawnfix FAILED -- cannot determine which spawn entry in the database this mob came from."); return; } @@ -5444,7 +5444,7 @@ void command_spawnfix(Client *c, const Seperator *sep) { return; } - c->Message(0, "Updating coordinates successful."); + c->Message(Chat::White, "Updating coordinates successful."); targetMob->Depop(false); } @@ -5452,7 +5452,7 @@ void command_loc(Client *c, const Seperator *sep) { Mob *t=c->GetTarget()?c->GetTarget():c->CastToMob(); - c->Message(0, "%s's Location (XYZ): %1.2f, %1.2f, %1.2f; heading=%1.1f", t->GetName(), t->GetX(), t->GetY(), t->GetZ(), t->GetHeading()); + c->Message(Chat::White, "%s's Location (XYZ): %1.2f, %1.2f, %1.2f; heading=%1.1f", t->GetName(), t->GetX(), t->GetY(), t->GetZ(), t->GetHeading()); } void command_goto(Client *c, const Seperator *sep) @@ -5513,8 +5513,8 @@ void command_goto(Client *c, const Seperator *sep) c->GetHeading()); } else { - c->Message(0, "Usage: #goto [x y z]"); - c->Message(0, "Usage: #goto [player_name]"); + c->Message(Chat::White, "Usage: #goto [x y z]"); + c->Message(Chat::White, "Usage: #goto [player_name]"); } } @@ -5536,41 +5536,41 @@ void command_iteminfo(Client *c, const Seperator *sep) linker.SetLinkType(EQEmu::saylink::SayLinkItemInst); linker.SetItemInst(inst); - c->Message(0, "*** Item Info for [%s] ***", linker.GenerateLink().c_str()); - c->Message(0, ">> ID: %u, ItemUseType: %u, ItemClassType: %u", item->ID, item->ItemType, item->ItemClass); - c->Message(0, ">> IDFile: '%s', IconID: %u", item->IDFile, item->Icon); - c->Message(0, ">> Size: %u, Weight: %u, Price: %u, LDoNPrice: %u", item->Size, item->Weight, item->Price, item->LDoNPrice); - c->Message(0, ">> Material: 0x%02X, Color: 0x%08X, Tint: 0x%08X, Light: 0x%02X", item->Material, item->Color, inst->GetColor(), item->Light); - c->Message(0, ">> IsLore: %s, LoreGroup: %u, Lore: '%s'", (item->LoreFlag ? "TRUE" : "FALSE"), item->LoreGroup, item->Lore); - c->Message(0, ">> NoDrop: %u, NoRent: %u, NoPet: %u, NoTransfer: %u, FVNoDrop: %u", + c->Message(Chat::White, "*** Item Info for [%s] ***", linker.GenerateLink().c_str()); + c->Message(Chat::White, ">> ID: %u, ItemUseType: %u, ItemClassType: %u", item->ID, item->ItemType, item->ItemClass); + c->Message(Chat::White, ">> IDFile: '%s', IconID: %u", item->IDFile, item->Icon); + c->Message(Chat::White, ">> Size: %u, Weight: %u, Price: %u, LDoNPrice: %u", item->Size, item->Weight, item->Price, item->LDoNPrice); + c->Message(Chat::White, ">> Material: 0x%02X, Color: 0x%08X, Tint: 0x%08X, Light: 0x%02X", item->Material, item->Color, inst->GetColor(), item->Light); + c->Message(Chat::White, ">> IsLore: %s, LoreGroup: %u, Lore: '%s'", (item->LoreFlag ? "TRUE" : "FALSE"), item->LoreGroup, item->Lore); + c->Message(Chat::White, ">> NoDrop: %u, NoRent: %u, NoPet: %u, NoTransfer: %u, FVNoDrop: %u", item->NoDrop, item->NoRent, (uint8)item->NoPet, (uint8)item->NoTransfer, item->FVNoDrop); if (item->IsClassBook()) { - c->Message(0, "*** This item is a Book (filename:'%s') ***", item->Filename); + c->Message(Chat::White, "*** This item is a Book (filename:'%s') ***", item->Filename); } else if (item->IsClassBag()) { - c->Message(0, "*** This item is a Container (%u slots) ***", item->BagSlots); + c->Message(Chat::White, "*** This item is a Container (%u slots) ***", item->BagSlots); } else { - c->Message(0, "*** This item is Common ***"); - c->Message(0, ">> Classes: %u, Races: %u, Slots: %u", item->Classes, item->Races, item->Slots); - c->Message(0, ">> ReqSkill: %u, ReqLevel: %u, RecLevel: %u", item->RecSkill, item->ReqLevel, item->RecLevel); - c->Message(0, ">> SkillModType: %u, SkillModValue: %i", item->SkillModType, item->SkillModValue); - c->Message(0, ">> BaneRaceType: %u, BaneRaceDamage: %u, BaneBodyType: %u, BaneBodyDamage: %i", + c->Message(Chat::White, "*** This item is Common ***"); + c->Message(Chat::White, ">> Classes: %u, Races: %u, Slots: %u", item->Classes, item->Races, item->Slots); + c->Message(Chat::White, ">> ReqSkill: %u, ReqLevel: %u, RecLevel: %u", item->RecSkill, item->ReqLevel, item->RecLevel); + c->Message(Chat::White, ">> SkillModType: %u, SkillModValue: %i", item->SkillModType, item->SkillModValue); + c->Message(Chat::White, ">> BaneRaceType: %u, BaneRaceDamage: %u, BaneBodyType: %u, BaneBodyDamage: %i", item->BaneDmgRace, item->BaneDmgRaceAmt, item->BaneDmgBody, item->BaneDmgAmt); - c->Message(0, ">> Magic: %s, SpellID: %i, ProcLevel: %u, Charges: %u, MaxCharges: %u", + c->Message(Chat::White, ">> Magic: %s, SpellID: %i, ProcLevel: %u, Charges: %u, MaxCharges: %u", (item->Magic ? "TRUE" : "FALSE"), item->Click.Effect, item->Click.Level, inst->GetCharges(), item->MaxCharges); - c->Message(0, ">> EffectType: 0x%02X, CastTime: %.2f", (uint8)item->Click.Type, ((double)item->CastTime / 1000)); + c->Message(Chat::White, ">> EffectType: 0x%02X, CastTime: %.2f", (uint8)item->Click.Type, ((double)item->CastTime / 1000)); } if (c->Admin() >= 200) - c->Message(0, ">> MinStatus: %u", item->MinStatus); + c->Message(Chat::White, ">> MinStatus: %u", item->MinStatus); } void command_uptime(Client *c, const Seperator *sep) { if (!worldserver.Connected()) - c->Message(0, "Error: World server disconnected"); + c->Message(Chat::White, "Error: World server disconnected"); else { auto pack = new ServerPacket(ServerOP_Uptime, sizeof(ServerUptime_Struct)); @@ -5588,31 +5588,31 @@ void command_flag(Client *c, const Seperator *sep) if(sep->arg[2][0] == 0) { if (!c->GetTarget() || (c->GetTarget() && c->GetTarget() == c)) { c->UpdateAdmin(); - c->Message(0, "Refreshed your admin flag from DB."); + c->Message(Chat::White, "Refreshed your admin flag from DB."); } else if (c->GetTarget() && c->GetTarget() != c && c->GetTarget()->IsClient()) { c->GetTarget()->CastToClient()->UpdateAdmin(); - c->Message(0, "%s's admin flag has been refreshed.", c->GetTarget()->GetName()); - c->GetTarget()->Message(0, "%s refreshed your admin flag.", c->GetName()); + c->Message(Chat::White, "%s's admin flag has been refreshed.", c->GetTarget()->GetName()); + c->GetTarget()->Message(Chat::White, "%s refreshed your admin flag.", c->GetName()); } } else if (!sep->IsNumber(1) || atoi(sep->arg[1]) < -2 || atoi(sep->arg[1]) > 255 || strlen(sep->arg[2]) == 0) - c->Message(0, "Usage: #flag [status] [acctname]"); + c->Message(Chat::White, "Usage: #flag [status] [acctname]"); else if (c->Admin() < commandChangeFlags) { //this check makes banning players by less than this level //impossible, but i'll leave it in anyways - c->Message(0, "You may only refresh your own flag, doing so now."); + c->Message(Chat::White, "You may only refresh your own flag, doing so now."); c->UpdateAdmin(); } else { if (atoi(sep->arg[1]) > c->Admin()) - c->Message(0, "You cannot set people's status to higher than your own"); + c->Message(Chat::White, "You cannot set people's status to higher than your own"); else if (atoi(sep->arg[1]) < 0 && c->Admin() < commandBanPlayers) - c->Message(0, "You have too low of status to suspend/ban"); + c->Message(Chat::White, "You have too low of status to suspend/ban"); else if (!database.SetAccountStatus(sep->argplus[2], atoi(sep->arg[1]))) - c->Message(0, "Unable to set GM Flag."); + c->Message(Chat::White, "Unable to set GM Flag."); else { - c->Message(0, "Set GM Flag on account."); + c->Message(Chat::White, "Set GM Flag on account."); auto pack = new ServerPacket(ServerOP_FlagUpdate, 6); *((uint32*) pack->pBuffer) = database.GetAccountIDByName(sep->argplus[2]); *((int16*) &pack->pBuffer[4]) = atoi(sep->arg[1]); @@ -5657,14 +5657,14 @@ void command_guild(Client *c, const Seperator *sep) Mob *target=c->GetTarget(); if (strcasecmp(sep->arg[1], "help") == 0) { - c->Message(0, "GM Guild commands:"); - c->Message(0, " #guild list - lists all guilds on the server"); - c->Message(0, " #guild create {guildleader charname or CharID} guildname"); - c->Message(0, " #guild delete guildID"); - c->Message(0, " #guild rename guildID newname"); - c->Message(0, " #guild set charname guildID (0=no guild)"); - c->Message(0, " #guild setrank charname rank"); - c->Message(0, " #guild setleader guildID {guildleader charname or CharID}"); + c->Message(Chat::White, "GM Guild commands:"); + c->Message(Chat::White, " #guild list - lists all guilds on the server"); + c->Message(Chat::White, " #guild create {guildleader charname or CharID} guildname"); + c->Message(Chat::White, " #guild delete guildID"); + c->Message(Chat::White, " #guild rename guildID newname"); + c->Message(Chat::White, " #guild set charname guildID (0=no guild)"); + c->Message(Chat::White, " #guild setrank charname rank"); + c->Message(Chat::White, " #guild setleader guildID {guildleader charname or CharID}"); } else if (strcasecmp(sep->arg[1], "status") == 0 || strcasecmp(sep->arg[1], "stat") == 0) { Client* client = 0; @@ -5673,24 +5673,24 @@ void command_guild(Client *c, const Seperator *sep) else if (target != 0 && target->IsClient()) client = target->CastToClient(); if (client == 0) - c->Message(0, "You must target someone or specify a character name"); + c->Message(Chat::White, "You must target someone or specify a character name"); else if ((client->Admin() >= minStatusToEditOtherGuilds && admin < minStatusToEditOtherGuilds) && client->GuildID() != c->GuildID()) // no peeping for GMs, make sure tell message stays the same - c->Message(0, "You must target someone or specify a character name."); + c->Message(Chat::White, "You must target someone or specify a character name."); else { if (client->IsInAGuild()) - c->Message(0, "%s is not in a guild.", client->GetName()); + c->Message(Chat::White, "%s is not in a guild.", client->GetName()); else if (guild_mgr.IsGuildLeader(client->GuildID(), client->CharacterID())) - c->Message(0, "%s is the leader of <%s> rank: %s", client->GetName(), guild_mgr.GetGuildName(client->GuildID()), guild_mgr.GetRankName(client->GuildID(), client->GuildRank())); + c->Message(Chat::White, "%s is the leader of <%s> rank: %s", client->GetName(), guild_mgr.GetGuildName(client->GuildID()), guild_mgr.GetRankName(client->GuildID(), client->GuildRank())); else - c->Message(0, "%s is a member of <%s> rank: %s", client->GetName(), guild_mgr.GetGuildName(client->GuildID()), guild_mgr.GetRankName(client->GuildID(), client->GuildRank())); + c->Message(Chat::White, "%s is a member of <%s> rank: %s", client->GetName(), guild_mgr.GetGuildName(client->GuildID()), guild_mgr.GetRankName(client->GuildID(), client->GuildRank())); } } else if (strcasecmp(sep->arg[1], "info") == 0) { if (sep->arg[2][0] == 0 && c->IsInAGuild()) { if (admin >= minStatusToEditOtherGuilds) - c->Message(0, "Usage: #guildinfo guild_id"); + c->Message(Chat::White, "Usage: #guildinfo guild_id"); else - c->Message(0, "You're not in a guild"); + c->Message(Chat::White, "You're not in a guild"); } else { uint32 tmp = GUILD_NONE; @@ -5706,19 +5706,19 @@ void command_guild(Client *c, const Seperator *sep) /* else if (strcasecmp(sep->arg[1], "edit") == 0) { if (c->GuildDBID() == 0) - c->Message(0, "You arent in a guild!"); + c->Message(Chat::White, "You arent in a guild!"); else if (!sep->IsNumber(2)) - c->Message(0, "Error: invalid rank #."); + c->Message(Chat::White, "Error: invalid rank #."); else if (atoi(sep->arg[2]) < 0 || atoi(sep->arg[2]) > GUILD_MAX_RANK) - c->Message(0, "Error: invalid rank #."); + c->Message(Chat::White, "Error: invalid rank #."); else if (!c->GuildRank() == 0) - c->Message(0, "You must be rank %s to use edit.", guilds[c->GuildEQID()].rank[0].rankname); + c->Message(Chat::White, "You must be rank %s to use edit.", guilds[c->GuildEQID()].rank[0].rankname); else if (!worldserver.Connected()) - c->Message(0, "Error: World server dirconnected"); + c->Message(Chat::White, "Error: World server dirconnected"); else { if (!helper_guild_edit(c, c->GuildDBID(), c->GuildEQID(), atoi(sep->arg[2]), sep->arg[3], sep->argplus[4])) { - c->Message(0, " #guild edit rank title newtitle"); - c->Message(0, " #guild edit rank permission 0/1"); + c->Message(Chat::White, " #guild edit rank title newtitle"); + c->Message(Chat::White, " #guild edit rank permission 0/1"); } else { ServerPacket* pack = new ServerPacket(ServerOP_RefreshGuild, 5); @@ -5731,20 +5731,20 @@ void command_guild(Client *c, const Seperator *sep) } else if (strcasecmp(sep->arg[1], "gmedit") == 0 && admin >= 100) { if (!sep->IsNumber(2)) - c->Message(0, "Error: invalid guilddbid."); + c->Message(Chat::White, "Error: invalid guilddbid."); else if (!sep->IsNumber(3)) - c->Message(0, "Error: invalid rank #."); + c->Message(Chat::White, "Error: invalid rank #."); else if (atoi(sep->arg[3]) < 0 || atoi(sep->arg[3]) > GUILD_MAX_RANK) - c->Message(0, "Error: invalid rank #."); + c->Message(Chat::White, "Error: invalid rank #."); else if (!worldserver.Connected()) - c->Message(0, "Error: World server dirconnected"); + c->Message(Chat::White, "Error: World server dirconnected"); else { uint32 eqid = database.GetGuildEQID(atoi(sep->arg[2])); if (eqid == GUILD_NONE) - c->Message(0, "Error: Guild not found"); + c->Message(Chat::White, "Error: Guild not found"); else if (!helper_guild_edit(c, atoi(sep->arg[2]), eqid, atoi(sep->arg[3]), sep->arg[4], sep->argplus[5])) { - c->Message(0, " #guild gmedit guilddbid rank title newtitle"); - c->Message(0, " #guild gmedit guilddbid rank permission 0/1"); + c->Message(Chat::White, " #guild gmedit guilddbid rank title newtitle"); + c->Message(Chat::White, " #guild gmedit guilddbid rank permission 0/1"); } else { ServerPacket* pack = new ServerPacket(ServerOP_RefreshGuild, 5); @@ -5757,7 +5757,7 @@ void command_guild(Client *c, const Seperator *sep) */ else if (strcasecmp(sep->arg[1], "set") == 0) { if (!sep->IsNumber(3)) - c->Message(0, "Usage: #guild set charname guildgbid (0 = clear guildtag)"); + c->Message(Chat::White, "Usage: #guild set charname guildgbid (0 = clear guildtag)"); else { uint32 guild_id = atoi(sep->arg[3]); @@ -5792,24 +5792,24 @@ void command_guild(Client *c, const Seperator *sep) if(!guild_mgr.SetGuild(charid, guild_id, GUILD_MEMBER)) { c->Message(Chat::Red, "Error putting '%s' into guild %d", sep->arg[2], guild_id); } else { - c->Message(0, "%s has been put into guild %d", sep->arg[2], guild_id); + c->Message(Chat::White, "%s has been put into guild %d", sep->arg[2], guild_id); } } } /*else if (strcasecmp(sep->arg[1], "setdoor") == 0 && admin >= minStatusToEditOtherGuilds) { if (!sep->IsNumber(2)) - c->Message(0, "Usage: #guild setdoor guildEQid (0 = delete guilddoor)"); + c->Message(Chat::White, "Usage: #guild setdoor guildEQid (0 = delete guilddoor)"); else { // guild doors if((!guilds[atoi(sep->arg[2])].databaseID) && (atoi(sep->arg[2])!=0) ) { - c->Message(0, "These is no guild with this guildEQid"); + c->Message(Chat::White, "These is no guild with this guildEQid"); } else { c->SetIsSettingGuildDoor(true); - c->Message(0, "Click on a door you want to become a guilddoor"); + c->Message(Chat::White, "Click on a door you want to become a guilddoor"); c->SetSetGuildDoorID(atoi(sep->arg[2])); } } @@ -5817,9 +5817,9 @@ void command_guild(Client *c, const Seperator *sep) else if (strcasecmp(sep->arg[1], "setrank") == 0) { int rank = atoi(sep->arg[3]); if (!sep->IsNumber(3)) - c->Message(0, "Usage: #guild setrank charname rank"); + c->Message(Chat::White, "Usage: #guild setrank charname rank"); else if (rank < 0 || rank > GUILD_MAX_RANK) - c->Message(0, "Error: invalid rank #."); + c->Message(Chat::White, "Error: invalid rank #."); else { uint32 charid = database.GetCharacterID(sep->arg[2]); if(charid == 0) { @@ -5839,14 +5839,14 @@ void command_guild(Client *c, const Seperator *sep) if(!guild_mgr.SetGuildRank(charid, rank)) c->Message(Chat::Red, "Error while setting rank %d on '%s'.", rank, sep->arg[2]); else - c->Message(0, "%s has been set to rank %d", sep->arg[2], rank); + c->Message(Chat::White, "%s has been set to rank %d", sep->arg[2], rank); } } else if (strcasecmp(sep->arg[1], "create") == 0) { if (sep->arg[3][0] == 0) - c->Message(0, "Usage: #guild create {guildleader charname or CharID} guild name"); + c->Message(Chat::White, "Usage: #guild create {guildleader charname or CharID} guild name"); else if (!worldserver.Connected()) - c->Message(0, "Error: World server dirconnected"); + c->Message(Chat::White, "Error: World server dirconnected"); else { uint32 leader = 0; if (sep->IsNumber(2)) { @@ -5858,13 +5858,13 @@ void command_guild(Client *c, const Seperator *sep) return; } if (leader == 0) { - c->Message(0, "Guild leader not found."); + c->Message(Chat::White, "Guild leader not found."); return; } uint32 tmp = guild_mgr.FindGuildByLeader(leader); if (tmp != GUILD_NONE) { - c->Message(0, "Error: %s already is the leader of DB# %i '%s'.", sep->arg[2], tmp, guild_mgr.GetGuildName(tmp)); + c->Message(Chat::White, "Error: %s already is the leader of DB# %i '%s'.", sep->arg[2], tmp, guild_mgr.GetGuildName(tmp)); } else { @@ -5879,12 +5879,12 @@ void command_guild(Client *c, const Seperator *sep) sep->argplus[3], leader, (unsigned long)id); if (id == GUILD_NONE) - c->Message(0, "Guild creation failed."); + c->Message(Chat::White, "Guild creation failed."); else { - c->Message(0, "Guild created: Leader: %i, number %i: %s", leader, id, sep->argplus[3]); + c->Message(Chat::White, "Guild created: Leader: %i, number %i: %s", leader, id, sep->argplus[3]); if(!guild_mgr.SetGuild(leader, id, GUILD_LEADER)) - c->Message(0, "Unable to set guild leader's guild in the database. Your going to have to run #guild set"); + c->Message(Chat::White, "Unable to set guild leader's guild in the database. Your going to have to run #guild set"); } } @@ -5892,14 +5892,14 @@ void command_guild(Client *c, const Seperator *sep) } else if (strcasecmp(sep->arg[1], "delete") == 0) { if (!sep->IsNumber(2)) - c->Message(0, "Usage: #guild delete guildID"); + c->Message(Chat::White, "Usage: #guild delete guildID"); else if (!worldserver.Connected()) - c->Message(0, "Error: World server dirconnected"); + c->Message(Chat::White, "Error: World server dirconnected"); else { uint32 id = atoi(sep->arg[2]); if(!guild_mgr.GuildExists(id)) { - c->Message(0, "Guild %d does not exist!", id); + c->Message(Chat::White, "Guild %d does not exist!", id); return; } @@ -5918,22 +5918,22 @@ void command_guild(Client *c, const Seperator *sep) guild_mgr.GetGuildName(id), id); if (!guild_mgr.DeleteGuild(id)) - c->Message(0, "Guild delete failed."); + c->Message(Chat::White, "Guild delete failed."); else { - c->Message(0, "Guild %d deleted.", id); + c->Message(Chat::White, "Guild %d deleted.", id); } } } else if (strcasecmp(sep->arg[1], "rename") == 0) { if ((!sep->IsNumber(2)) || sep->arg[3][0] == 0) - c->Message(0, "Usage: #guild rename guildID newname"); + c->Message(Chat::White, "Usage: #guild rename guildID newname"); else if (!worldserver.Connected()) - c->Message(0, "Error: World server dirconnected"); + c->Message(Chat::White, "Error: World server dirconnected"); else { uint32 id = atoi(sep->arg[2]); if(!guild_mgr.GuildExists(id)) { - c->Message(0, "Guild %d does not exist!", id); + c->Message(Chat::White, "Guild %d does not exist!", id); return; } @@ -5952,17 +5952,17 @@ void command_guild(Client *c, const Seperator *sep) guild_mgr.GetGuildName(id), id, sep->argplus[3]); if (!guild_mgr.RenameGuild(id, sep->argplus[3])) - c->Message(0, "Guild rename failed."); + c->Message(Chat::White, "Guild rename failed."); else { - c->Message(0, "Guild %d renamed to %s", id, sep->argplus[3]); + c->Message(Chat::White, "Guild %d renamed to %s", id, sep->argplus[3]); } } } else if (strcasecmp(sep->arg[1], "setleader") == 0) { if (sep->arg[3][0] == 0 || !sep->IsNumber(2)) - c->Message(0, "Usage: #guild setleader guild_id {guildleader charname or CharID}"); + c->Message(Chat::White, "Usage: #guild setleader guild_id {guildleader charname or CharID}"); else if (!worldserver.Connected()) - c->Message(0, "Error: World server dirconnected"); + c->Message(Chat::White, "Error: World server dirconnected"); else { uint32 leader = 0; if (sep->IsNumber(2)) { @@ -5976,15 +5976,15 @@ void command_guild(Client *c, const Seperator *sep) uint32 tmpdb = guild_mgr.FindGuildByLeader(leader); if (leader == 0) - c->Message(0, "New leader not found."); + c->Message(Chat::White, "New leader not found."); else if (tmpdb != 0) { - c->Message(0, "Error: %s already is the leader of guild # %i", sep->arg[2], tmpdb); + c->Message(Chat::White, "Error: %s already is the leader of guild # %i", sep->arg[2], tmpdb); } else { uint32 id = atoi(sep->arg[2]); if(!guild_mgr.GuildExists(id)) { - c->Message(0, "Guild %d does not exist!", id); + c->Message(Chat::White, "Guild %d does not exist!", id); return; } @@ -6003,9 +6003,9 @@ void command_guild(Client *c, const Seperator *sep) guild_mgr.GetGuildName(id), id, leader); if(!guild_mgr.SetGuildLeader(id, leader)) - c->Message(0, "Guild leader change failed."); + c->Message(Chat::White, "Guild leader change failed."); else { - c->Message(0, "Guild leader changed: guild # %d, Leader: %s", id, sep->argplus[3]); + c->Message(Chat::White, "Guild leader changed: guild # %d, Leader: %s", id, sep->argplus[3]); } } } @@ -6018,7 +6018,7 @@ void command_guild(Client *c, const Seperator *sep) guild_mgr.ListGuilds(c); } else { - c->Message(0, "Unknown guild command, try #guild help"); + c->Message(Chat::White, "Unknown guild command, try #guild help"); } } /* @@ -6036,12 +6036,12 @@ bool helper_guild_edit(Client *c, uint32 dbid, uint32 eqid, uint8 rank, const ch if (strcasecmp(what, "title") == 0) { if (strlen(value) > 100) - c->Message(0, "Error: Title has a maxium length of 100 characters."); + c->Message(Chat::White, "Error: Title has a maxium length of 100 characters."); else strcpy(grl.rankname, value); } else if (rank == 0) - c->Message(0, "Error: Rank 0's permissions can not be changed."); + c->Message(Chat::White, "Error: Rank 0's permissions can not be changed."); else { if (!(strlen(value) == 1 && (value[0] == '0' || value[0] == '1'))) @@ -6064,17 +6064,17 @@ bool helper_guild_edit(Client *c, uint32 dbid, uint32 eqid, uint8 rank, const ch else if (strcasecmp(what, "warpeace") == 0) grl.warpeace = (value[0] == '1'); else - c->Message(0, "Error: Permission name not recognized."); + c->Message(Chat::White, "Error: Permission name not recognized."); } if (!database.EditGuild(dbid, rank, &grl)) - c->Message(0, "Error: database.EditGuild() failed"); + c->Message(Chat::White, "Error: database.EditGuild() failed"); return true; }*/ void command_zonestatus(Client *c, const Seperator *sep) { if (!worldserver.Connected()) - c->Message(0, "Error: World server disconnected"); + c->Message(Chat::White, "Error: World server disconnected"); else { auto pack = new ServerPacket(ServerOP_ZoneStatus, strlen(c->GetName()) + 2); memset(pack->pBuffer, (uint8) c->Admin(), 1); @@ -6087,11 +6087,11 @@ void command_zonestatus(Client *c, const Seperator *sep) void command_doanim(Client *c, const Seperator *sep) { if (!sep->IsNumber(1)) - c->Message(0, "Usage: #DoAnim [number]"); + c->Message(Chat::White, "Usage: #DoAnim [number]"); else if (c->Admin() >= commandDoAnimOthers) if (c->GetTarget() == 0) - c->Message(0, "Error: You need a target."); + c->Message(Chat::White, "Error: You need a target."); else c->GetTarget()->DoAnim(atoi(sep->arg[1]),atoi(sep->arg[2])); else @@ -6102,13 +6102,13 @@ void command_randomfeatures(Client *c, const Seperator *sep) { Mob *target=c->GetTarget(); if (!target) - c->Message(0,"Error: This command requires a target"); + c->Message(Chat::White,"Error: This command requires a target"); else { if (target->RandomizeFeatures()) - c->Message(0,"Features Randomized"); + c->Message(Chat::White,"Features Randomized"); else - c->Message(0,"This command requires a Playable Race as the target"); + c->Message(Chat::White,"This command requires a Playable Race as the target"); } } @@ -6116,9 +6116,9 @@ void command_face(Client *c, const Seperator *sep) { Mob *target=c->GetTarget(); if (!sep->IsNumber(1)) - c->Message(0,"Usage: #face [number of face]"); + c->Message(Chat::White,"Usage: #face [number of face]"); else if (!target) - c->Message(0,"Error: this command requires a target"); + c->Message(Chat::White,"Error: this command requires a target"); else { uint16 Race = target->GetRace(); uint8 Gender = target->GetGender(); @@ -6139,14 +6139,14 @@ void command_face(Client *c, const Seperator *sep) EyeColor1, EyeColor2, HairStyle, LuclinFace, Beard, 0xFF, DrakkinHeritage, DrakkinTattoo, DrakkinDetails); - c->Message(0,"Face = %i", atoi(sep->arg[1])); + c->Message(Chat::White,"Face = %i", atoi(sep->arg[1])); } } void command_findaliases(Client *c, const Seperator *sep) { if (!sep->arg[1][0]) { - c->Message(0, "Usage: #findaliases [alias | command]"); + c->Message(Chat::White, "Usage: #findaliases [alias | command]"); return; } @@ -6158,30 +6158,30 @@ void command_findaliases(Client *c, const Seperator *sep) auto command_iter = commandlist.find(find_iter->second); if (find_iter->second.empty() || command_iter == commandlist.end()) { - c->Message(0, "An unknown condition occurred..."); + c->Message(Chat::White, "An unknown condition occurred..."); return; } - c->Message(0, "Available command aliases for '%s':", command_iter->first.c_str()); + c->Message(Chat::White, "Available command aliases for '%s':", command_iter->first.c_str()); int commandaliasesshown = 0; for (auto alias_iter = commandaliases.begin(); alias_iter != commandaliases.end(); ++alias_iter) { if (strcasecmp(find_iter->second.c_str(), alias_iter->second.c_str()) || c->Admin() < command_iter->second->access) continue; - c->Message(0, "%c%s", COMMAND_CHAR, alias_iter->first.c_str()); + c->Message(Chat::White, "%c%s", COMMAND_CHAR, alias_iter->first.c_str()); ++commandaliasesshown; } - c->Message(0, "%d command alias%s listed.", commandaliasesshown, commandaliasesshown != 1 ? "es" : ""); + c->Message(Chat::White, "%d command alias%s listed.", commandaliasesshown, commandaliasesshown != 1 ? "es" : ""); } void command_details(Client *c, const Seperator *sep) { Mob *target=c->GetTarget(); if (!sep->IsNumber(1)) - c->Message(0,"Usage: #details [number of drakkin detail]"); + c->Message(Chat::White,"Usage: #details [number of drakkin detail]"); else if (!target) - c->Message(0,"Error: this command requires a target"); + c->Message(Chat::White,"Error: this command requires a target"); else { uint16 Race = target->GetRace(); uint8 Gender = target->GetGender(); @@ -6202,7 +6202,7 @@ void command_details(Client *c, const Seperator *sep) EyeColor1, EyeColor2, HairStyle, LuclinFace, Beard, 0xFF, DrakkinHeritage, DrakkinTattoo, DrakkinDetails); - c->Message(0,"Details = %i", atoi(sep->arg[1])); + c->Message(Chat::White,"Details = %i", atoi(sep->arg[1])); } } @@ -6210,9 +6210,9 @@ void command_heritage(Client *c, const Seperator *sep) { Mob *target=c->GetTarget(); if (!sep->IsNumber(1)) - c->Message(0,"Usage: #heritage [number of Drakkin heritage]"); + c->Message(Chat::White,"Usage: #heritage [number of Drakkin heritage]"); else if (!target) - c->Message(0,"Error: this command requires a target"); + c->Message(Chat::White,"Error: this command requires a target"); else { uint16 Race = target->GetRace(); uint8 Gender = target->GetGender(); @@ -6233,7 +6233,7 @@ void command_heritage(Client *c, const Seperator *sep) EyeColor1, EyeColor2, HairStyle, LuclinFace, Beard, 0xFF, DrakkinHeritage, DrakkinTattoo, DrakkinDetails); - c->Message(0,"Heritage = %i", atoi(sep->arg[1])); + c->Message(Chat::White,"Heritage = %i", atoi(sep->arg[1])); } } @@ -6241,9 +6241,9 @@ void command_tattoo(Client *c, const Seperator *sep) { Mob *target=c->GetTarget(); if (!sep->IsNumber(1)) - c->Message(0,"Usage: #tattoo [number of Drakkin tattoo]"); + c->Message(Chat::White,"Usage: #tattoo [number of Drakkin tattoo]"); else if (!target) - c->Message(0,"Error: this command requires a target"); + c->Message(Chat::White,"Error: this command requires a target"); else { uint16 Race = target->GetRace(); uint8 Gender = target->GetGender(); @@ -6264,7 +6264,7 @@ void command_tattoo(Client *c, const Seperator *sep) EyeColor1, EyeColor2, HairStyle, LuclinFace, Beard, 0xFF, DrakkinHeritage, DrakkinTattoo, DrakkinDetails); - c->Message(0,"Tattoo = %i", atoi(sep->arg[1])); + c->Message(Chat::White,"Tattoo = %i", atoi(sep->arg[1])); } } @@ -6272,9 +6272,9 @@ void command_helm(Client *c, const Seperator *sep) { Mob *target=c->GetTarget(); if (!sep->IsNumber(1)) - c->Message(0,"Usage: #helm [number of helm texture]"); + c->Message(Chat::White,"Usage: #helm [number of helm texture]"); else if (!target) - c->Message(0,"Error: this command requires a target"); + c->Message(Chat::White,"Error: this command requires a target"); else { uint16 Race = target->GetRace(); uint8 Gender = target->GetGender(); @@ -6295,7 +6295,7 @@ void command_helm(Client *c, const Seperator *sep) EyeColor1, EyeColor2, HairStyle, LuclinFace, Beard, 0xFF, DrakkinHeritage, DrakkinTattoo, DrakkinDetails); - c->Message(0,"Helm = %i", atoi(sep->arg[1])); + c->Message(Chat::White,"Helm = %i", atoi(sep->arg[1])); } } @@ -6303,9 +6303,9 @@ void command_hair(Client *c, const Seperator *sep) { Mob *target=c->GetTarget(); if (!sep->IsNumber(1)) - c->Message(0,"Usage: #hair [number of hair style]"); + c->Message(Chat::White,"Usage: #hair [number of hair style]"); else if (!target) - c->Message(0,"Error: this command requires a target"); + c->Message(Chat::White,"Error: this command requires a target"); else { uint16 Race = target->GetRace(); uint8 Gender = target->GetGender(); @@ -6326,7 +6326,7 @@ void command_hair(Client *c, const Seperator *sep) EyeColor1, EyeColor2, HairStyle, LuclinFace, Beard, 0xFF, DrakkinHeritage, DrakkinTattoo, DrakkinDetails); - c->Message(0,"Hair = %i", atoi(sep->arg[1])); + c->Message(Chat::White,"Hair = %i", atoi(sep->arg[1])); } } @@ -6334,9 +6334,9 @@ void command_haircolor(Client *c, const Seperator *sep) { Mob *target=c->GetTarget(); if (!sep->IsNumber(1)) - c->Message(0,"Usage: #haircolor [number of hair color]"); + c->Message(Chat::White,"Usage: #haircolor [number of hair color]"); else if (!target) - c->Message(0,"Error: this command requires a target"); + c->Message(Chat::White,"Error: this command requires a target"); else { uint16 Race = target->GetRace(); uint8 Gender = target->GetGender(); @@ -6357,7 +6357,7 @@ void command_haircolor(Client *c, const Seperator *sep) EyeColor1, EyeColor2, HairStyle, LuclinFace, Beard, 0xFF, DrakkinHeritage, DrakkinTattoo, DrakkinDetails); - c->Message(0,"Hair Color = %i", atoi(sep->arg[1])); + c->Message(Chat::White,"Hair Color = %i", atoi(sep->arg[1])); } } @@ -6365,9 +6365,9 @@ void command_beard(Client *c, const Seperator *sep) { Mob *target=c->GetTarget(); if (!sep->IsNumber(1)) - c->Message(0,"Usage: #beard [number of beard style]"); + c->Message(Chat::White,"Usage: #beard [number of beard style]"); else if (!target) - c->Message(0,"Error: this command requires a target"); + c->Message(Chat::White,"Error: this command requires a target"); else { uint16 Race = target->GetRace(); uint8 Gender = target->GetGender(); @@ -6388,7 +6388,7 @@ void command_beard(Client *c, const Seperator *sep) EyeColor1, EyeColor2, HairStyle, LuclinFace, Beard, 0xFF, DrakkinHeritage, DrakkinTattoo, DrakkinDetails); - c->Message(0,"Beard = %i", atoi(sep->arg[1])); + c->Message(Chat::White,"Beard = %i", atoi(sep->arg[1])); } } @@ -6396,9 +6396,9 @@ void command_beardcolor(Client *c, const Seperator *sep) { Mob *target=c->GetTarget(); if (!sep->IsNumber(1)) - c->Message(0,"Usage: #beardcolor [number of beard color]"); + c->Message(Chat::White,"Usage: #beardcolor [number of beard color]"); else if (!target) - c->Message(0,"Error: this command requires a target"); + c->Message(Chat::White,"Error: this command requires a target"); else { uint16 Race = target->GetRace(); uint8 Gender = target->GetGender(); @@ -6419,7 +6419,7 @@ void command_beardcolor(Client *c, const Seperator *sep) EyeColor1, EyeColor2, HairStyle, LuclinFace, Beard, 0xFF, DrakkinHeritage, DrakkinTattoo, DrakkinDetails); - c->Message(0,"Beard Color = %i", atoi(sep->arg[1])); + c->Message(Chat::White,"Beard Color = %i", atoi(sep->arg[1])); } } @@ -6430,7 +6430,7 @@ void command_scribespells(Client *c, const Seperator *sep) t = c->GetTarget()->CastToClient(); if(sep->argnum < 1 || !sep->IsNumber(1)) { - c->Message(0, "FORMAT: #scribespells "); + c->Message(Chat::White, "FORMAT: #scribespells "); return; } @@ -6443,17 +6443,17 @@ void command_scribespells(Client *c, const Seperator *sep) min_level = (uint8)RuleI(Character, MaxLevel); // default to Character:MaxLevel if we're not a GM & it's higher than the max level if(max_level < 1 || min_level < 1) { - c->Message(0, "ERROR: Level must be greater than 1."); + c->Message(Chat::White, "ERROR: Level must be greater than 1."); return; } if (min_level > max_level) { - c->Message(0, "ERROR: Min Level must be less than or equal to Max Level."); + c->Message(Chat::White, "ERROR: Min Level must be less than or equal to Max Level."); return; } - t->Message(0, "Scribing spells to spellbook."); + t->Message(Chat::White, "Scribing spells to spellbook."); if(t != c) - c->Message(0, "Scribing spells for %s.", t->GetName()); + c->Message(Chat::White, "Scribing spells for %s.", t->GetName()); Log(Logs::General, Logs::Normal, "Scribe spells request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); int book_slot = t->GetNextAvailableSpellBookSlot(); @@ -6516,14 +6516,14 @@ void command_scribespells(Client *c, const Seperator *sep) } if (count > 0) { - t->Message(0, "Successfully scribed %i spells.", count); + t->Message(Chat::White, "Successfully scribed %i spells.", count); if (t != c) - c->Message(0, "Successfully scribed %i spells for %s.", count, t->GetName()); + c->Message(Chat::White, "Successfully scribed %i spells for %s.", count, t->GetName()); } else { - t->Message(0, "No spells scribed."); + t->Message(Chat::White, "No spells scribed."); if (t != c) - c->Message(0, "No spells scribed for %s.", t->GetName()); + c->Message(Chat::White, "No spells scribed for %s.", t->GetName()); } } @@ -6536,17 +6536,17 @@ void command_scribespell(Client *c, const Seperator *sep) { t=c->GetTarget()->CastToClient(); if(!sep->arg[1][0]) { - c->Message(0, "FORMAT: #scribespell "); + c->Message(Chat::White, "FORMAT: #scribespell "); return; } spell_id = atoi(sep->arg[1]); if(IsValidSpell(spell_id)) { - t->Message(0, "Scribing spell: %s (%i) to spellbook.", spells[spell_id].name, spell_id); + t->Message(Chat::White, "Scribing spell: %s (%i) to spellbook.", spells[spell_id].name, spell_id); if(t != c) - c->Message(0, "Scribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); + c->Message(Chat::White, "Scribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); Log(Logs::General, Logs::Normal, "Scribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); @@ -6578,7 +6578,7 @@ void command_unscribespell(Client *c, const Seperator *sep) { t=c->GetTarget()->CastToClient(); if(!sep->arg[1][0]) { - c->Message(0, "FORMAT: #unscribespell "); + c->Message(Chat::White, "FORMAT: #unscribespell "); return; } @@ -6590,10 +6590,10 @@ void command_unscribespell(Client *c, const Seperator *sep) { if(book_slot >= 0) { t->UnscribeSpell(book_slot); - t->Message(0, "Unscribing spell: %s (%i) from spellbook.", spells[spell_id].name, spell_id); + t->Message(Chat::White, "Unscribing spell: %s (%i) from spellbook.", spells[spell_id].name, spell_id); if(t != c) - c->Message(0, "Unscribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); + c->Message(Chat::White, "Unscribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); Log(Logs::General, Logs::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); } @@ -6642,7 +6642,7 @@ void command_wpinfo(Client *c, const Seperator *sep) Mob *t=c->GetTarget(); if (t == nullptr || !t->IsNPC()) { - c->Message(0,"You must target an NPC to use this."); + c->Message(Chat::White,"You must target an NPC to use this."); return; } @@ -6663,7 +6663,7 @@ void command_wpadd(Client *c, const Seperator *sep) if(s2info == nullptr) // Can't figure out where this mob's spawn came from... maybe a dynamic mob created by #spawn { - c->Message(0,"#wpadd FAILED -- Can't determine which spawn record in the database this mob came from!"); + c->Message(Chat::White,"#wpadd FAILED -- Can't determine which spawn record in the database this mob came from!"); return; } @@ -6673,7 +6673,7 @@ void command_wpadd(Client *c, const Seperator *sep) pause=atoi(sep->arg[1]); else { - c->Message(0,"Usage: #wpadd [pause] [-h]"); + c->Message(Chat::White,"Usage: #wpadd [pause] [-h]"); return; } } @@ -6686,10 +6686,10 @@ void command_wpadd(Client *c, const Seperator *sep) t->CastToNPC()->SetGrid(tmp_grid); t->CastToNPC()->AssignWaypoints(t->CastToNPC()->GetGrid()); - c->Message(0,"Waypoint added. Use #wpinfo to see waypoints for this NPC (may need to #repop first)."); + c->Message(Chat::White,"Waypoint added. Use #wpinfo to see waypoints for this NPC (may need to #repop first)."); } else - c->Message(0,"You must target an NPC to use this."); + c->Message(Chat::White,"You must target an NPC to use this."); } @@ -6718,14 +6718,14 @@ void command_summonitem(Client *c, const Seperator *sep) itemid = link_body.item_id; } else if (!sep->IsNumber(1)) { - c->Message(0, "Usage: #summonitem [item id | link] [charges], charges are optional"); + c->Message(Chat::White, "Usage: #summonitem [item id | link] [charges], charges are optional"); return; } else { itemid = atoi(sep->arg[1]); } if (!itemid) { - c->Message(0, "A valid item id number is required (derived: 0)"); + c->Message(Chat::White, "A valid item id number is required (derived: 0)"); return; } @@ -6810,14 +6810,14 @@ void command_givemoney(Client *c, const Seperator *sep) else { //TODO: update this to the client, otherwise the client doesn't show any weight change until you zone, move an item, etc c->GetTarget()->CastToClient()->AddMoneyToPP(atoi(sep->arg[4]), atoi(sep->arg[3]), atoi(sep->arg[2]), atoi(sep->arg[1]), true); - c->Message(0, "Added %i Platinum, %i Gold, %i Silver, and %i Copper to %s's inventory.", atoi(sep->arg[1]), atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), c->GetTarget()->GetName()); + c->Message(Chat::White, "Added %i Platinum, %i Gold, %i Silver, and %i Copper to %s's inventory.", atoi(sep->arg[1]), atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), c->GetTarget()->GetName()); } } void command_itemsearch(Client *c, const Seperator *sep) { if (sep->arg[1][0] == 0) - c->Message(0, "Usage: #itemsearch [search string]"); + c->Message(Chat::White, "Usage: #itemsearch [search string]"); else { const char *search_criteria=sep->argplus[1]; @@ -6831,10 +6831,10 @@ void command_itemsearch(Client *c, const Seperator *sep) if (item) { linker.SetItemData(item); - c->Message(0, "%u: %s", item->ID, linker.GenerateLink().c_str()); + c->Message(Chat::White, "%u: %s", item->ID, linker.GenerateLink().c_str()); } else { - c->Message(0, "Item #%s not found", search_criteria); + c->Message(Chat::White, "Item #%s not found", search_criteria); } return; @@ -6854,7 +6854,7 @@ void command_itemsearch(Client *c, const Seperator *sep) if (pdest != nullptr) { linker.SetItemData(item); - c->Message(0, "%u: %s", item->ID, linker.GenerateLink().c_str()); + c->Message(Chat::White, "%u: %s", item->ID, linker.GenerateLink().c_str()); ++count; } @@ -6864,9 +6864,9 @@ void command_itemsearch(Client *c, const Seperator *sep) } if (count == 50) - c->Message(0, "50 items shown...too many results."); + c->Message(Chat::White, "50 items shown...too many results."); else - c->Message(0, "%i items found", count); + c->Message(Chat::White, "%i items found", count); } } @@ -6884,7 +6884,7 @@ void command_setaaxp(Client *c, const Seperator *sep) t->SetLeadershipEXP(atoi(sep->arg[2]), atoi(sep->arg[3])); } } else - c->Message(0, "Usage: #setaaxp ( )"); + c->Message(Chat::White, "Usage: #setaaxp ( )"); } void command_setaapts(Client *c, const Seperator *sep) @@ -6895,9 +6895,9 @@ void command_setaapts(Client *c, const Seperator *sep) t=c->GetTarget()->CastToClient(); if(sep->arg[1][0] == '\0' || sep->arg[2][0] == '\0') - c->Message(0, "Usage: #setaapts "); + c->Message(Chat::White, "Usage: #setaapts "); else if(atoi(sep->arg[2]) <= 0 || atoi(sep->arg[2]) > 5000) - c->Message(0, "You must have a number greater than 0 for points and no more than 5000."); + c->Message(Chat::White, "You must have a number greater than 0 for points and no more than 5000."); else if(!strcasecmp(sep->arg[1], "group")) { t->GetPP().group_leadership_points = atoi(sep->arg[2]); t->GetPP().group_leadership_exp = 0; @@ -6924,9 +6924,9 @@ void command_setcrystals(Client *c, const Seperator *sep) t=c->GetTarget()->CastToClient(); if(sep->arg[1][0] == '\0' || sep->arg[2][0] == '\0') - c->Message(0, "Usage: #setcrystals "); + c->Message(Chat::White, "Usage: #setcrystals "); else if(atoi(sep->arg[2]) <= 0 || atoi(sep->arg[2]) > 100000) - c->Message(0, "You must have a number greater than 0 for crystals and no more than 100000."); + c->Message(Chat::White, "You must have a number greater than 0 for crystals and no more than 100000."); else if(!strcasecmp(sep->arg[1], "radiant")) { t->SetRadiantCrystals(atoi(sep->arg[2])); @@ -6941,7 +6941,7 @@ void command_setcrystals(Client *c, const Seperator *sep) } else { - c->Message(0, "Usage: #setcrystals "); + c->Message(Chat::White, "Usage: #setcrystals "); } } @@ -6961,14 +6961,14 @@ void command_stun(Client *c, const Seperator *sep) t->CastToNPC()->Stun(duration); } else - c->Message(0, "Usage: #stun [duration]"); + c->Message(Chat::White, "Usage: #stun [duration]"); } void command_ban(Client *c, const Seperator *sep) { if(sep->arg[1][0] == 0 || sep->arg[2][0] == 0) { - c->Message(0, "Usage: #ban "); + c->Message(Chat::White, "Usage: #ban "); return; } @@ -6990,7 +6990,7 @@ if(sep->arg[1][0] == 0 || sep->arg[2][0] == 0) { } if(message.length() == 0) { - c->Message(0, "Usage: #ban "); + c->Message(Chat::White, "Usage: #ban "); return; } @@ -7028,7 +7028,7 @@ if(sep->arg[1][0] == 0 || sep->arg[2][0] == 0) { void command_suspend(Client *c, const Seperator *sep) { if((sep->arg[1][0] == 0) || (sep->arg[2][0] == 0)) { - c->Message(0, "Usage: #suspend (Specify 0 days to lift the suspension immediately) "); + c->Message(Chat::White, "Usage: #suspend (Specify 0 days to lift the suspension immediately) "); return; } @@ -7055,7 +7055,7 @@ void command_suspend(Client *c, const Seperator *sep) } if(message.length() == 0) { - c->Message(0, "Usage: #suspend (Specify 0 days to lift the suspension immediately) "); + c->Message(Chat::White, "Usage: #suspend (Specify 0 days to lift the suspension immediately) "); return; } } @@ -7103,12 +7103,12 @@ void command_ipban(Client *c, const Seperator *sep) { if(sep->arg[1] == 0) { - c->Message(0, "Usage: #ipban [xxx.xxx.xxx.xxx]"); + c->Message(Chat::White, "Usage: #ipban [xxx.xxx.xxx.xxx]"); } else { if(database.AddBannedIP(sep->arg[1], c->GetName())) { - c->Message(0, "%s has been successfully added to the Banned_IPs table by %s", sep->arg[1], c->GetName()); + c->Message(Chat::White, "%s has been successfully added to the Banned_IPs table by %s", sep->arg[1], c->GetName()); } else { - c->Message(0, "IPBan Failed (IP address is possibly already in the table?)"); + c->Message(Chat::White, "IPBan Failed (IP address is possibly already in the table?)"); } } } @@ -7116,7 +7116,7 @@ void command_ipban(Client *c, const Seperator *sep) void command_revoke(Client *c, const Seperator *sep) { if(sep->arg[1][0] == 0 || sep->arg[2][0] == 0) { - c->Message(0, "Usage: #revoke [charname] [1/0]"); + c->Message(Chat::White, "Usage: #revoke [charname] [1/0]"); return; } @@ -7134,7 +7134,7 @@ void command_revoke(Client *c, const Seperator *sep) Client* revokee = entity_list.GetClientByAccID(characterID); if(revokee) { - c->Message(0, "Found %s in this zone.", revokee->GetName()); + c->Message(Chat::White, "Found %s in this zone.", revokee->GetName()); revokee->SetRevoked(flag); return; } @@ -7153,7 +7153,7 @@ void command_revoke(Client *c, const Seperator *sep) void command_oocmute(Client *c, const Seperator *sep) { if(sep->arg[1][0] == 0 || !(sep->arg[1][0] == '1' || sep->arg[1][0] == '0')) - c->Message(0, "Usage: #oocmute [1/0]"); + c->Message(Chat::White, "Usage: #oocmute [1/0]"); else { auto outapp = new ServerPacket(ServerOP_OOCMute, 1); *(outapp->pBuffer) = atoi(sep->arg[1]); @@ -7168,13 +7168,13 @@ void command_checklos(Client *c, const Seperator *sep) { // if(c->CheckLos(c->GetTarget())) if(c->CheckLosFN(c->GetTarget())) - c->Message(0, "You have LOS to %s", c->GetTarget()->GetName()); + c->Message(Chat::White, "You have LOS to %s", c->GetTarget()->GetName()); else - c->Message(0, "You do not have LOS to %s", c->GetTarget()->GetName()); + c->Message(Chat::White, "You do not have LOS to %s", c->GetTarget()->GetName()); } else { - c->Message(0, "ERROR: Target required"); + c->Message(Chat::White, "ERROR: Target required"); } } @@ -7187,17 +7187,17 @@ void command_set_adventure_points(Client *c, const Seperator *sep) if(!sep->arg[1][0]) { - c->Message(0, "Usage: #setadventurepoints [points] [theme]"); + c->Message(Chat::White, "Usage: #setadventurepoints [points] [theme]"); return; } if(!sep->IsNumber(1) || !sep->IsNumber(2)) { - c->Message(0, "Usage: #setadventurepoints [points] [theme]"); + c->Message(Chat::White, "Usage: #setadventurepoints [points] [theme]"); return; } - c->Message(0, "Updating adventure points for %s", t->GetName()); + c->Message(Chat::White, "Updating adventure points for %s", t->GetName()); t->UpdateLDoNPoints(atoi(sep->arg[1]), atoi(sep->arg[2])); } @@ -7209,7 +7209,7 @@ void command_npcsay(Client *c, const Seperator *sep) } else { - c->Message(0, "Usage: #npcsay message (requires NPC target"); + c->Message(Chat::White, "Usage: #npcsay message (requires NPC target"); } } @@ -7221,13 +7221,13 @@ void command_npcshout(Client *c, const Seperator *sep) } else { - c->Message(0, "Usage: #npcshout message (requires NPC target"); + c->Message(Chat::White, "Usage: #npcshout message (requires NPC target"); } } void command_timers(Client *c, const Seperator *sep) { if(!c->GetTarget() || !c->GetTarget()->IsClient()) { - c->Message(0,"Need a player target for timers."); + c->Message(Chat::White,"Need a player target for timers."); return; } Client *them = c->GetTarget()->CastToClient(); @@ -7235,12 +7235,12 @@ void command_timers(Client *c, const Seperator *sep) { std::vector< std::pair > res; them->GetPTimers().ToVector(res); - c->Message(0,"Timers for target:"); + c->Message(Chat::White,"Timers for target:"); int r; int l = res.size(); for(r = 0; r < l; r++) { - c->Message(0,"Timer %d: %d seconds remain.", res[r].first, res[r].second->GetRemainingTime()); + c->Message(Chat::White,"Timer %d: %d seconds remain.", res[r].first, res[r].second->GetRemainingTime()); } } @@ -7252,7 +7252,7 @@ void command_npcemote(Client *c, const Seperator *sep) } else { - c->Message(0, "Usage: #npcemote message (requires NPC target"); + c->Message(Chat::White, "Usage: #npcemote message (requires NPC target"); } } @@ -7367,93 +7367,93 @@ void command_npceditmass(Client *c, const Seperator *sep) void command_npcedit(Client *c, const Seperator *sep) { if (!c->GetTarget() || !c->GetTarget()->IsNPC()) { - c->Message(0, "Error: Must have NPC targeted"); + c->Message(Chat::White, "Error: Must have NPC targeted"); return; } if (strcasecmp(sep->arg[1], "help") == 0) { - c->Message(0, "Help File for #npcedit. Syntax for commands are:"); - c->Message(0, "#npcedit Name - Sets an NPC's name"); - c->Message(0, "#npcedit Lastname - Sets an NPC's lastname"); - c->Message(0, "#npcedit Level - Sets an NPC's level"); - c->Message(0, "#npcedit Maxlevel - Sets an NPC's maximum level"); - c->Message(0, "#npcedit Race - Sets an NPC's race"); - c->Message(0, "#npcedit Class - Sets an NPC's class"); - c->Message(0, "#npcedit Bodytype - Sets an NPC's bodytype"); - c->Message(0, "#npcedit HP - Sets an NPC's hitpoints"); - c->Message(0, "#npcedit Gender - Sets an NPC's gender"); - c->Message(0, "#npcedit Texture - Sets an NPC's texture"); - c->Message(0, "#npcedit Helmtexture - Sets an NPC's helmet texture"); - c->Message(0, "#npcedit Armtexture - Sets an NPC's arm texture"); - c->Message(0, "#npcedit Bracertexture - Sets an NPC's bracer texture"); - c->Message(0, "#npcedit Handtexture - Sets an NPC's hand texture"); - c->Message(0, "#npcedit Legtexture - Sets an NPC's leg texture"); - c->Message(0, "#npcedit Feettexture - Sets an NPC's feettexture"); - c->Message(0, "#npcedit Herosforgemodel - Sets an NPC's Hero's Forge Model"); - c->Message(0, "#npcedit Size - Sets an NPC's size"); - c->Message(0, "#npcedit Hpregen - Sets an NPC's hitpoint regen rate per tick"); - c->Message(0, "#npcedit Manaregen - Sets an NPC's mana regen rate per tick"); - c->Message(0, "#npcedit Loottable - Sets the loottable ID for an NPC "); - c->Message(0, "#npcedit Merchantid - Sets the merchant ID for an NPC"); - c->Message(0, "#npcedit alt_currency_id - Sets the Alternate Currency ID for an alterative currency Merchant"); - c->Message(0, "#npcedit npc_spells_effects_id - Sets the NPC Spell Effects ID"); - c->Message(0, "#npcedit adventure_template_id - Sets the NPC's Adventure Template ID"); - c->Message(0, "#npcedit trap_template - Sets the NPC's Trap Template ID"); - c->Message(0, "#npcedit special_abilities - Sets the NPC's Special Abilities"); - c->Message(0, "#npcedit Spell - Sets the npc spells list ID for an NPC"); - c->Message(0, "#npcedit Faction - Sets the NPC's faction id"); - c->Message(0, "#npcedit Damage - Sets an NPC's damage"); - c->Message(0, "#npcedit Meleetype - Sets an NPC's melee types"); - c->Message(0, "#npcedit Rangedtype - Sets an NPC's ranged type"); - c->Message(0, "#npcedit Ammoidfile - Sets an NPC's ammo id file"); - c->Message(0, "#npcedit Aggroradius - Sets an NPC's aggro radius"); - c->Message(0, "#npcedit Assistradius - Sets an NPC's assist radius"); - c->Message(0, "#npcedit Social - Set to 1 if an NPC should assist others on its faction"); - c->Message(0, "#npcedit Runspeed - Sets an NPC's run speed"); - c->Message(0, "#npcedit Walkspeed - Sets an NPC's walk speed"); - c->Message(0, "#npcedit AGI - Sets an NPC's Agility"); - c->Message(0, "#npcedit CHA - Sets an NPC's Charisma"); - c->Message(0, "#npcedit DEX - Sets an NPC's Dexterity"); - c->Message(0, "#npcedit INT - Sets an NPC's Intelligence"); - c->Message(0, "#npcedit STA - Sets an NPC's Stamina"); - c->Message(0, "#npcedit STR - Sets an NPC's Strength"); - c->Message(0, "#npcedit WIS - Sets an NPC's Wisdom"); - c->Message(0, "#npcedit MR - Sets an NPC's Magic Resistance"); - c->Message(0, "#npcedit PR - Sets an NPC's Poison Resistance"); - c->Message(0, "#npcedit DR - Sets an NPC's Disease Resistance"); - c->Message(0, "#npcedit FR - Sets an NPC's Fire Resistance"); - c->Message(0, "#npcedit CR - Sets an NPC's Cold Resistance"); - c->Message(0, "#npcedit Corrup - Sets an NPC's Corruption Resistance"); - c->Message(0, "#npcedit PhR - Sets and NPC's Physical Resistance"); - c->Message(0, "#npcedit Seeinvis - Sets an NPC's ability to see invis"); - c->Message(0, "#npcedit Seeinvisundead - Sets an NPC's ability to see through invis vs. undead"); - c->Message(0, "#npcedit Seehide - Sets an NPC's ability to see through hide"); - c->Message(0, "#npcedit Seeimprovedhide - Sets an NPC's ability to see through improved hide"); - c->Message(0, "#npcedit AC - Sets an NPC's Armor Class"); - c->Message(0, "#npcedit ATK - Sets an NPC's Attack"); - c->Message(0, "#npcedit Accuracy - Sets an NPC's Accuracy"); - c->Message(0, "#npcedit Avoidance - Sets an NPC's Avoidance"); - c->Message(0, "#npcedit npcaggro - Sets an NPC's npc_aggro flag"); - c->Message(0, "#npcedit qglobal - Sets an NPC's quest global flag"); - c->Message(0, "#npcedit spawn_limit - Sets an NPC's spawn limit counter"); - c->Message(0, "#npcedit Attackspeed - Sets an NPC's attack speed modifier"); - c->Message(0, "#npcedit Attackdelay - Sets an NPC's attack delay"); - c->Message(0, "#npcedit Attackcount - Sets an NPC's attack count"); - c->Message(0, "#npcedit findable - Sets an NPC's findable flag"); - c->Message(0, "#npcedit trackable - Sets an NPC's trackable flag"); - c->Message(0, "#npcedit weapon - Sets an NPC's primary and secondary weapon model"); - c->Message(0, "#npcedit featuresave - Saves all current facial features to the database"); - c->Message(0, "#npcedit color - Sets an NPC's red, green, and blue armor tint"); - c->Message(0, "#npcedit armortint_id - Set an NPC's Armor tint ID"); - c->Message(0, "#npcedit setanimation - Set an NPC's animation on spawn (Stored in spawn2 table)"); - c->Message(0, "#npcedit scalerate - Set an NPC's scaling rate"); - c->Message(0, "#npcedit healscale - Set an NPC's heal scaling rate"); - c->Message(0, "#npcedit spellscale - Set an NPC's spell scaling rate"); - c->Message(0, "#npcedit no_target - Set an NPC's ability to be targeted with the target hotkey"); - c->Message(0, "#npcedit version - Set an NPC's version"); - c->Message(0, "#npcedit slow_mitigation - Set an NPC's slow mitigation"); - c->Message(0, "#npcedit flymode - Set an NPC's flymode [0 = ground, 1 = flying, 2 = levitate, 3 = water, 4 = floating]"); + c->Message(Chat::White, "Help File for #npcedit. Syntax for commands are:"); + c->Message(Chat::White, "#npcedit Name - Sets an NPC's name"); + c->Message(Chat::White, "#npcedit Lastname - Sets an NPC's lastname"); + c->Message(Chat::White, "#npcedit Level - Sets an NPC's level"); + c->Message(Chat::White, "#npcedit Maxlevel - Sets an NPC's maximum level"); + c->Message(Chat::White, "#npcedit Race - Sets an NPC's race"); + c->Message(Chat::White, "#npcedit Class - Sets an NPC's class"); + c->Message(Chat::White, "#npcedit Bodytype - Sets an NPC's bodytype"); + c->Message(Chat::White, "#npcedit HP - Sets an NPC's hitpoints"); + c->Message(Chat::White, "#npcedit Gender - Sets an NPC's gender"); + c->Message(Chat::White, "#npcedit Texture - Sets an NPC's texture"); + c->Message(Chat::White, "#npcedit Helmtexture - Sets an NPC's helmet texture"); + c->Message(Chat::White, "#npcedit Armtexture - Sets an NPC's arm texture"); + c->Message(Chat::White, "#npcedit Bracertexture - Sets an NPC's bracer texture"); + c->Message(Chat::White, "#npcedit Handtexture - Sets an NPC's hand texture"); + c->Message(Chat::White, "#npcedit Legtexture - Sets an NPC's leg texture"); + c->Message(Chat::White, "#npcedit Feettexture - Sets an NPC's feettexture"); + c->Message(Chat::White, "#npcedit Herosforgemodel - Sets an NPC's Hero's Forge Model"); + c->Message(Chat::White, "#npcedit Size - Sets an NPC's size"); + c->Message(Chat::White, "#npcedit Hpregen - Sets an NPC's hitpoint regen rate per tick"); + c->Message(Chat::White, "#npcedit Manaregen - Sets an NPC's mana regen rate per tick"); + c->Message(Chat::White, "#npcedit Loottable - Sets the loottable ID for an NPC "); + c->Message(Chat::White, "#npcedit Merchantid - Sets the merchant ID for an NPC"); + c->Message(Chat::White, "#npcedit alt_currency_id - Sets the Alternate Currency ID for an alterative currency Merchant"); + c->Message(Chat::White, "#npcedit npc_spells_effects_id - Sets the NPC Spell Effects ID"); + c->Message(Chat::White, "#npcedit adventure_template_id - Sets the NPC's Adventure Template ID"); + c->Message(Chat::White, "#npcedit trap_template - Sets the NPC's Trap Template ID"); + c->Message(Chat::White, "#npcedit special_abilities - Sets the NPC's Special Abilities"); + c->Message(Chat::White, "#npcedit Spell - Sets the npc spells list ID for an NPC"); + c->Message(Chat::White, "#npcedit Faction - Sets the NPC's faction id"); + c->Message(Chat::White, "#npcedit Damage - Sets an NPC's damage"); + c->Message(Chat::White, "#npcedit Meleetype - Sets an NPC's melee types"); + c->Message(Chat::White, "#npcedit Rangedtype - Sets an NPC's ranged type"); + c->Message(Chat::White, "#npcedit Ammoidfile - Sets an NPC's ammo id file"); + c->Message(Chat::White, "#npcedit Aggroradius - Sets an NPC's aggro radius"); + c->Message(Chat::White, "#npcedit Assistradius - Sets an NPC's assist radius"); + c->Message(Chat::White, "#npcedit Social - Set to 1 if an NPC should assist others on its faction"); + c->Message(Chat::White, "#npcedit Runspeed - Sets an NPC's run speed"); + c->Message(Chat::White, "#npcedit Walkspeed - Sets an NPC's walk speed"); + c->Message(Chat::White, "#npcedit AGI - Sets an NPC's Agility"); + c->Message(Chat::White, "#npcedit CHA - Sets an NPC's Charisma"); + c->Message(Chat::White, "#npcedit DEX - Sets an NPC's Dexterity"); + c->Message(Chat::White, "#npcedit INT - Sets an NPC's Intelligence"); + c->Message(Chat::White, "#npcedit STA - Sets an NPC's Stamina"); + c->Message(Chat::White, "#npcedit STR - Sets an NPC's Strength"); + c->Message(Chat::White, "#npcedit WIS - Sets an NPC's Wisdom"); + c->Message(Chat::White, "#npcedit MR - Sets an NPC's Magic Resistance"); + c->Message(Chat::White, "#npcedit PR - Sets an NPC's Poison Resistance"); + c->Message(Chat::White, "#npcedit DR - Sets an NPC's Disease Resistance"); + c->Message(Chat::White, "#npcedit FR - Sets an NPC's Fire Resistance"); + c->Message(Chat::White, "#npcedit CR - Sets an NPC's Cold Resistance"); + c->Message(Chat::White, "#npcedit Corrup - Sets an NPC's Corruption Resistance"); + c->Message(Chat::White, "#npcedit PhR - Sets and NPC's Physical Resistance"); + c->Message(Chat::White, "#npcedit Seeinvis - Sets an NPC's ability to see invis"); + c->Message(Chat::White, "#npcedit Seeinvisundead - Sets an NPC's ability to see through invis vs. undead"); + c->Message(Chat::White, "#npcedit Seehide - Sets an NPC's ability to see through hide"); + c->Message(Chat::White, "#npcedit Seeimprovedhide - Sets an NPC's ability to see through improved hide"); + c->Message(Chat::White, "#npcedit AC - Sets an NPC's Armor Class"); + c->Message(Chat::White, "#npcedit ATK - Sets an NPC's Attack"); + c->Message(Chat::White, "#npcedit Accuracy - Sets an NPC's Accuracy"); + c->Message(Chat::White, "#npcedit Avoidance - Sets an NPC's Avoidance"); + c->Message(Chat::White, "#npcedit npcaggro - Sets an NPC's npc_aggro flag"); + c->Message(Chat::White, "#npcedit qglobal - Sets an NPC's quest global flag"); + c->Message(Chat::White, "#npcedit spawn_limit - Sets an NPC's spawn limit counter"); + c->Message(Chat::White, "#npcedit Attackspeed - Sets an NPC's attack speed modifier"); + c->Message(Chat::White, "#npcedit Attackdelay - Sets an NPC's attack delay"); + c->Message(Chat::White, "#npcedit Attackcount - Sets an NPC's attack count"); + c->Message(Chat::White, "#npcedit findable - Sets an NPC's findable flag"); + c->Message(Chat::White, "#npcedit trackable - Sets an NPC's trackable flag"); + c->Message(Chat::White, "#npcedit weapon - Sets an NPC's primary and secondary weapon model"); + c->Message(Chat::White, "#npcedit featuresave - Saves all current facial features to the database"); + c->Message(Chat::White, "#npcedit color - Sets an NPC's red, green, and blue armor tint"); + c->Message(Chat::White, "#npcedit armortint_id - Set an NPC's Armor tint ID"); + c->Message(Chat::White, "#npcedit setanimation - Set an NPC's animation on spawn (Stored in spawn2 table)"); + c->Message(Chat::White, "#npcedit scalerate - Set an NPC's scaling rate"); + c->Message(Chat::White, "#npcedit healscale - Set an NPC's heal scaling rate"); + c->Message(Chat::White, "#npcedit spellscale - Set an NPC's spell scaling rate"); + c->Message(Chat::White, "#npcedit no_target - Set an NPC's ability to be targeted with the target hotkey"); + c->Message(Chat::White, "#npcedit version - Set an NPC's version"); + c->Message(Chat::White, "#npcedit slow_mitigation - Set an NPC's slow mitigation"); + c->Message(Chat::White, "#npcedit flymode - Set an NPC's flymode [0 = ground, 1 = flying, 2 = levitate, 3 = water, 4 = floating]"); } @@ -7994,9 +7994,9 @@ void command_npcedit(Client *c, const Seperator *sep) if((strcasecmp(sep->arg[2], "loot" ) == 0) || atoi(sep->arg[2]) == 4) animation = 4; //Looting Animation } else { - c->Message(0, "You must specifiy an animation stand, sit, crouch, dead, loot (0-4)"); - c->Message(0, "Example: #npcedit setanimation sit"); - c->Message(0, "Example: #npcedit setanimation 0"); + c->Message(Chat::White, "You must specifiy an animation stand, sit, crouch, dead, loot (0-4)"); + c->Message(Chat::White, "Example: #npcedit setanimation sit"); + c->Message(Chat::White, "Example: #npcedit setanimation 0"); return; } @@ -8051,7 +8051,7 @@ void command_npcedit(Client *c, const Seperator *sep) } if((sep->arg[1][0] == 0 || strcasecmp(sep->arg[1],"*")==0) || ((c->GetTarget()==0) || (c->GetTarget()->IsClient()))) - c->Message(0, "Type #npcedit help for more info"); + c->Message(Chat::White, "Type #npcedit help for more info"); } @@ -8078,14 +8078,14 @@ void command_profilereset(Client *c, const Seperator *sep) { void command_opcode(Client *c, const Seperator *sep) { if(!strcasecmp(sep->arg[1], "reload" )) { ReloadAllPatches(); - c->Message(0, "Opcodes for all patches have been reloaded"); + c->Message(Chat::White, "Opcodes for all patches have been reloaded"); } } void command_qglobal(Client *c, const Seperator *sep) { //In-game switch for qglobal column if(sep->arg[1][0] == 0) { - c->Message(0, "Syntax: #qglobal [on/off/view]. Requires NPC target."); + c->Message(Chat::White, "Syntax: #qglobal [on/off/view]. Requires NPC target."); return; } @@ -8168,7 +8168,7 @@ void command_undye(Client *c, const Seperator *sep) } else { - c->Message(0, "ERROR: Client target required"); + c->Message(Chat::White, "ERROR: Client target required"); } } @@ -8275,23 +8275,23 @@ void command_ginfo(Client *c, const Seperator *sep) Group *g = t->GetGroup(); if(!g) { - c->Message(0, "This client is not in a group"); + c->Message(Chat::White, "This client is not in a group"); return; } - c->Message(0, "Player: %s is in Group #%lu: with %i members", t->GetName(), (unsigned long)g->GetID(), g->GroupCount()); + c->Message(Chat::White, "Player: %s is in Group #%lu: with %i members", t->GetName(), (unsigned long)g->GetID(), g->GroupCount()); uint32 r; for(r = 0; r < MAX_GROUP_MEMBERS; r++) { if(g->members[r] == nullptr) { if(g->membername[r][0] == '\0') continue; - c->Message(0, "...Zoned Member: %s, Roles: %s %s %s", g->membername[r], + c->Message(Chat::White, "...Zoned Member: %s, Roles: %s %s %s", g->membername[r], (g->MemberRoles[r] & RoleAssist) ? "Assist" : "", (g->MemberRoles[r] & RoleTank) ? "Tank" : "", (g->MemberRoles[r] & RolePuller) ? "Puller" : ""); } else { - c->Message(0, "...In-Zone Member: %s (0x%x) Roles: %s %s %s", g->membername[r], g->members[r], + c->Message(Chat::White, "...In-Zone Member: %s (0x%x) Roles: %s %s %s", g->membername[r], g->members[r], (g->MemberRoles[r] & RoleAssist) ? "Assist" : "", (g->MemberRoles[r] & RoleTank) ? "Tank" : "", (g->MemberRoles[r] & RolePuller) ? "Puller" : ""); @@ -8309,7 +8309,7 @@ void command_hp(Client *c, const Seperator *sep) void command_aggro(Client *c, const Seperator *sep) { if(c->GetTarget() == nullptr || !c->GetTarget()->IsNPC()) { - c->Message(0, "Error: you must have an NPC target."); + c->Message(Chat::White, "Error: you must have an NPC target."); return; } float d = atof(sep->arg[1]); @@ -8330,18 +8330,18 @@ void command_pf(Client *c, const Seperator *sep) if(c->GetTarget()) { Mob *who = c->GetTarget(); - c->Message(0, "POS: (%.2f, %.2f, %.2f)", who->GetX(), who->GetY(), who->GetZ()); - c->Message(0, "WP: %s (%d/%d)", to_string(who->GetCurrentWayPoint()).c_str(), who->IsNPC()?who->CastToNPC()->GetMaxWp():-1); - c->Message(0, "pause=%d RAspeed=%d", who->GetCWPP(), who->GetRunAnimSpeed()); + c->Message(Chat::White, "POS: (%.2f, %.2f, %.2f)", who->GetX(), who->GetY(), who->GetZ()); + c->Message(Chat::White, "WP: %s (%d/%d)", to_string(who->GetCurrentWayPoint()).c_str(), who->IsNPC()?who->CastToNPC()->GetMaxWp():-1); + c->Message(Chat::White, "pause=%d RAspeed=%d", who->GetCWPP(), who->GetRunAnimSpeed()); //who->DumpMovement(c); } else { - c->Message(0, "ERROR: target required"); + c->Message(Chat::White, "ERROR: target required"); } } void command_bestz(Client *c, const Seperator *sep) { if (zone->zonemap == nullptr) { - c->Message(0,"Map not loaded for this zone"); + c->Message(Chat::White,"Map not loaded for this zone"); } else { glm::vec3 me; me.x = c->GetX(); @@ -8355,16 +8355,16 @@ void command_bestz(Client *c, const Seperator *sep) { if (best_z != BEST_Z_INVALID) { - c->Message(0, "Z is %.3f at (%.3f, %.3f).", best_z, me.x, me.y); + c->Message(Chat::White, "Z is %.3f at (%.3f, %.3f).", best_z, me.x, me.y); } else { - c->Message(0, "Found no Z."); + c->Message(Chat::White, "Found no Z."); } } if(zone->watermap == nullptr) { - c->Message(0,"Water Region Map not loaded for this zone"); + c->Message(Chat::White,"Water Region Map not loaded for this zone"); } else { WaterRegionType RegionType; float z; @@ -8373,28 +8373,28 @@ void command_bestz(Client *c, const Seperator *sep) { z=c->GetTarget()->GetZ(); auto position = glm::vec3(c->GetTarget()->GetX(), c->GetTarget()->GetY(), z); RegionType = zone->watermap->ReturnRegionType(position); - c->Message(0,"InWater returns %d", zone->watermap->InWater(position)); - c->Message(0,"InLava returns %d", zone->watermap->InLava(position)); + c->Message(Chat::White,"InWater returns %d", zone->watermap->InWater(position)); + c->Message(Chat::White,"InLava returns %d", zone->watermap->InLava(position)); } else { z=c->GetZ(); auto position = glm::vec3(c->GetX(), c->GetY(), z); RegionType = zone->watermap->ReturnRegionType(position); - c->Message(0,"InWater returns %d", zone->watermap->InWater(position)); - c->Message(0,"InLava returns %d", zone->watermap->InLava(position)); + c->Message(Chat::White,"InWater returns %d", zone->watermap->InWater(position)); + c->Message(Chat::White,"InLava returns %d", zone->watermap->InLava(position)); } switch(RegionType) { - case RegionTypeNormal: { c->Message(0,"There is nothing special about the region you are in!"); break; } - case RegionTypeWater: { c->Message(0,"You/your target are in Water."); break; } - case RegionTypeLava: { c->Message(0,"You/your target are in Lava."); break; } - case RegionTypeVWater: { c->Message(0,"You/your target are in VWater (Icy Water?)."); break; } - case RegionTypePVP: { c->Message(0, "You/your target are in a pvp enabled area."); break; } - case RegionTypeSlime: { c->Message(0, "You/your target are in slime."); break; } - case RegionTypeIce: { c->Message(0, "You/your target are in ice."); break; } - default: c->Message(0,"You/your target are in an unknown region type."); + case RegionTypeNormal: { c->Message(Chat::White,"There is nothing special about the region you are in!"); break; } + case RegionTypeWater: { c->Message(Chat::White,"You/your target are in Water."); break; } + case RegionTypeLava: { c->Message(Chat::White,"You/your target are in Lava."); break; } + case RegionTypeVWater: { c->Message(Chat::White,"You/your target are in VWater (Icy Water?)."); break; } + case RegionTypePVP: { c->Message(Chat::White, "You/your target are in a pvp enabled area."); break; } + case RegionTypeSlime: { c->Message(Chat::White, "You/your target are in slime."); break; } + case RegionTypeIce: { c->Message(Chat::White, "You/your target are in ice."); break; } + default: c->Message(Chat::White,"You/your target are in an unknown region type."); } } @@ -8403,7 +8403,7 @@ void command_bestz(Client *c, const Seperator *sep) { void command_reloadstatic(Client *c, const Seperator *sep) { - c->Message(0, "Reloading zone static data..."); + c->Message(Chat::White, "Reloading zone static data..."); zone->ReloadStaticData(); } @@ -8422,13 +8422,13 @@ void command_flags(Client *c, const Seperator *sep) { void command_flagedit(Client *c, const Seperator *sep) { //super-command for editing zone flags if(sep->arg[1][0] == '\0' || !strcasecmp(sep->arg[1], "help")) { - c->Message(0, "Syntax: #flagedit [lockzone|unlockzone|listzones|give|take]."); - c->Message(0, "...lockzone [zone id/short] [flag name] - Set the specified flag name on the zone, locking the zone"); - c->Message(0, "...unlockzone [zone id/short] - Removes the flag requirement from the specified zone"); - c->Message(0, "...listzones - List all zones which require a flag, and their flag's name"); - c->Message(0, "...give [zone id/short] - Give your target the zone flag for the specified zone."); - c->Message(0, "...take [zone id/short] - Take the zone flag for the specified zone away from your target"); - c->Message(0, "...Note: use #flags to view flags on a person"); + c->Message(Chat::White, "Syntax: #flagedit [lockzone|unlockzone|listzones|give|take]."); + c->Message(Chat::White, "...lockzone [zone id/short] [flag name] - Set the specified flag name on the zone, locking the zone"); + c->Message(Chat::White, "...unlockzone [zone id/short] - Removes the flag requirement from the specified zone"); + c->Message(Chat::White, "...listzones - List all zones which require a flag, and their flag's name"); + c->Message(Chat::White, "...give [zone id/short] - Give your target the zone flag for the specified zone."); + c->Message(Chat::White, "...take [zone id/short] - Take the zone flag for the specified zone away from your target"); + c->Message(Chat::White, "...Note: use #flags to view flags on a person"); return; } @@ -8501,9 +8501,9 @@ void command_flagedit(Client *c, const Seperator *sep) { return; } - c->Message(0, "Zones which require flags:"); + c->Message(Chat::White, "Zones which require flags:"); for (auto row = results.begin(); row != results.end(); ++row) - c->Message(0, "Zone %s (%s,%s) version %s requires key %s", row[2], row[0], row[1], row[3], row[4]); + c->Message(Chat::White, "Zone %s (%s,%s) version %s requires key %s", row[2], row[0], row[1], row[3], row[4]); return; } @@ -8568,7 +8568,7 @@ void command_acceptrules(Client *c, const Seperator *sep) { database.SetAgreementFlag(c->AccountID()); c->SendAppearancePacket(AT_Anim, ANIM_STAND); - c->Message(0,"It is recorded you have agreed to the rules."); + c->Message(Chat::White,"It is recorded you have agreed to the rules."); } } @@ -8580,7 +8580,7 @@ void command_guildcreate(Client *c, const Seperator *sep) } else { - c->Message(0,"Guild name must be more than 4 characters and less than 16."); + c->Message(Chat::White,"Guild name must be more than 4 characters and less than 16."); } } @@ -8597,17 +8597,17 @@ void command_guildlist(Client *c, const Seperator *sep) tmp->ApprovedMembers(c); } else - c->Message(0,"Could not find reference id."); + c->Message(Chat::White,"Could not find reference id."); } void command_hatelist(Client *c, const Seperator *sep) { Mob *target = c->GetTarget(); if(target == nullptr) { - c->Message(0, "Error: you must have a target."); + c->Message(Chat::White, "Error: you must have a target."); return; } - c->Message(0, "Display hate list for %s..", target->GetName()); + c->Message(Chat::White, "Display hate list for %s..", target->GetName()); target->PrintHateListToClient(c); } @@ -8615,29 +8615,29 @@ void command_hatelist(Client *c, const Seperator *sep) { void command_rules(Client *c, const Seperator *sep) { //super-command for managing rules settings if(sep->arg[1][0] == '\0' || !strcasecmp(sep->arg[1], "help")) { - c->Message(0, "Syntax: #rules [subcommand]."); - c->Message(0, "-- Rule Set Manipulation --"); - c->Message(0, "...listsets - List avaliable rule sets"); - c->Message(0, "...current - gives the name of the ruleset currently running in this zone"); - c->Message(0, "...reload - Reload the selected ruleset in this zone"); - c->Message(0, "...switch (ruleset name) - Change the selected ruleset and load it"); - c->Message(0, "...load (ruleset name) - Load a ruleset in just this zone without changing the selected set"); + c->Message(Chat::White, "Syntax: #rules [subcommand]."); + c->Message(Chat::White, "-- Rule Set Manipulation --"); + c->Message(Chat::White, "...listsets - List avaliable rule sets"); + c->Message(Chat::White, "...current - gives the name of the ruleset currently running in this zone"); + c->Message(Chat::White, "...reload - Reload the selected ruleset in this zone"); + c->Message(Chat::White, "...switch (ruleset name) - Change the selected ruleset and load it"); + c->Message(Chat::White, "...load (ruleset name) - Load a ruleset in just this zone without changing the selected set"); //too lazy to write this right now: -// c->Message(0, "...wload (ruleset name) - Load a ruleset in all zones without changing the selected set"); - c->Message(0, "...store [ruleset name] - Store the running ruleset as the specified name"); - c->Message(0, "---------------------"); - c->Message(0, "-- Running Rule Manipulation --"); - c->Message(0, "...reset - Reset all rules to their default values"); - c->Message(0, "...get [rule] - Get the specified rule's local value"); - c->Message(0, "...set (rule) (value) - Set the specified rule to the specified value locally only"); - c->Message(0, "...setdb (rule) (value) - Set the specified rule to the specified value locally and in the DB"); - c->Message(0, "...list [catname] - List all rules in the specified category (or all categiries if omitted)"); - c->Message(0, "...values [catname] - List the value of all rules in the specified category"); +// c->Message(Chat::White, "...wload (ruleset name) - Load a ruleset in all zones without changing the selected set"); + c->Message(Chat::White, "...store [ruleset name] - Store the running ruleset as the specified name"); + c->Message(Chat::White, "---------------------"); + c->Message(Chat::White, "-- Running Rule Manipulation --"); + c->Message(Chat::White, "...reset - Reset all rules to their default values"); + c->Message(Chat::White, "...get [rule] - Get the specified rule's local value"); + c->Message(Chat::White, "...set (rule) (value) - Set the specified rule to the specified value locally only"); + c->Message(Chat::White, "...setdb (rule) (value) - Set the specified rule to the specified value locally and in the DB"); + c->Message(Chat::White, "...list [catname] - List all rules in the specified category (or all categiries if omitted)"); + c->Message(Chat::White, "...values [catname] - List the value of all rules in the specified category"); return; } if(!strcasecmp(sep->arg[1], "current")) { - c->Message(0, "Currently running ruleset '%s' (%d)", RuleManager::Instance()->GetActiveRuleset(), + c->Message(Chat::White, "Currently running ruleset '%s' (%d)", RuleManager::Instance()->GetActiveRuleset(), RuleManager::Instance()->GetActiveRulesetID()); } else if(!strcasecmp(sep->arg[1], "listsets")) { std::map sets; @@ -8646,16 +8646,16 @@ void command_rules(Client *c, const Seperator *sep) { return; } - c->Message(0, "Avaliable rule sets:"); + c->Message(Chat::White, "Avaliable rule sets:"); std::map::iterator cur, end; cur = sets.begin(); end = sets.end(); for(; cur != end; ++cur) { - c->Message(0, "(%d) %s", cur->first, cur->second.c_str()); + c->Message(Chat::White, "(%d) %s", cur->first, cur->second.c_str()); } } else if(!strcasecmp(sep->arg[1], "reload")) { RuleManager::Instance()->LoadRules(&database, RuleManager::Instance()->GetActiveRuleset(), true); - c->Message(0, "The active ruleset (%s (%d)) has been reloaded", RuleManager::Instance()->GetActiveRuleset(), + c->Message(Chat::White, "The active ruleset (%s (%d)) has been reloaded", RuleManager::Instance()->GetActiveRuleset(), RuleManager::Instance()->GetActiveRulesetID()); } else if(!strcasecmp(sep->arg[1], "switch")) { //make sure this is a valid rule set.. @@ -8672,7 +8672,7 @@ void command_rules(Client *c, const Seperator *sep) { //TODO: we likely want to reload this ruleset everywhere... RuleManager::Instance()->LoadRules(&database, sep->arg[2], true); - c->Message(0, "The selected ruleset has been changed to (%s (%d)) and reloaded locally", sep->arg[2], rsid); + c->Message(Chat::White, "The selected ruleset has been changed to (%s (%d)) and reloaded locally", sep->arg[2], rsid); } else if(!strcasecmp(sep->arg[1], "load")) { //make sure this is a valid rule set.. int rsid = RuleManager::Instance()->GetRulesetID(&database, sep->arg[2]); @@ -8681,12 +8681,12 @@ void command_rules(Client *c, const Seperator *sep) { return; } RuleManager::Instance()->LoadRules(&database, sep->arg[2], true); - c->Message(0, "Loaded ruleset '%s' (%d) locally", sep->arg[2], rsid); + c->Message(Chat::White, "Loaded ruleset '%s' (%d) locally", sep->arg[2], rsid); } else if(!strcasecmp(sep->arg[1], "store")) { if(sep->argnum == 1) { //store current rule set. RuleManager::Instance()->SaveRules(&database); - c->Message(0, "Rules saved"); + c->Message(Chat::White, "Rules saved"); } else if(sep->argnum == 2) { RuleManager::Instance()->SaveRules(&database, sep->arg[2]); int prersid = RuleManager::Instance()->GetActiveRulesetID(); @@ -8694,9 +8694,9 @@ void command_rules(Client *c, const Seperator *sep) { if(rsid < 0) { c->Message(Chat::Red, "Unable to query ruleset ID after store, it most likely failed."); } else { - c->Message(0, "Stored rules as ruleset '%s' (%d)", sep->arg[2], rsid); + c->Message(Chat::White, "Stored rules as ruleset '%s' (%d)", sep->arg[2], rsid); if(prersid != rsid) { - c->Message(0, "Rule set %s (%d) is now active in this zone", sep->arg[2], rsid); + c->Message(Chat::White, "Rule set %s (%d) is now active in this zone", sep->arg[2], rsid); } } } else { @@ -8705,7 +8705,7 @@ void command_rules(Client *c, const Seperator *sep) { } } else if(!strcasecmp(sep->arg[1], "reset")) { RuleManager::Instance()->ResetRules(true); - c->Message(0, "The running ruleset has been set to defaults"); + c->Message(Chat::White, "The running ruleset has been set to defaults"); } else if(!strcasecmp(sep->arg[1], "get")) { if(sep->argnum != 2) { @@ -8716,7 +8716,7 @@ void command_rules(Client *c, const Seperator *sep) { if(!RuleManager::Instance()->GetRule(sep->arg[2], value)) c->Message(Chat::Red, "Unable to find rule %s", sep->arg[2]); else - c->Message(0, "%s - %s", sep->arg[2], value.c_str()); + c->Message(Chat::White, "%s - %s", sep->arg[2], value.c_str()); } else if(!strcasecmp(sep->arg[1], "set")) { if(sep->argnum != 3) { @@ -8726,7 +8726,7 @@ void command_rules(Client *c, const Seperator *sep) { if(!RuleManager::Instance()->SetRule(sep->arg[2], sep->arg[3], nullptr, false, true)) { c->Message(Chat::Red, "Failed to modify rule"); } else { - c->Message(0, "Rule modified locally."); + c->Message(Chat::White, "Rule modified locally."); } } else if(!strcasecmp(sep->arg[1], "setdb")) { if(sep->argnum != 3) { @@ -8736,7 +8736,7 @@ void command_rules(Client *c, const Seperator *sep) { if(!RuleManager::Instance()->SetRule(sep->arg[2], sep->arg[3], &database, true, true)) { c->Message(Chat::Red, "Failed to modify rule"); } else { - c->Message(0, "Rule modified locally and in the database."); + c->Message(Chat::White, "Rule modified locally and in the database."); } } else if(!strcasecmp(sep->arg[1], "list")) { if(sep->argnum == 1) { @@ -8745,12 +8745,12 @@ void command_rules(Client *c, const Seperator *sep) { c->Message(Chat::Red, "Failed to list categories!"); return; } - c->Message(0, "Rule Categories:"); + c->Message(Chat::White, "Rule Categories:"); std::vector::iterator cur, end; cur = rule_list.begin(); end = rule_list.end(); for(; cur != end; ++cur) { - c->Message(0, " %s", *cur); + c->Message(Chat::White, " %s", *cur); } } else if(sep->argnum == 2) { const char *catfilt = nullptr; @@ -8761,12 +8761,12 @@ void command_rules(Client *c, const Seperator *sep) { c->Message(Chat::Red, "Failed to list rules!"); return; } - c->Message(0, "Rules in category %s:", sep->arg[2]); + c->Message(Chat::White, "Rules in category %s:", sep->arg[2]); std::vector::iterator cur, end; cur = rule_list.begin(); end = rule_list.end(); for(; cur != end; ++cur) { - c->Message(0, " %s", *cur); + c->Message(Chat::White, " %s", *cur); } } else { c->Message(Chat::Red, "Invalid argument count, see help."); @@ -8784,13 +8784,13 @@ void command_rules(Client *c, const Seperator *sep) { c->Message(Chat::Red, "Failed to list rules!"); return; } - c->Message(0, "Rules & values in category %s:", sep->arg[2]); + c->Message(Chat::White, "Rules & values in category %s:", sep->arg[2]); std::vector::iterator cur, end; cur = rule_list.begin(); end = rule_list.end(); for(std::string tmp_value; cur != end; ++cur) { if (RuleManager::Instance()->GetRule(*cur, tmp_value)) - c->Message(0, " %s - %s", *cur, tmp_value.c_str()); + c->Message(Chat::White, " %s - %s", *cur, tmp_value.c_str()); } } @@ -8803,15 +8803,15 @@ void command_rules(Client *c, const Seperator *sep) { void command_task(Client *c, const Seperator *sep) { //super-command for managing tasks if(sep->arg[1][0] == '\0' || !strcasecmp(sep->arg[1], "help")) { - c->Message(0, "Syntax: #task [subcommand]."); - c->Message(0, "-- Task System Commands --"); - c->Message(0, "...show - List active tasks for a client"); - c->Message(0, "...update [Count]"); - c->Message(0, "...reloadall - Reload all Task information from the database"); - c->Message(0, "...reload task - Reload Task and Activity informnation for a single task"); - c->Message(0, "...reload lists - Reload goal/reward list information"); - c->Message(0, "...reload prox - Reload proximity information"); - c->Message(0, "...reload sets - Reload task set information"); + c->Message(Chat::White, "Syntax: #task [subcommand]."); + c->Message(Chat::White, "-- Task System Commands --"); + c->Message(Chat::White, "...show - List active tasks for a client"); + c->Message(Chat::White, "...update [Count]"); + c->Message(Chat::White, "...reloadall - Reload all Task information from the database"); + c->Message(Chat::White, "...reload task - Reload Task and Activity informnation for a single task"); + c->Message(Chat::White, "...reload lists - Reload goal/reward list information"); + c->Message(Chat::White, "...reload prox - Reload proximity information"); + c->Message(Chat::White, "...reload sets - Reload task set information"); return; } @@ -8879,7 +8879,7 @@ void command_task(Client *c, const Seperator *sep) { } } - c->Message(0, "Unable to interpret command. Type #task help"); + c->Message(Chat::White, "Unable to interpret command. Type #task help"); } void command_reloadtitles(Client *c, const Seperator *sep) @@ -8898,7 +8898,7 @@ void command_traindisc(Client *c, const Seperator *sep) t = c->GetTarget()->CastToClient(); if (sep->argnum < 1 || !sep->IsNumber(1)) { - c->Message(0, "FORMAT: #traindisc "); + c->Message(Chat::White, "FORMAT: #traindisc "); return; } @@ -8911,17 +8911,17 @@ void command_traindisc(Client *c, const Seperator *sep) min_level = (uint8)RuleI(Character, MaxLevel); // default to Character:MaxLevel if we're not a GM & it's higher than the max level if(max_level < 1 || min_level < 1) { - c->Message(0, "ERROR: Level must be greater than 1."); + c->Message(Chat::White, "ERROR: Level must be greater than 1."); return; } if (min_level > max_level) { - c->Message(0, "Error: Min Level must be less than or equal to Max Level."); + c->Message(Chat::White, "Error: Min Level must be less than or equal to Max Level."); return; } - t->Message(0, "Training disciplines"); + t->Message(Chat::White, "Training disciplines"); if(t != c) - c->Message(0, "Training disciplines for %s.", t->GetName()); + c->Message(Chat::White, "Training disciplines for %s.", t->GetName()); Log(Logs::General, Logs::Normal, "Train disciplines request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); int spell_id = 0; @@ -8963,7 +8963,7 @@ void command_traindisc(Client *c, const Seperator *sep) t->GetPP().disciplines.values[r] = spell_id_; database.SaveCharacterDisc(t->CharacterID(), r, spell_id_); change = true; - t->Message(0, "You have learned a new discipline!"); + t->Message(Chat::White, "You have learned a new discipline!"); ++count; // success counter break; // continue the 1st loop } // if we get to this point, there's already a discipline in this slot, so we continue onto the next slot @@ -8977,13 +8977,13 @@ void command_traindisc(Client *c, const Seperator *sep) t->SendDisciplineUpdate(); if (count > 0) { - t->Message(0, "Successfully trained %u disciplines.", count); + t->Message(Chat::White, "Successfully trained %u disciplines.", count); if (t != c) - c->Message(0, "Successfully trained %u disciplines for %s.", count, t->GetName()); + c->Message(Chat::White, "Successfully trained %u disciplines for %s.", count, t->GetName()); } else { - t->Message(0, "No disciplines trained."); + t->Message(Chat::White, "No disciplines trained."); if (t != c) - c->Message(0, "No disciplines trained for %s.", t->GetName()); + c->Message(Chat::White, "No disciplines trained for %s.", t->GetName()); } } @@ -8997,7 +8997,7 @@ void command_setgraveyard(Client *c, const Seperator *sep) t=c->GetTarget()->CastToClient(); if(!sep->arg[1][0]) { - c->Message(0, "Usage: #setgraveyard [zonename]"); + c->Message(Chat::White, "Usage: #setgraveyard [zonename]"); return; } @@ -9007,21 +9007,21 @@ void command_setgraveyard(Client *c, const Seperator *sep) graveyard_id = database.CreateGraveyardRecord(zoneid, t->GetPosition()); if(graveyard_id > 0) { - c->Message(0, "Successfuly added a new record for this graveyard!"); + c->Message(Chat::White, "Successfuly added a new record for this graveyard!"); if(database.AddGraveyardIDToZone(zoneid, graveyard_id) > 0) { - c->Message(0, "Successfuly added this new graveyard for the zone %s.", sep->arg[1]); + c->Message(Chat::White, "Successfuly added this new graveyard for the zone %s.", sep->arg[1]); // TODO: Set graveyard data to the running zone process. - c->Message(0, "Done!"); + c->Message(Chat::White, "Done!"); } else - c->Message(0, "Unable to add this new graveyard to the zone %s.", sep->arg[1]); + c->Message(Chat::White, "Unable to add this new graveyard to the zone %s.", sep->arg[1]); } else { - c->Message(0, "Unable to create a new graveyard record in the database."); + c->Message(Chat::White, "Unable to create a new graveyard record in the database."); } } else { - c->Message(0, "Unable to retrieve a ZoneID for the zone: %s", sep->arg[1]); + c->Message(Chat::White, "Unable to retrieve a ZoneID for the zone: %s", sep->arg[1]); } return; @@ -9033,7 +9033,7 @@ void command_deletegraveyard(Client *c, const Seperator *sep) uint32 graveyard_id = 0; if(!sep->arg[1][0]) { - c->Message(0, "Usage: #deletegraveyard [zonename]"); + c->Message(Chat::White, "Usage: #deletegraveyard [zonename]"); return; } @@ -9042,15 +9042,15 @@ void command_deletegraveyard(Client *c, const Seperator *sep) if(zoneid > 0 && graveyard_id > 0) { if(database.DeleteGraveyard(zoneid, graveyard_id)) - c->Message(0, "Successfuly deleted graveyard %u for zone %s.", graveyard_id, sep->arg[1]); + c->Message(Chat::White, "Successfuly deleted graveyard %u for zone %s.", graveyard_id, sep->arg[1]); else - c->Message(0, "Unable to delete graveyard %u for zone %s.", graveyard_id, sep->arg[1]); + c->Message(Chat::White, "Unable to delete graveyard %u for zone %s.", graveyard_id, sep->arg[1]); } else { if(zoneid <= 0) - c->Message(0, "Unable to retrieve a ZoneID for the zone: %s", sep->arg[1]); + c->Message(Chat::White, "Unable to retrieve a ZoneID for the zone: %s", sep->arg[1]); else if(graveyard_id <= 0) - c->Message(0, "Unable to retrieve a valid GraveyardID for the zone: %s", sep->arg[1]); + c->Message(Chat::White, "Unable to retrieve a valid GraveyardID for the zone: %s", sep->arg[1]); } return; @@ -9063,14 +9063,14 @@ void command_summonburiedplayercorpse(Client *c, const Seperator *sep) if(c->GetTarget() && c->GetTarget()->IsClient() && c->GetGM()) t = c->GetTarget()->CastToClient(); else { - c->Message(0, "You must first select a target!"); + c->Message(Chat::White, "You must first select a target!"); return; } Corpse* PlayerCorpse = database.SummonBuriedCharacterCorpses(t->CharacterID(), t->GetZoneID(), zone->GetInstanceID(), t->GetPosition()); if(!PlayerCorpse) - c->Message(0, "Your target doesn't have any buried corpses."); + c->Message(Chat::White, "Your target doesn't have any buried corpses."); return; } @@ -9082,16 +9082,16 @@ void command_getplayerburiedcorpsecount(Client *c, const Seperator *sep) if(c->GetTarget() && c->GetTarget()->IsClient() && c->GetGM()) t = c->GetTarget()->CastToClient(); else { - c->Message(0, "You must first select a target!"); + c->Message(Chat::White, "You must first select a target!"); return; } uint32 CorpseCount = database.GetCharacterBuriedCorpseCount(t->CharacterID()); if(CorpseCount > 0) - c->Message(0, "Your target has a total of %u buried corpses.", CorpseCount); + c->Message(Chat::White, "Your target has a total of %u buried corpses.", CorpseCount); else - c->Message(0, "Your target doesn't have any buried corpses."); + c->Message(Chat::White, "Your target doesn't have any buried corpses."); return; } @@ -9116,7 +9116,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep) if (strcasecmp(sep->arg[1], "maketype") == 0) { if(!target || !target->IsNPC()) { - c->Message(0, "Target Required!"); + c->Message(Chat::White, "Target Required!"); return; } @@ -9126,7 +9126,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep) if (strcasecmp(sep->arg[1], "makegroup") == 0) { if(!sep->arg[2]) { - c->Message(0, "Format: #advnpdspawn makegroup [spawn limit] [dist] [max x] [min x] [max y] [min y] [delay]"); + c->Message(Chat::White, "Format: #advnpdspawn makegroup [spawn limit] [dist] [max x] [min x] [max y] [min y] [delay]"); return; } @@ -9143,18 +9143,18 @@ void command_advnpcspawn(Client *c, const Seperator *sep) (sep->arg[9]? atoi(sep->arg[9]): 0)); auto results = database.QueryDatabase(query); if (!results.Success()) { - c->Message(0, "Invalid Arguments -- MySQL gave the following error:"); + c->Message(Chat::White, "Invalid Arguments -- MySQL gave the following error:"); c->Message(Chat::Red, results.ErrorMessage().c_str()); return; } - c->Message(0, "Group ID %i created successfully!", results.LastInsertedID()); + c->Message(Chat::White, "Group ID %i created successfully!", results.LastInsertedID()); return; } if (strcasecmp(sep->arg[1], "addgroupentry") == 0) { if(!atoi(sep->arg[2]) || !atoi(sep->arg[3]) || !atoi(sep->arg[4])) { - c->Message(0, "Format: #advnpdspawn addgroupentry "); + c->Message(Chat::White, "Format: #advnpdspawn addgroupentry "); return; } @@ -9163,19 +9163,19 @@ void command_advnpcspawn(Client *c, const Seperator *sep) atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4])); auto results = database.QueryDatabase(query); if (!results.Success()) { - c->Message(0, "Invalid Arguments -- MySQL gave the following error:"); + c->Message(Chat::White, "Invalid Arguments -- MySQL gave the following error:"); c->Message(Chat::Red, results.ErrorMessage().c_str()); return; } - c->Message(0, "NPC %i added to group %i with %i chance!", atoi(sep->arg[3]), atoi(sep->arg[2]), atoi(sep->arg[4]) ); + c->Message(Chat::White, "NPC %i added to group %i with %i chance!", atoi(sep->arg[3]), atoi(sep->arg[2]), atoi(sep->arg[4]) ); return; } if (strcasecmp(sep->arg[1], "editgroupbox") == 0) { if(!atof(sep->arg[2]) || !atof(sep->arg[3]) || !atof(sep->arg[4]) || !atof(sep->arg[5]) || !atof(sep->arg[6]) || !atof(sep->arg[7]) || !atof(sep->arg[8])) { - c->Message(0, "Format: #advnpdspawn editgroupbox "); + c->Message(Chat::White, "Format: #advnpdspawn editgroupbox "); return; } @@ -9186,19 +9186,19 @@ void command_advnpcspawn(Client *c, const Seperator *sep) atoi(sep->arg[2])); auto results = database.QueryDatabase(query); if (!results.Success()) { - c->Message(0, "Invalid Arguments -- MySQL gave the following error:"); + c->Message(Chat::White, "Invalid Arguments -- MySQL gave the following error:"); c->Message(Chat::Red, results.ErrorMessage().c_str()); return; } - c->Message(0, "Group ID %i created successfully!", results.LastInsertedID()); + c->Message(Chat::White, "Group ID %i created successfully!", results.LastInsertedID()); return; } if (strcasecmp(sep->arg[1], "cleargroupbox") == 0) { if(!atoi(sep->arg[2])) { - c->Message(0, "Format: #advnpdspawn cleargroupbox "); + c->Message(Chat::White, "Format: #advnpdspawn cleargroupbox "); return; } @@ -9208,32 +9208,32 @@ void command_advnpcspawn(Client *c, const Seperator *sep) "WHERE id = '%i' ", atoi(sep->arg[2])); auto results = database.QueryDatabase(query); if (!results.Success()) { - c->Message(0, "Invalid Arguments -- MySQL gave the following error:"); + c->Message(Chat::White, "Invalid Arguments -- MySQL gave the following error:"); c->Message(Chat::Red, results.ErrorMessage().c_str()); return; } - c->Message(0, "Group ID %i created successfully!", results.LastInsertedID()); + c->Message(Chat::White, "Group ID %i created successfully!", results.LastInsertedID()); return; } if (strcasecmp(sep->arg[1], "addgroupspawn") == 0 && atoi(sep->arg[2])!=0) { database.NPCSpawnDB(5, zone->GetShortName(), zone->GetInstanceVersion(), c, 0, atoi(sep->arg[2])); - c->Message(0, "Mob of group %i added successfully!", atoi(sep->arg[2])); + c->Message(Chat::White, "Mob of group %i added successfully!", atoi(sep->arg[2])); return; } if (strcasecmp(sep->arg[1], "removegroupspawn") == 0) { if (!target || !target->IsNPC()) { - c->Message(0, "Error: Need an NPC target."); + c->Message(Chat::White, "Error: Need an NPC target."); return; } Spawn2* s2 = target->CastToNPC()->respawn2; if(!s2) { - c->Message(0, "removegroupspawn FAILED -- cannot determine which spawn entry in the database this mob came from."); + c->Message(Chat::White, "removegroupspawn FAILED -- cannot determine which spawn entry in the database this mob came from."); return; } @@ -9245,7 +9245,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep) return; } - c->Message(0, "Spawnpoint Removed successfully."); + c->Message(Chat::White, "Spawnpoint Removed successfully."); target->Depop(false); return; @@ -9253,14 +9253,14 @@ void command_advnpcspawn(Client *c, const Seperator *sep) if (strcasecmp(sep->arg[1], "movespawn") == 0) { if (!target || !target->IsNPC()) { - c->Message(0, "Error: Need an NPC target."); + c->Message(Chat::White, "Error: Need an NPC target."); return; } Spawn2* s2 = target->CastToNPC()->respawn2; if(!s2) { - c->Message(0, "movespawn FAILED -- cannot determine which spawn entry in the database this mob came from."); + c->Message(Chat::White, "movespawn FAILED -- cannot determine which spawn entry in the database this mob came from."); return; } @@ -9274,7 +9274,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep) return; } - c->Message(0, "Updating coordinates successful."); + c->Message(Chat::White, "Updating coordinates successful."); target->GMMove(c->GetX(), c->GetY(), c->GetZ(), c->GetHeading()); return; @@ -9282,7 +9282,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep) if (strcasecmp(sep->arg[1], "editrespawn") == 0) { if (!target || !target->IsNPC()) { - c->Message(0, "Error: Need an NPC target."); + c->Message(Chat::White, "Error: Need an NPC target."); return; } @@ -9291,7 +9291,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep) uint32 new_rs = 0; uint32 new_var = s2->GetVariance(); if(!sep->IsNumber(2)) { - c->Message(0, "editrespawn FAILED -- cannot set respawn to be 0"); + c->Message(Chat::White, "editrespawn FAILED -- cannot set respawn to be 0"); return; } @@ -9301,7 +9301,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep) new_var = atoi(sep->arg[3]); if(!s2) { - c->Message(0, "editrespawn FAILED -- cannot determine which spawn entry in the database this mob came from."); + c->Message(Chat::White, "editrespawn FAILED -- cannot determine which spawn entry in the database this mob came from."); return; } @@ -9314,7 +9314,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep) return; } - c->Message(0, "Updating respawn timer successful."); + c->Message(Chat::White, "Updating respawn timer successful."); s2->SetRespawnTimer(new_rs); s2->SetVariance(new_var); @@ -9323,12 +9323,12 @@ void command_advnpcspawn(Client *c, const Seperator *sep) if (strcasecmp(sep->arg[1], "setversion") == 0) { if (!target || !target->IsNPC()) { - c->Message(0, "Error: Need an NPC target."); + c->Message(Chat::White, "Error: Need an NPC target."); return; } if(!sep->IsNumber(2)) { - c->Message(0, "setversion FAILED -- You must set a version number"); + c->Message(Chat::White, "setversion FAILED -- You must set a version number"); return; } @@ -9343,7 +9343,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep) return; } - c->Message(0, "Version change to %i was successful from SpawnGroupID %i", version, c->GetTarget()->CastToNPC()->GetSp2()); + c->Message(Chat::White, "Version change to %i was successful from SpawnGroupID %i", version, c->GetTarget()->CastToNPC()->GetSp2()); c->GetTarget()->Depop(false); return; @@ -9351,13 +9351,13 @@ void command_advnpcspawn(Client *c, const Seperator *sep) if (strcasecmp(sep->arg[1], "testload") == 0 && atoi(sep->arg[2])!=0) { database.LoadSpawnGroupsByID(atoi(sep->arg[2]),&zone->spawn_group_list); - c->Message(0, "Group %i loaded successfully!", atoi(sep->arg[2])); + c->Message(Chat::White, "Group %i loaded successfully!", atoi(sep->arg[2])); return; } - c->Message(0, "Error: #advnpcspawn: Invalid command."); - c->Message(0, "Usage: #advnpcspawn [maketype|makegroup|addgroupentry|addgroupspawn|setversion]"); - c->Message(0, "Usage: #advnpcspawn [removegroupspawn|movespawn|editrespawn|editgroupbox|cleargroupbox]"); + c->Message(Chat::White, "Error: #advnpcspawn: Invalid command."); + c->Message(Chat::White, "Usage: #advnpcspawn [maketype|makegroup|addgroupentry|addgroupspawn|setversion]"); + c->Message(Chat::White, "Usage: #advnpcspawn [removegroupspawn|movespawn|editrespawn|editgroupbox|cleargroupbox]"); } void command_aggrozone(Client *c, const Seperator *sep) { @@ -9371,7 +9371,7 @@ void command_aggrozone(Client *c, const Seperator *sep) { uint32 hate = atoi(sep->arg[1]); //should default to 0 if we don't enter anything entity_list.AggroZone(m, hate); - c->Message(0, "Train to you! Last chance to go invulnerable..."); + c->Message(Chat::White, "Train to you! Last chance to go invulnerable..."); } void command_modifynpcstat(Client *c, const Seperator *sep) @@ -9381,8 +9381,8 @@ void command_modifynpcstat(Client *c, const Seperator *sep) if(sep->arg[1][0] == '\0') { - c->Message(0, "usage #modifynpcstat arg value"); - c->Message(0, "Args: ac, str, sta, agi, dex, wis, _int, cha, max_hp, mr, fr, cr, pr, dr, runspeed, special_attacks, " + c->Message(Chat::White, "usage #modifynpcstat arg value"); + c->Message(Chat::White, "Args: ac, str, sta, agi, dex, wis, _int, cha, max_hp, mr, fr, cr, pr, dr, runspeed, special_attacks, " "attack_speed, atk, accuracy, trackable, min_hit, max_hit, see_invis_undead, see_hide, see_improved_hide, " "hp_regen, mana_regen, aggro, assist, slow_mitigation, loottable_id, healscale, spellscale"); return; @@ -9412,22 +9412,22 @@ void command_instance(Client *c, const Seperator *sep) if(strcasecmp(sep->arg[1], "help") == 0) { - c->Message(0, "#instance usage:"); - c->Message(0, "#instance create zone_id version duration - Creates an instance of version 'version' in the " + c->Message(Chat::White, "#instance usage:"); + c->Message(Chat::White, "#instance create zone_id version duration - Creates an instance of version 'version' in the " "zone with id matching zone_id, will last for duration seconds."); - c->Message(0, "#instance destroy instance_id - Destroys the instance with id matching instance_id."); - c->Message(0, "#instance add instance_id player_name - adds the player 'player_name' to the instance " + c->Message(Chat::White, "#instance destroy instance_id - Destroys the instance with id matching instance_id."); + c->Message(Chat::White, "#instance add instance_id player_name - adds the player 'player_name' to the instance " "with id matching instance_id."); - c->Message(0, "#instance remove instance_id player_name - removes the player 'player_name' from the " + c->Message(Chat::White, "#instance remove instance_id player_name - removes the player 'player_name' from the " "instance with id matching instance_id."); - c->Message(0, "#instance list player_name - lists all the instances 'player_name' is apart of."); + c->Message(Chat::White, "#instance list player_name - lists all the instances 'player_name' is apart of."); return; } else if(strcasecmp(sep->arg[1], "create") == 0) { if(!sep->IsNumber(3) || !sep->IsNumber(4)) { - c->Message(0, "#instance create zone_id version duration - Creates an instance of version 'version' in the " + c->Message(Chat::White, "#instance create zone_id version duration - Creates an instance of version 'version' in the " "zone with id matching zone_id, will last for duration seconds."); return; } @@ -9450,42 +9450,42 @@ void command_instance(Client *c, const Seperator *sep) if(!zn) { - c->Message(0, "Zone with id %lu was not found by the server.", (unsigned long)zone_id); + c->Message(Chat::White, "Zone with id %lu was not found by the server.", (unsigned long)zone_id); return; } uint16 id = 0; if(!database.GetUnusedInstanceID(id)) { - c->Message(0, "Server was unable to find a free instance id."); + c->Message(Chat::White, "Server was unable to find a free instance id."); return; } if(!database.CreateInstance(id, zone_id, version, duration)) { - c->Message(0, "Server was unable to create a new instance."); + c->Message(Chat::White, "Server was unable to create a new instance."); return; } - c->Message(0, "New instance %s was created with id %lu.", zn, (unsigned long)id); + c->Message(Chat::White, "New instance %s was created with id %lu.", zn, (unsigned long)id); } else if(strcasecmp(sep->arg[1], "destroy") == 0) { if(!sep->IsNumber(2)) { - c->Message(0, "#instance destroy instance_id - Destroys the instance with id matching instance_id."); + c->Message(Chat::White, "#instance destroy instance_id - Destroys the instance with id matching instance_id."); return; } uint16 id = atoi(sep->arg[2]); database.DeleteInstance(id); - c->Message(0, "Destroyed instance with id %lu.", (unsigned long)id); + c->Message(Chat::White, "Destroyed instance with id %lu.", (unsigned long)id); } else if(strcasecmp(sep->arg[1], "add") == 0) { if(!sep->IsNumber(2)) { - c->Message(0, "#instance add instance_id player_name - adds the player 'player_name' to the instance " + c->Message(Chat::White, "#instance add instance_id player_name - adds the player 'player_name' to the instance " "with id matching instance_id."); return; } @@ -9495,13 +9495,13 @@ void command_instance(Client *c, const Seperator *sep) if(id <= 0 || charid <= 0) { - c->Message(0, "Must enter a valid instance id and player name."); + c->Message(Chat::White, "Must enter a valid instance id and player name."); return; } if(!database.CheckInstanceExists(id)) { - c->Message(0, "Instance does not exist."); + c->Message(Chat::White, "Instance does not exist."); return; } @@ -9512,23 +9512,23 @@ void command_instance(Client *c, const Seperator *sep) { if(database.AddClientToInstance(id, charid)) { - c->Message(0, "Added client to instance."); + c->Message(Chat::White, "Added client to instance."); } else { - c->Message(0, "Failed to add client to instance."); + c->Message(Chat::White, "Failed to add client to instance."); } } else { - c->Message(0, "Client was already saved to %u which has uses the same zone and version as that instance.", cur_id); + c->Message(Chat::White, "Client was already saved to %u which has uses the same zone and version as that instance.", cur_id); } } else if(strcasecmp(sep->arg[1], "remove") == 0) { if(!sep->IsNumber(2)) { - c->Message(0, "#instance remove instance_id player_name - removes the player 'player_name' from the " + c->Message(Chat::White, "#instance remove instance_id player_name - removes the player 'player_name' from the " "instance with id matching instance_id."); return; } @@ -9538,16 +9538,16 @@ void command_instance(Client *c, const Seperator *sep) if(id <= 0 || charid <= 0) { - c->Message(0, "Must enter a valid instance id and player name."); + c->Message(Chat::White, "Must enter a valid instance id and player name."); } if(database.RemoveClientFromInstance(id, charid)) { - c->Message(0, "Removed client from instance."); + c->Message(Chat::White, "Removed client from instance."); } else { - c->Message(0, "Failed to remove client from instance."); + c->Message(Chat::White, "Failed to remove client from instance."); } } else if(strcasecmp(sep->arg[1], "list") == 0) @@ -9557,7 +9557,7 @@ void command_instance(Client *c, const Seperator *sep) { if(c->GetTarget() == nullptr || (c->GetTarget() && !c->GetTarget()->IsClient())) { - c->Message(0, "Character not found."); + c->Message(Chat::White, "Character not found."); return; } else @@ -9568,16 +9568,16 @@ void command_instance(Client *c, const Seperator *sep) } else { - c->Message(0, "Invalid Argument."); - c->Message(0, "#instance usage:"); - c->Message(0, "#instance create zone_id version duration - Creates an instance of version 'version' in the " + c->Message(Chat::White, "Invalid Argument."); + c->Message(Chat::White, "#instance usage:"); + c->Message(Chat::White, "#instance create zone_id version duration - Creates an instance of version 'version' in the " "zone with id matching zone_id, will last for duration seconds."); - c->Message(0, "#instance destroy instance_id - Destroys the instance with id matching instance_id."); - c->Message(0, "#instance add instance_id player_name - adds the player 'player_name' to the instance " + c->Message(Chat::White, "#instance destroy instance_id - Destroys the instance with id matching instance_id."); + c->Message(Chat::White, "#instance add instance_id player_name - adds the player 'player_name' to the instance " "with id matching instance_id."); - c->Message(0, "#instance remove instance_id player_name - removes the player 'player_name' from the " + c->Message(Chat::White, "#instance remove instance_id player_name - removes the player 'player_name' from the " "instance with id matching instance_id."); - c->Message(0, "#instance list player_name - lists all the instances 'player_name' is apart of."); + c->Message(Chat::White, "#instance list player_name - lists all the instances 'player_name' is apart of."); return; } } @@ -9589,8 +9589,8 @@ void command_setstartzone(Client *c, const Seperator *sep) if(c->GetTarget() && c->GetTarget()->IsClient() && sep->arg[1][0] != 0) target = c->GetTarget()->CastToClient(); else { - c->Message(0, "Usage: (needs PC target) #setstartzone zonename"); - c->Message(0, "Optional Usage: Use '#setstartzone reset' or '#setstartzone 0' to clear a starting zone. Player can select a starting zone using /setstartcity"); + c->Message(Chat::White, "Usage: (needs PC target) #setstartzone zonename"); + c->Message(Chat::White, "Optional Usage: Use '#setstartzone reset' or '#setstartzone 0' to clear a starting zone. Player can select a starting zone using /setstartcity"); return; } @@ -9603,7 +9603,7 @@ void command_setstartzone(Client *c, const Seperator *sep) else { startzone = database.GetZoneID(sep->arg[1]); if(startzone == 0) { - c->Message(0, "Unable to locate zone '%s'", sep->arg[1]); + c->Message(Chat::White, "Unable to locate zone '%s'", sep->arg[1]); return; } } @@ -9622,7 +9622,7 @@ void command_netstats(Client *c, const Seperator *sep) if (strcasecmp(sep->arg[1], "reset") == 0) { auto connection = c->Connection(); - c->Message(0, "Resetting client stats (packet loss will not read correctly after reset)."); + c->Message(Chat::White, "Resetting client stats (packet loss will not read correctly after reset)."); connection->ResetStats(); return; } @@ -9634,58 +9634,58 @@ void command_netstats(Client *c, const Seperator *sep) auto now = EQ::Net::Clock::now(); auto sec_since_stats_reset = std::chrono::duration_cast>(now - stats.created).count(); - c->Message(0, "Netstats:"); - c->Message(0, "--------------------------------------------------------------------"); - c->Message(0, "Sent Bytes: %u (%.2f/sec)", stats.sent_bytes, stats.sent_bytes / sec_since_stats_reset); - c->Message(0, "Recv Bytes: %u (%.2f/sec)", stats.recv_bytes, stats.recv_bytes / sec_since_stats_reset); - c->Message(0, "Bytes Before Encode (Sent): %u, Compression Rate: %.2f%%", stats.bytes_before_encode, + c->Message(Chat::White, "Netstats:"); + c->Message(Chat::White, "--------------------------------------------------------------------"); + c->Message(Chat::White, "Sent Bytes: %u (%.2f/sec)", stats.sent_bytes, stats.sent_bytes / sec_since_stats_reset); + c->Message(Chat::White, "Recv Bytes: %u (%.2f/sec)", stats.recv_bytes, stats.recv_bytes / sec_since_stats_reset); + c->Message(Chat::White, "Bytes Before Encode (Sent): %u, Compression Rate: %.2f%%", stats.bytes_before_encode, static_cast(stats.bytes_before_encode - stats.sent_bytes) / static_cast(stats.bytes_before_encode) * 100.0); - c->Message(0, "Bytes After Decode (Recv): %u, Compression Rate: %.2f%%", stats.bytes_after_decode, + c->Message(Chat::White, "Bytes After Decode (Recv): %u, Compression Rate: %.2f%%", stats.bytes_after_decode, static_cast(stats.bytes_after_decode - stats.recv_bytes) / static_cast(stats.bytes_after_decode) * 100.0); - c->Message(0, "Min Ping: %u", stats.min_ping); - c->Message(0, "Max Ping: %u", stats.max_ping); - c->Message(0, "Last Ping: %u", stats.last_ping); - c->Message(0, "Average Ping: %u", stats.avg_ping); - c->Message(0, "--------------------------------------------------------------------"); - c->Message(0, "(Realtime) Recv Packets: %u (%.2f/sec)", stats.recv_packets, stats.recv_packets / sec_since_stats_reset); - c->Message(0, "(Realtime) Sent Packets: %u (%.2f/sec)", stats.sent_packets, stats.sent_packets / sec_since_stats_reset); - c->Message(0, "(Sync) Recv Packets: %u", stats.sync_recv_packets); - c->Message(0, "(Sync) Sent Packets: %u", stats.sync_sent_packets); - c->Message(0, "(Sync) Remote Recv Packets: %u", stats.sync_remote_recv_packets); - c->Message(0, "(Sync) Remote Sent Packets: %u", stats.sync_remote_sent_packets); - c->Message(0, "Packet Loss In: %.2f%%", 100.0 * (1.0 - static_cast(stats.sync_recv_packets) / static_cast(stats.sync_remote_sent_packets))); - c->Message(0, "Packet Loss Out: %.2f%%", 100.0 * (1.0 - static_cast(stats.sync_remote_recv_packets) / static_cast(stats.sync_sent_packets))); - c->Message(0, "--------------------------------------------------------------------"); - c->Message(0, "Resent Packets: %u (%.2f/sec)", stats.resent_packets, stats.resent_packets / sec_since_stats_reset); - c->Message(0, "Resent Fragments: %u (%.2f/sec)", stats.resent_fragments, stats.resent_fragments / sec_since_stats_reset); - c->Message(0, "Resent Non-Fragments: %u (%.2f/sec)", stats.resent_full, stats.resent_full / sec_since_stats_reset); - c->Message(0, "Dropped Datarate Packets: %u (%.2f/sec)", stats.dropped_datarate_packets, stats.dropped_datarate_packets / sec_since_stats_reset); + c->Message(Chat::White, "Min Ping: %u", stats.min_ping); + c->Message(Chat::White, "Max Ping: %u", stats.max_ping); + c->Message(Chat::White, "Last Ping: %u", stats.last_ping); + c->Message(Chat::White, "Average Ping: %u", stats.avg_ping); + c->Message(Chat::White, "--------------------------------------------------------------------"); + c->Message(Chat::White, "(Realtime) Recv Packets: %u (%.2f/sec)", stats.recv_packets, stats.recv_packets / sec_since_stats_reset); + c->Message(Chat::White, "(Realtime) Sent Packets: %u (%.2f/sec)", stats.sent_packets, stats.sent_packets / sec_since_stats_reset); + c->Message(Chat::White, "(Sync) Recv Packets: %u", stats.sync_recv_packets); + c->Message(Chat::White, "(Sync) Sent Packets: %u", stats.sync_sent_packets); + c->Message(Chat::White, "(Sync) Remote Recv Packets: %u", stats.sync_remote_recv_packets); + c->Message(Chat::White, "(Sync) Remote Sent Packets: %u", stats.sync_remote_sent_packets); + c->Message(Chat::White, "Packet Loss In: %.2f%%", 100.0 * (1.0 - static_cast(stats.sync_recv_packets) / static_cast(stats.sync_remote_sent_packets))); + c->Message(Chat::White, "Packet Loss Out: %.2f%%", 100.0 * (1.0 - static_cast(stats.sync_remote_recv_packets) / static_cast(stats.sync_sent_packets))); + c->Message(Chat::White, "--------------------------------------------------------------------"); + c->Message(Chat::White, "Resent Packets: %u (%.2f/sec)", stats.resent_packets, stats.resent_packets / sec_since_stats_reset); + c->Message(Chat::White, "Resent Fragments: %u (%.2f/sec)", stats.resent_fragments, stats.resent_fragments / sec_since_stats_reset); + c->Message(Chat::White, "Resent Non-Fragments: %u (%.2f/sec)", stats.resent_full, stats.resent_full / sec_since_stats_reset); + c->Message(Chat::White, "Dropped Datarate Packets: %u (%.2f/sec)", stats.dropped_datarate_packets, stats.dropped_datarate_packets / sec_since_stats_reset); if (opts.daybreak_options.outgoing_data_rate > 0.0) { - c->Message(0, "Outgoing Link Saturation %.2f%% (%.2fkb/sec)", 100.0 * (1.0 - ((opts.daybreak_options.outgoing_data_rate - stats.datarate_remaining) / opts.daybreak_options.outgoing_data_rate)), opts.daybreak_options.outgoing_data_rate); + c->Message(Chat::White, "Outgoing Link Saturation %.2f%% (%.2fkb/sec)", 100.0 * (1.0 - ((opts.daybreak_options.outgoing_data_rate - stats.datarate_remaining) / opts.daybreak_options.outgoing_data_rate)), opts.daybreak_options.outgoing_data_rate); } if (strcasecmp(sep->arg[1], "full") == 0) { - c->Message(0, "--------------------------------------------------------------------"); - c->Message(0, "Sent Packet Types"); + c->Message(Chat::White, "--------------------------------------------------------------------"); + c->Message(Chat::White, "Sent Packet Types"); for (auto i = 0; i < _maxEmuOpcode; ++i) { auto cnt = eqs_stats.SentCount[i]; if (cnt > 0) { - c->Message(0, "%s: %u (%.2f / sec)", OpcodeNames[i], cnt, cnt / sec_since_stats_reset); + c->Message(Chat::White, "%s: %u (%.2f / sec)", OpcodeNames[i], cnt, cnt / sec_since_stats_reset); } } - c->Message(0, "--------------------------------------------------------------------"); - c->Message(0, "Recv Packet Types"); + c->Message(Chat::White, "--------------------------------------------------------------------"); + c->Message(Chat::White, "Recv Packet Types"); for (auto i = 0; i < _maxEmuOpcode; ++i) { auto cnt = eqs_stats.RecvCount[i]; if (cnt > 0) { - c->Message(0, "%s: %u (%.2f / sec)", OpcodeNames[i], cnt, cnt / sec_since_stats_reset); + c->Message(Chat::White, "%s: %u (%.2f / sec)", OpcodeNames[i], cnt, cnt / sec_since_stats_reset); } } } - c->Message(0, "--------------------------------------------------------------------"); + c->Message(Chat::White, "--------------------------------------------------------------------"); } } @@ -9698,7 +9698,7 @@ void command_object(Client *c, const Seperator *sep) const char *usage_string = "Usage: #object List|Add|Edit|Move|Rotate|Save|Copy|Delete|Undo"; if ((!sep) || (sep->argnum == 0)) { - c->Message(0, usage_string); + c->Message(Chat::White, usage_string); return; } @@ -9731,7 +9731,7 @@ void command_object(Client *c, const Seperator *sep) // Insufficient or invalid args if ((sep->argnum < 2) || (sep->arg[2][0] < '0') || ((sep->arg[2][0] > '9') && ((sep->arg[2][0] & 0xDF) != 'A'))) { - c->Message(0, "Usage: #object List All|(radius)"); + c->Message(Chat::White, "Usage: #object List All|(radius)"); return; } @@ -9741,9 +9741,9 @@ void command_object(Client *c, const Seperator *sep) radius = 500; // Invalid radius. Default to 500 units. if (radius == 0) - c->Message(0, "Objects within this zone:"); + c->Message(Chat::White, "Objects within this zone:"); else - c->Message(0, "Objects within %u units of your current location:", radius); + c->Message(Chat::White, "Objects within %u units of your current location:", radius); std::string query; if (radius) @@ -9768,7 +9768,7 @@ void command_object(Client *c, const Seperator *sep) auto results = database.QueryDatabase(query); if (!results.Success()) { - c->Message(0, "Error in objects query"); + c->Message(Chat::White, "Error in objects query"); return; } @@ -9795,27 +9795,27 @@ void command_object(Client *c, const Seperator *sep) if (od.size == 0) // Unknown08 field is optional Size parameter for static objects od.size = 100; // Static object default Size is 100% - c->Message(0, "- STATIC Object (%s): id %u, x %.1f, y %.1f, z %.1f, h %.1f, model %s, " + c->Message(Chat::White, "- STATIC Object (%s): id %u, x %.1f, y %.1f, z %.1f, h %.1f, model %s, " "size %u, solidtype %u, incline %u", (od.object_type == 0) ? "locked" : "unlocked", id, od.x, od.y, od.z, od.heading, od.object_name, od.size, od.solidtype, od.unknown020); break; case OT_DROPPEDITEM: // Ground Spawn - c->Message(0, "- TEMPORARY Object: id %u, x %.1f, y %.1f, z %.1f, h %.1f, itemid %u, " + c->Message(Chat::White, "- TEMPORARY Object: id %u, x %.1f, y %.1f, z %.1f, h %.1f, itemid %u, " "model %s, icon %u", id, od.x, od.y, od.z, od.heading, itemid, od.object_name, icon); break; default: // All others == Tradeskill Objects - c->Message(0, "- TRADESKILL Object: id %u, x %.1f, y %.1f, z %.1f, h %.1f, model %s, " + c->Message(Chat::White, "- TRADESKILL Object: id %u, x %.1f, y %.1f, z %.1f, h %.1f, model %s, " "type %u, icon %u", id, od.x, od.y, od.z, od.heading, od.object_name, od.object_type, icon); break; } } - c->Message(0, "%u object%s found", results.RowCount(), (results.RowCount() == 1) ? "" : "s"); + c->Message(Chat::White, "%u object%s found", results.RowCount(), (results.RowCount() == 1) ? "" : "s"); return; } @@ -9823,10 +9823,10 @@ void command_object(Client *c, const Seperator *sep) // Insufficient or invalid arguments if ((sep->argnum < 3) || ((sep->arg[3][0] == '\0') && (sep->arg[4][0] < '0') && (sep->arg[4][0] > '9'))) { - c->Message(0, "Usage: (Static Object): #object Add [ObjectID] 0 Model [SizePercent] " + c->Message(Chat::White, "Usage: (Static Object): #object Add [ObjectID] 0 Model [SizePercent] " "[SolidType] [Incline]"); - c->Message(0, "Usage: (Tradeskill Object): #object Add [ObjectID] TypeNum Model Icon"); - c->Message(0, "- Notes: Model must start with a letter, max length 16. SolidTypes = 0 (Solid), " + c->Message(Chat::White, "Usage: (Tradeskill Object): #object Add [ObjectID] TypeNum Model Icon"); + c->Message(Chat::White, "- Notes: Model must start with a letter, max length 16. SolidTypes = 0 (Solid), " "1 (Sometimes Non-Solid)"); return; } @@ -9868,7 +9868,7 @@ void command_object(Client *c, const Seperator *sep) break; case 1: // Ground Spawn - c->Message(0, "ERROR: Object Type 1 is used for temporarily spawned ground spawns and dropped " + c->Message(Chat::White, "ERROR: Object Type 1 is used for temporarily spawned ground spawns and dropped " "items, which are not supported with #object. See the 'ground_spawns' table in " "the database."); return; @@ -9877,7 +9877,7 @@ void command_object(Client *c, const Seperator *sep) icon = ((sep->argnum - col) > 3) ? atoi(sep->arg[4 + col]) : 0; if (icon == 0) { - c->Message(0, "ERROR: Required property 'Icon' not specified for Tradeskill Object"); + c->Message(Chat::White, "ERROR: Required property 'Icon' not specified for Tradeskill Object"); return; } @@ -9906,7 +9906,7 @@ void command_object(Client *c, const Seperator *sep) id = 0; if (id == 0) { - c->Message(0, "ERROR: An object already exists with the id %u", atoi(sep->arg[2])); + c->Message(Chat::White, "ERROR: An object already exists with the id %u", atoi(sep->arg[2])); return; } } @@ -9934,7 +9934,7 @@ void command_object(Client *c, const Seperator *sep) objectsFound = 1; if (objectsFound) { - c->Message(0, "ERROR: Object already at this location."); + c->Message(Chat::White, "ERROR: Object already at this location."); return; } @@ -9955,7 +9955,7 @@ void command_object(Client *c, const Seperator *sep) strupr(od.object_name); // Model names are always upper-case. if ((od.object_name[0] < 'A') || (od.object_name[0] > 'Z')) { - c->Message(0, "ERROR: Model name must start with a letter."); + c->Message(Chat::White, "ERROR: Model name must start with a letter."); return; } @@ -9996,13 +9996,13 @@ void command_object(Client *c, const Seperator *sep) y2 = 10.0f * cos(c->GetHeading() / 256.0f * 3.14159265f); c->MovePC(c->GetX() - x2, c->GetY() - y2, c->GetZ(), c->GetHeading()); - c->Message(0, "Spawning object with tentative id %u at location (%.1f, %.1f, %.1f heading %.1f). Use " + c->Message(Chat::White, "Spawning object with tentative id %u at location (%.1f, %.1f, %.1f heading %.1f). Use " "'#object Save' to save to database when satisfied with placement.", id, od.x, od.y, od.z, od.heading); // Temporary Static Object if (od.object_type == staticType) - c->Message(0, "- Note: Static Object will act like a tradeskill container and will not reflect " + c->Message(Chat::White, "- Note: Static Object will act like a tradeskill container and will not reflect " "size, solidtype, or incline values until you commit with '#object Save', after " "which it will be unchangeable until you use '#object Edit' and zone back in."); @@ -10012,9 +10012,9 @@ void command_object(Client *c, const Seperator *sep) if (strcasecmp(sep->arg[1], "edit") == 0) { if ((sep->argnum < 2) || ((id = atoi(sep->arg[2])) < 1)) { - c->Message(0, "Usage: #object Edit (ObjectID) [PropertyName] [NewValue]"); - c->Message(0, "- Static Object (Type 0) Properties: model, type, size, solidtype, incline"); - c->Message(0, "- Tradeskill Object (Type 2+) Properties: model, type, icon"); + c->Message(Chat::White, "Usage: #object Edit (ObjectID) [PropertyName] [NewValue]"); + c->Message(Chat::White, "- Static Object (Type 0) Properties: model, type, size, solidtype, incline"); + c->Message(Chat::White, "- Tradeskill Object (Type 2+) Properties: model, type, icon"); return; } @@ -10026,7 +10026,7 @@ void command_object(Client *c, const Seperator *sep) // Yep, looks like we can make real-time changes. if (sep->argnum < 4) { // Or not. '#object Edit (ObjectID)' called without PropertyName and NewValue - c->Message(0, "Note: Object %u already unlocked and ready for changes", id); + c->Message(Chat::White, "Note: Object %u already unlocked and ready for changes", id); return; } } else { @@ -10034,7 +10034,7 @@ void command_object(Client *c, const Seperator *sep) std::string query = StringFormat("SELECT zoneid, version, type FROM object WHERE id = %u", id); auto results = database.QueryDatabase(query); if (!results.Success() || results.RowCount() == 0) { - c->Message(0, "ERROR: Object %u not found", id); + c->Message(Chat::White, "ERROR: Object %u not found", id); return; } @@ -10046,13 +10046,13 @@ void command_object(Client *c, const Seperator *sep) // Object not in this zone? if (od.zone_id != zone->GetZoneID()) { - c->Message(0, "ERROR: Object %u not in this zone.", id); + c->Message(Chat::White, "ERROR: Object %u not in this zone.", id); return; } // Object not in this instance? if (od.zone_instance != zone->GetInstanceVersion()) { - c->Message(0, "ERROR: Object %u not part of this instance version.", id); + c->Message(Chat::White, "ERROR: Object %u not part of this instance version.", id); return; } @@ -10063,23 +10063,23 @@ void command_object(Client *c, const Seperator *sep) database.QueryDatabase(query); - c->Message(0, "Static Object %u unlocked for editing. You must zone out and back in to " + c->Message(Chat::White, "Static Object %u unlocked for editing. You must zone out and back in to " "make your changes, then commit them with '#object Save'.", id); if (sep->argnum >= 4) - c->Message(0, "NOTE: The change you specified has not been applied, since the " + c->Message(Chat::White, "NOTE: The change you specified has not been applied, since the " "static object had not been unlocked for editing yet."); return; case OT_DROPPEDITEM: - c->Message(0, "ERROR: Object %u is a temporarily spawned ground spawn or dropped item, " + c->Message(Chat::White, "ERROR: Object %u is a temporarily spawned ground spawn or dropped item, " "which cannot be manipulated with #object. See the 'ground_spawns' table " "in the database.", id); return; case staticType: - c->Message(0, "ERROR: Object %u has been unlocked for editing, but you must zone out " + c->Message(Chat::White, "ERROR: Object %u has been unlocked for editing, but you must zone out " "and back in for your client to refresh its object table before you can " "make changes to it.", id); @@ -10087,7 +10087,7 @@ void command_object(Client *c, const Seperator *sep) default: // Unknown error preventing us from seeing the object in the zone. - c->Message(0, "ERROR: Unknown problem attempting to manipulate object %u", id); + c->Message(Chat::White, "ERROR: Unknown problem attempting to manipulate object %u", id); return; } } @@ -10104,7 +10104,7 @@ void command_object(Client *c, const Seperator *sep) if (strcmp(sep->arg[3], "model") == 0) { if ((sep->arg[4][0] < 'A') || (sep->arg[4][0] > 'Z')) { - c->Message(0, "ERROR: Model names must begin with a letter."); + c->Message(Chat::White, "ERROR: Model names must begin with a letter."); return; } @@ -10112,10 +10112,10 @@ void command_object(Client *c, const Seperator *sep) o->SetObjectData(&od); - c->Message(0, "Object %u now being rendered with model '%s'", id, od.object_name); + c->Message(Chat::White, "Object %u now being rendered with model '%s'", id, od.object_name); } else if (strcmp(sep->arg[3], "type") == 0) { if ((sep->arg[4][0] < '0') || (sep->arg[4][0] > '9')) { - c->Message(0, "ERROR: Invalid type number"); + c->Message(Chat::White, "ERROR: Invalid type number"); return; } @@ -10125,20 +10125,20 @@ void command_object(Client *c, const Seperator *sep) case 0: // Convert Static Object to temporary changeable type od.object_type = staticType; - c->Message(0, "Note: Static Object will still act like tradeskill object and will not " + c->Message(Chat::White, "Note: Static Object will still act like tradeskill object and will not " "reflect size, solidtype, or incline settings until committed to the " "database with '#object Save', after which it will be unchangeable until " "it is unlocked again with '#object Edit'."); break; case OT_DROPPEDITEM: - c->Message(0, "ERROR: Object Type 1 is used for temporarily spawned ground spawns and " + c->Message(Chat::White, "ERROR: Object Type 1 is used for temporarily spawned ground spawns and " "dropped items, which are not supported with #object. See the " "'ground_spawns' table in the database."); return; default: - c->Message(0, "Object %u changed to Tradeskill Object Type %u", id, od.object_type); + c->Message(Chat::White, "Object %u changed to Tradeskill Object Type %u", id, od.object_type); break; } @@ -10152,7 +10152,7 @@ void command_object(Client *c, const Seperator *sep) } if ((sep->arg[4][0] < '0') || (sep->arg[4][0] > '9')) { - c->Message(0, "ERROR: Invalid size specified. Please enter a number."); + c->Message(Chat::White, "ERROR: Invalid size specified. Please enter a number."); return; } @@ -10162,47 +10162,47 @@ void command_object(Client *c, const Seperator *sep) if (od.size == 0) // 0 == unspecified == 100% od.size = 100; - c->Message(0, "Static Object %u set to %u%% size. Size will take effect when you commit to the " + c->Message(Chat::White, "Static Object %u set to %u%% size. Size will take effect when you commit to the " "database with '#object Save', after which the object will be unchangeable until " "you unlock it again with '#object Edit' and zone out and back in.", id, od.size); } else if (strcmp(sep->arg[3], "solidtype") == 0) { if (od.object_type != staticType) { - c->Message(0, "ERROR: Object %u is not a Static Object and does not support the " + c->Message(Chat::White, "ERROR: Object %u is not a Static Object and does not support the " "SolidType property", id); return; } if ((sep->arg[4][0] < '0') || (sep->arg[4][0] > '9')) { - c->Message(0, "ERROR: Invalid solidtype specified. Please enter a number."); + c->Message(Chat::White, "ERROR: Invalid solidtype specified. Please enter a number."); return; } od.solidtype = atoi(sep->arg[4]); o->SetObjectData(&od); - c->Message(0, "Static Object %u set to SolidType %u. Change will take effect when you commit " + c->Message(Chat::White, "Static Object %u set to SolidType %u. Change will take effect when you commit " "to the database with '#object Save'. Support for this property is on a " "per-model basis, mostly seen in smaller objects such as chests and tables.", id, od.solidtype); } else if (strcmp(sep->arg[3], "icon") == 0) { if ((od.object_type < 2) || (od.object_type == staticType)) { - c->Message(0, "ERROR: Object %u is not a Tradeskill Object and does not support the " + c->Message(Chat::White, "ERROR: Object %u is not a Tradeskill Object and does not support the " "Icon property", id); return; } if ((icon = atoi(sep->arg[4])) == 0) { - c->Message(0, "ERROR: Invalid Icon specified. Please enter an icon number."); + c->Message(Chat::White, "ERROR: Invalid Icon specified. Please enter an icon number."); return; } o->SetIcon(icon); - c->Message(0, "Tradeskill Object %u icon set to %u", id, icon); + c->Message(Chat::White, "Tradeskill Object %u icon set to %u", id, icon); } else if (strcmp(sep->arg[3], "incline") == 0) { if (od.object_type != staticType) { c->Message( @@ -10222,12 +10222,12 @@ void command_object(Client *c, const Seperator *sep) od.unknown020 = atoi(sep->arg[4]); o->SetObjectData(&od); - c->Message(0, "Static Object %u set to %u incline. Incline will take effect when you commit to " + c->Message(Chat::White, "Static Object %u set to %u incline. Incline will take effect when you commit to " "the database with '#object Save', after which the object will be unchangeable " "until you unlock it again with '#object Edit' and zone out and back in.", id, od.unknown020); } else { - c->Message(0, "ERROR: Unrecognized property name: %s", sep->arg[3]); + c->Message(Chat::White, "ERROR: Unrecognized property name: %s", sep->arg[3]); return; } @@ -10250,7 +10250,7 @@ void command_object(Client *c, const Seperator *sep) ((id = atoi(sep->arg[2])) == 0) || // ID not specified (((sep->arg[3][0] < '0') || (sep->arg[3][0] > '9')) && ((sep->arg[3][0] & 0xDF) != 'T') && (sep->arg[3][0] != '-') && (sep->arg[3][0] != '.'))) { // Location argument not specified correctly - c->Message(0, "Usage: #object Move (ObjectID) ToMe|(x y z [h])"); + c->Message(Chat::White, "Usage: #object Move (ObjectID) ToMe|(x y z [h])"); return; } @@ -10258,7 +10258,7 @@ void command_object(Client *c, const Seperator *sep) std::string query = StringFormat("SELECT zoneid, version, type FROM object WHERE id = %u", id); auto results = database.QueryDatabase(query); if (!results.Success() || results.RowCount() == 0) { - c->Message(0, "ERROR: Object %u not found", id); + c->Message(Chat::White, "ERROR: Object %u not found", id); return; } @@ -10268,38 +10268,38 @@ void command_object(Client *c, const Seperator *sep) od.object_type = atoi(row[2]); if (od.zone_id != zone->GetZoneID()) { - c->Message(0, "ERROR: Object %u is not in this zone", id); + c->Message(Chat::White, "ERROR: Object %u is not in this zone", id); return; } if (od.zone_instance != zone->GetInstanceVersion()) { - c->Message(0, "ERROR: Object %u is not in this instance version", id); + c->Message(Chat::White, "ERROR: Object %u is not in this instance version", id); return; } switch (od.object_type) { case 0: - c->Message(0, "ERROR: Object %u is not yet unlocked for editing. Use '#object Edit' " + c->Message(Chat::White, "ERROR: Object %u is not yet unlocked for editing. Use '#object Edit' " "then zone out and back in to move it.", id); return; case staticType: - c->Message(0, "ERROR: Object %u has been unlocked for editing, but you must zone out " + c->Message(Chat::White, "ERROR: Object %u has been unlocked for editing, but you must zone out " "and back in before your client sees the change and will allow you to " "move it.", id); return; case 1: - c->Message(0, "ERROR: Object %u is a temporary spawned object and cannot be " + c->Message(Chat::White, "ERROR: Object %u is a temporary spawned object and cannot be " "manipulated with #object. See the 'ground_spawns' table in the " "database.", id); return; default: - c->Message(0, "ERROR: Object %u not located in zone.", id); + c->Message(Chat::White, "ERROR: Object %u not located in zone.", id); return; } } @@ -10354,12 +10354,12 @@ void command_object(Client *c, const Seperator *sep) if (strcasecmp(sep->arg[1], "rotate") == 0) { // Insufficient or invalid arguments if ((sep->argnum < 3) || ((id = atoi(sep->arg[2])) == 0)) { - c->Message(0, "Usage: #object Rotate (ObjectID) (Heading, 0-512)"); + c->Message(Chat::White, "Usage: #object Rotate (ObjectID) (Heading, 0-512)"); return; } if ((o = entity_list.FindObject(id)) == nullptr) { - c->Message(0, "ERROR: Object %u not found in zone, or is a static object not yet unlocked with " + c->Message(Chat::White, "ERROR: Object %u not found in zone, or is a static object not yet unlocked with " "'#object Edit' for editing.", id); return; @@ -10383,7 +10383,7 @@ void command_object(Client *c, const Seperator *sep) if (strcasecmp(sep->arg[1], "save") == 0) { // Insufficient or invalid arguments if ((sep->argnum < 2) || ((id = atoi(sep->arg[2])) == 0)) { - c->Message(0, "Usage: #object Save (ObjectID)"); + c->Message(Chat::White, "Usage: #object Save (ObjectID)"); return; } @@ -10411,36 +10411,36 @@ void command_object(Client *c, const Seperator *sep) // Object not found in zone. Can't save an object we can't see. if (bNewObject) { - c->Message(0, "ERROR: Object %u not found", id); + c->Message(Chat::White, "ERROR: Object %u not found", id); return; } if (od.zone_id != zone->GetZoneID()) { - c->Message(0, "ERROR: Wrong Object ID. %u is not part of this zone.", id); + c->Message(Chat::White, "ERROR: Wrong Object ID. %u is not part of this zone.", id); return; } if (od.zone_instance != zone->GetInstanceVersion()) { - c->Message(0, "ERROR: Wrong Object ID. %u is not part of this instance version.", id); + c->Message(Chat::White, "ERROR: Wrong Object ID. %u is not part of this instance version.", id); return; } if (od.object_type == 0) { - c->Message(0, "ERROR: Static Object %u has already been committed. Use '#object Edit " + c->Message(Chat::White, "ERROR: Static Object %u has already been committed. Use '#object Edit " "%u' and zone out and back in to make changes.", id, id); return; } if (od.object_type == 1) { - c->Message(0, "ERROR: Object %u is a temporarily spawned ground spawn or dropped item, " + c->Message(Chat::White, "ERROR: Object %u is a temporarily spawned ground spawn or dropped item, " "which is not supported with #object. See the 'ground_spawns' table in " "the database.", id); return; } - c->Message(0, "ERROR: Object %u not found.", id); + c->Message(Chat::White, "ERROR: Object %u not found.", id); return; } @@ -10493,28 +10493,28 @@ void command_object(Client *c, const Seperator *sep) results = database.QueryDatabase(query); if (!results.Success()) { - c->Message(0, "Database Error: %s", results.ErrorMessage().c_str()); + c->Message(Chat::White, "Database Error: %s", results.ErrorMessage().c_str()); return; } if (results.RowsAffected() == 0) { // No change made, but no error message given - c->Message(0, "Database Error: Could not save change to Object %u", id); + c->Message(Chat::White, "Database Error: Could not save change to Object %u", id); return; } if (bNewObject) { if (newid == results.LastInsertedID()) { - c->Message(0, "Saved new Object %u to database", id); + c->Message(Chat::White, "Saved new Object %u to database", id); return; } - c->Message(0, "Saved Object. NOTE: Database returned a new ID number for object: %u", newid); + c->Message(Chat::White, "Saved Object. NOTE: Database returned a new ID number for object: %u", newid); id = newid; return; } - c->Message(0, "Saved changes to Object %u", id); + c->Message(Chat::White, "Saved changes to Object %u", id); newid = id; if (od.object_type == 0) { @@ -10588,7 +10588,7 @@ void command_object(Client *c, const Seperator *sep) entity_list.QueueClients(0, app); safe_delete(app); - c->Message(0, "NOTE: Object %u is now a static object, and is unchangeable. To make future " + c->Message(Chat::White, "NOTE: Object %u is now a static object, and is unchangeable. To make future " "changes, use '#object Edit' to convert it to a changeable form, then zone out " "and back in.", id); @@ -10600,15 +10600,15 @@ void command_object(Client *c, const Seperator *sep) // Insufficient or invalid arguments if ((sep->argnum < 3) || (((sep->arg[2][0] & 0xDF) != 'A') && ((sep->arg[2][0] < '0') || (sep->arg[2][0] > '9')))) { - c->Message(0, "Usage: #object Copy All|(ObjectID) (InstanceVersion)"); - c->Message(0, "- Note: Only objects saved in the database can be copied to another instance."); + c->Message(Chat::White, "Usage: #object Copy All|(ObjectID) (InstanceVersion)"); + c->Message(Chat::White, "- Note: Only objects saved in the database can be copied to another instance."); return; } od.zone_instance = atoi(sep->arg[3]); if (od.zone_instance == zone->GetInstanceVersion()) { - c->Message(0, "ERROR: Source and destination instance versions are the same."); + c->Message(Chat::White, "ERROR: Source and destination instance versions are the same."); return; } @@ -10625,11 +10625,11 @@ void command_object(Client *c, const Seperator *sep) od.zone_instance, zone->GetZoneID(), zone->GetInstanceVersion()); auto results = database.QueryDatabase(query); if (!results.Success()) { - c->Message(0, "Database Error: %s", results.ErrorMessage().c_str()); + c->Message(Chat::White, "Database Error: %s", results.ErrorMessage().c_str()); return; } - c->Message(0, "Copied %u object%s into instance version %u", results.RowCount(), + c->Message(Chat::White, "Copied %u object%s into instance version %u", results.RowCount(), (results.RowCount() == 1) ? "" : "s", od.zone_instance); return; } @@ -10645,7 +10645,7 @@ void command_object(Client *c, const Seperator *sep) od.zone_instance, id, zone->GetZoneID(), zone->GetInstanceVersion()); auto results = database.QueryDatabase(query); if (results.Success() && results.RowsAffected() > 0) { - c->Message(0, "Copied Object %u into instance version %u", id, od.zone_instance); + c->Message(Chat::White, "Copied Object %u into instance version %u", id, od.zone_instance); return; } @@ -10653,7 +10653,7 @@ void command_object(Client *c, const Seperator *sep) // got an error message if (!results.Success()) { - c->Message(0, "Database Error: %s", results.ErrorMessage().c_str()); + c->Message(Chat::White, "Database Error: %s", results.ErrorMessage().c_str()); return; } @@ -10665,25 +10665,25 @@ void command_object(Client *c, const Seperator *sep) return; if (results.RowCount() == 0) { - c->Message(0, "ERROR: Object %u not found", id); + c->Message(Chat::White, "ERROR: Object %u not found", id); return; } auto row = results.begin(); // Wrong ZoneID? if (atoi(row[0]) != zone->GetZoneID()) { - c->Message(0, "ERROR: Object %u is not part of this zone.", id); + c->Message(Chat::White, "ERROR: Object %u is not part of this zone.", id); return; } // Wrong Instance Version? if (atoi(row[1]) != zone->GetInstanceVersion()) { - c->Message(0, "ERROR: Object %u is not part of this instance version.", id); + c->Message(Chat::White, "ERROR: Object %u is not part of this instance version.", id); return; } // Well, NO clue at this point. Just let 'em know something screwed up. - c->Message(0, "ERROR: Unknown database error copying Object %u to instance version %u", id, + c->Message(Chat::White, "ERROR: Unknown database error copying Object %u to instance version %u", id, od.zone_instance); return; } @@ -10691,7 +10691,7 @@ void command_object(Client *c, const Seperator *sep) if (strcasecmp(sep->arg[1], "delete") == 0) { if ((sep->argnum < 2) || ((id = atoi(sep->arg[2])) <= 0)) { - c->Message(0, "Usage: #object Delete (ObjectID) -- NOTE: Object deletions are permanent and " + c->Message(Chat::White, "Usage: #object Delete (ObjectID) -- NOTE: Object deletions are permanent and " "cannot be undone!"); return; } @@ -10715,7 +10715,7 @@ void command_object(Client *c, const Seperator *sep) id, zone->GetZoneID(), zone->GetInstanceVersion()); auto results = database.QueryDatabase(query); - c->Message(0, "Object %u deleted", id); + c->Message(Chat::White, "Object %u deleted", id); return; } @@ -10729,7 +10729,7 @@ void command_object(Client *c, const Seperator *sep) return; if (results.RowCount() == 0) { - c->Message(0, "ERROR: Object %u not found in this zone or instance!", id); + c->Message(Chat::White, "ERROR: Object %u not found in this zone or instance!", id); return; } @@ -10742,13 +10742,13 @@ void command_object(Client *c, const Seperator *sep) id, zone->GetZoneID(), zone->GetInstanceVersion()); results = database.QueryDatabase(query); - c->Message(0, "Object %u deleted. NOTE: This static object will remain for anyone currently in " + c->Message(Chat::White, "Object %u deleted. NOTE: This static object will remain for anyone currently in " "the zone until they next zone out and in.", id); return; case 1: // Temporary Spawn - c->Message(0, "ERROR: Object %u is a temporarily spawned ground spawn or dropped item, which " + c->Message(Chat::White, "ERROR: Object %u is a temporarily spawned ground spawn or dropped item, which " "is not supported with #object. See the 'ground_spawns' table in the database.", id); return; @@ -10760,7 +10760,7 @@ void command_object(Client *c, const Seperator *sep) if (strcasecmp(sep->arg[1], "undo") == 0) { // Insufficient or invalid arguments if ((sep->argnum < 2) || ((id = atoi(sep->arg[2])) == 0)) { - c->Message(0, "Usage: #object Undo (ObjectID) -- Reload object from database, undoing any " + c->Message(Chat::White, "Usage: #object Undo (ObjectID) -- Reload object from database, undoing any " "changes you have made"); return; } @@ -10768,13 +10768,13 @@ void command_object(Client *c, const Seperator *sep) o = entity_list.FindObject(id); if (!o) { - c->Message(0, "ERROR: Object %u not found in zone in a manipulable form. No changes to undo.", + c->Message(Chat::White, "ERROR: Object %u not found in zone in a manipulable form. No changes to undo.", id); return; } if (o->GetType() == OT_DROPPEDITEM) { - c->Message(0, "ERROR: Object %u is a temporary spawned item and cannot be manipulated with " + c->Message(Chat::White, "ERROR: Object %u is a temporary spawned item and cannot be manipulated with " "#object. See the 'ground_spawns' table in the database.", id); return; @@ -10794,7 +10794,7 @@ void command_object(Client *c, const Seperator *sep) id); auto results = database.QueryDatabase(query); if (!results.Success() || results.RowCount() == 0) { - c->Message(0, "Database Error: %s", results.ErrorMessage().c_str()); + c->Message(Chat::White, "Database Error: %s", results.ErrorMessage().c_str()); return; } @@ -10819,11 +10819,11 @@ void command_object(Client *c, const Seperator *sep) o = new Object(id, od.object_type, icon, od, nullptr); entity_list.AddObject(o, true); - c->Message(0, "Object %u reloaded from database.", id); + c->Message(Chat::White, "Object %u reloaded from database.", id); return; } - c->Message(0, usage_string); + c->Message(Chat::White, usage_string); } void command_showspellslist(Client *c, const Seperator *sep) @@ -10831,12 +10831,12 @@ void command_showspellslist(Client *c, const Seperator *sep) Mob *target = c->GetTarget(); if (!target) { - c->Message(0, "Must target an NPC."); + c->Message(Chat::White, "Must target an NPC."); return; } if (!target->IsNPC()) { - c->Message(0, "%s is not an NPC.", target->GetName()); + c->Message(Chat::White, "%s is not an NPC.", target->GetName()); return; } @@ -10848,7 +10848,7 @@ void command_showspellslist(Client *c, const Seperator *sep) void command_raidloot(Client *c, const Seperator *sep) { if(!sep->arg[1][0]) { - c->Message(0, "Usage: #raidloot [LEADER/GROUPLEADER/SELECTED/ALL]"); + c->Message(Chat::White, "Usage: #raidloot [LEADER/GROUPLEADER/SELECTED/ALL]"); return; } @@ -10861,7 +10861,7 @@ void command_raidloot(Client *c, const Seperator *sep) { if(r->members[x].IsRaidLeader == 0) { - c->Message(0, "You must be the raid leader to use this command."); + c->Message(Chat::White, "You must be the raid leader to use this command."); } else { @@ -10892,12 +10892,12 @@ void command_raidloot(Client *c, const Seperator *sep) } else { - c->Message(0, "Usage: #raidloot [LEADER/GROUPLEADER/SELECTED/ALL]"); + c->Message(Chat::White, "Usage: #raidloot [LEADER/GROUPLEADER/SELECTED/ALL]"); } } else { - c->Message(0, "You must be in a raid to use that command."); + c->Message(Chat::White, "You must be in a raid to use that command."); } } @@ -10905,7 +10905,7 @@ void command_emoteview(Client *c, const Seperator *sep) { if(!c->GetTarget() || !c->GetTarget()->IsNPC()) { - c->Message(0, "You must target a NPC to view their emotes."); + c->Message(Chat::White, "You must target a NPC to view their emotes."); return; } @@ -10921,22 +10921,22 @@ void command_emoteview(Client *c, const Seperator *sep) NPC_Emote_Struct* nes = iterator.GetData(); if(emoteid == nes->emoteid) { - c->Message(0, "EmoteID: %i Event: %i Type: %i Text: %s", nes->emoteid, nes->event_, nes->type, nes->text); + c->Message(Chat::White, "EmoteID: %i Event: %i Type: %i Text: %s", nes->emoteid, nes->event_, nes->type, nes->text); count++; } iterator.Advance(); } if (count == 0) - c->Message(0, "No emotes found."); + c->Message(Chat::White, "No emotes found."); else - c->Message(0, "%i emote(s) found", count); + c->Message(Chat::White, "%i emote(s) found", count); } } void command_emotesearch(Client *c, const Seperator *sep) { if (sep->arg[1][0] == 0) - c->Message(0, "Usage: #emotesearch [search string or emoteid]"); + c->Message(Chat::White, "Usage: #emotesearch [search string or emoteid]"); else { const char *search_criteria=sep->argplus[1]; @@ -10952,15 +10952,15 @@ void command_emotesearch(Client *c, const Seperator *sep) NPC_Emote_Struct* nes = iterator.GetData(); if(emoteid == nes->emoteid) { - c->Message(0, "EmoteID: %i Event: %i Type: %i Text: %s", nes->emoteid, nes->event_, nes->type, nes->text); + c->Message(Chat::White, "EmoteID: %i Event: %i Type: %i Text: %s", nes->emoteid, nes->event_, nes->type, nes->text); count++; } iterator.Advance(); } if (count == 0) - c->Message(0, "No emotes found."); + c->Message(Chat::White, "No emotes found."); else - c->Message(0, "%i emote(s) found", count); + c->Message(Chat::White, "%i emote(s) found", count); } else { @@ -10980,7 +10980,7 @@ void command_emotesearch(Client *c, const Seperator *sep) pdest = strstr(sText, sCriteria); if (pdest != nullptr) { - c->Message(0, "EmoteID: %i Event: %i Type: %i Text: %s", nes->emoteid, nes->event_, nes->type, nes->text); + c->Message(Chat::White, "EmoteID: %i Event: %i Type: %i Text: %s", nes->emoteid, nes->event_, nes->type, nes->text); count++; } if (count == 50) @@ -10989,9 +10989,9 @@ void command_emotesearch(Client *c, const Seperator *sep) iterator.Advance(); } if (count == 50) - c->Message(0, "50 emotes shown...too many results."); + c->Message(Chat::White, "50 emotes shown...too many results."); else - c->Message(0, "%i emote(s) found", count); + c->Message(Chat::White, "%i emote(s) found", count); } } } @@ -11000,7 +11000,7 @@ void command_reloademote(Client *c, const Seperator *sep) { zone->NPCEmoteList.Clear(); zone->LoadNPCEmotes(&zone->NPCEmoteList); - c->Message(0, "NPC emotes reloaded."); + c->Message(Chat::White, "NPC emotes reloaded."); } void command_globalview(Client *c, const Seperator *sep) @@ -11044,14 +11044,14 @@ void command_globalview(Client *c, const Seperator *sep) auto iter = globalMap.begin(); uint32 gcount = 0; - c->Message(0, "Name, Value"); + c->Message(Chat::White, "Name, Value"); while(iter != globalMap.end()) { - c->Message(0, "%s %s", (*iter).name.c_str(), (*iter).value.c_str()); + c->Message(Chat::White, "%s %s", (*iter).name.c_str(), (*iter).value.c_str()); ++iter; ++gcount; } - c->Message(0, "%u globals loaded.", gcount); + c->Message(Chat::White, "%u globals loaded.", gcount); } else { @@ -11077,14 +11077,14 @@ void command_globalview(Client *c, const Seperator *sep) auto iter = globalMap.begin(); uint32 gcount = 0; - c->Message(0, "Name, Value"); + c->Message(Chat::White, "Name, Value"); while(iter != globalMap.end()) { - c->Message(0, "%s %s", (*iter).name.c_str(), (*iter).value.c_str()); + c->Message(Chat::White, "%s %s", (*iter).name.c_str(), (*iter).value.c_str()); ++iter; ++gcount; } - c->Message(0, "%u globals loaded.", gcount); + c->Message(Chat::White, "%u globals loaded.", gcount); } } @@ -11092,7 +11092,7 @@ void command_distance(Client *c, const Seperator *sep) { if(c && c->GetTarget()) { Mob* target = c->GetTarget(); - c->Message(0, "Your target, %s, is %1.1f units from you.", c->GetTarget()->GetName(), Distance(c->GetPosition(), target->GetPosition())); + c->Message(Chat::White, "Your target, %s, is %1.1f units from you.", c->GetTarget()->GetName(), Distance(c->GetPosition(), target->GetPosition())); } } @@ -11136,24 +11136,24 @@ void command_max_all_skills(Client *c, const Seperator *sep) void command_showbonusstats(Client *c, const Seperator *sep) { if (c->GetTarget() == 0) - c->Message(0, "ERROR: No target!"); + c->Message(Chat::White, "ERROR: No target!"); else if (!c->GetTarget()->IsMob() && !c->GetTarget()->IsClient()) - c->Message(0, "ERROR: Target is not a Mob or Player!"); + c->Message(Chat::White, "ERROR: Target is not a Mob or Player!"); else { bool bAll = false; if(sep->arg[1][0] == '\0' || strcasecmp(sep->arg[1], "all") == 0) bAll = true; if (bAll || (strcasecmp(sep->arg[1], "item")==0)) { - c->Message(0, "Target Item Bonuses:"); - c->Message(0, " Accuracy: %i%% Divine Save: %i%%", c->GetTarget()->GetItemBonuses().Accuracy, c->GetTarget()->GetItemBonuses().DivineSaveChance); - c->Message(0, " Flurry: %i%% HitChance: %i%%", c->GetTarget()->GetItemBonuses().FlurryChance, c->GetTarget()->GetItemBonuses().HitChance / 15); + c->Message(Chat::White, "Target Item Bonuses:"); + c->Message(Chat::White, " Accuracy: %i%% Divine Save: %i%%", c->GetTarget()->GetItemBonuses().Accuracy, c->GetTarget()->GetItemBonuses().DivineSaveChance); + c->Message(Chat::White, " Flurry: %i%% HitChance: %i%%", c->GetTarget()->GetItemBonuses().FlurryChance, c->GetTarget()->GetItemBonuses().HitChance / 15); } if (bAll || (strcasecmp(sep->arg[1], "spell")==0)) { - c->Message(0, " Target Spell Bonuses:"); - c->Message(0, " Accuracy: %i%% Divine Save: %i%%", c->GetTarget()->GetSpellBonuses().Accuracy, c->GetTarget()->GetSpellBonuses().DivineSaveChance); - c->Message(0, " Flurry: %i%% HitChance: %i%% ", c->GetTarget()->GetSpellBonuses().FlurryChance, c->GetTarget()->GetSpellBonuses().HitChance / 15); + c->Message(Chat::White, " Target Spell Bonuses:"); + c->Message(Chat::White, " Accuracy: %i%% Divine Save: %i%%", c->GetTarget()->GetSpellBonuses().Accuracy, c->GetTarget()->GetSpellBonuses().DivineSaveChance); + c->Message(Chat::White, " Flurry: %i%% HitChance: %i%% ", c->GetTarget()->GetSpellBonuses().FlurryChance, c->GetTarget()->GetSpellBonuses().HitChance / 15); } - c->Message(0, " Effective Casting Level: %i", c->GetTarget()->GetCasterLevel(0)); + c->Message(Chat::White, " Effective Casting Level: %i", c->GetTarget()->GetCasterLevel(0)); } } @@ -11332,27 +11332,27 @@ void command_profanity(Client *c, const Seperator *sep) return; } - c->Message(0, "Usage: #profanity [list] - shows profanity list"); - c->Message(0, "Usage: #profanity [clear] - deletes all entries"); - c->Message(0, "Usage: #profanity [add] [] - adds entry"); - c->Message(0, "Usage: #profanity [del] [] - deletes entry"); - c->Message(0, "Usage: #profanity [reload] - reloads profanity list"); + c->Message(Chat::White, "Usage: #profanity [list] - shows profanity list"); + c->Message(Chat::White, "Usage: #profanity [clear] - deletes all entries"); + c->Message(Chat::White, "Usage: #profanity [add] [] - adds entry"); + c->Message(Chat::White, "Usage: #profanity [del] [] - deletes entry"); + c->Message(Chat::White, "Usage: #profanity [reload] - reloads profanity list"); } void command_mysql(Client *c, const Seperator *sep) { if(!sep->arg[1][0] || !sep->arg[2][0]) { - c->Message(0, "Usage: #mysql query \"Query here\""); + c->Message(Chat::White, "Usage: #mysql query \"Query here\""); return; } if (strcasecmp(sep->arg[1], "help") == 0) { - c->Message(0, "MYSQL In-Game CLI Interface:"); - c->Message(0, "Example: #mysql query \"Query goes here quoted\" -s -h"); - c->Message(0, "To use 'like \"%%something%%\" replace the %% with #"); - c->Message(0, "Example: #mysql query \"select * from table where name like \"#something#\""); - c->Message(0, "-s - Spaces select entries apart"); - c->Message(0, "-h - Colors every other select result"); + c->Message(Chat::White, "MYSQL In-Game CLI Interface:"); + c->Message(Chat::White, "Example: #mysql query \"Query goes here quoted\" -s -h"); + c->Message(Chat::White, "To use 'like \"%%something%%\" replace the %% with #"); + c->Message(Chat::White, "Example: #mysql query \"select * from table where name like \"#something#\""); + c->Message(Chat::White, "-s - Spaces select entries apart"); + c->Message(Chat::White, "-h - Colors every other select result"); return; } @@ -11408,7 +11408,7 @@ void command_mysql(Client *c, const Seperator *sep) lineVec.push_back(lineText.str()); if(optionS) //This provides spacing for the space switch - c->Message(0, " "); + c->Message(Chat::White, " "); if(optionH) //This option will highlight every other row highlightTextIndex = 1 - highlightTextIndex; @@ -11437,7 +11437,7 @@ void command_xtargets(Client *c, const Seperator *sep) return; } t->SetMaxXTargets(NewMax); - c->Message(0, "Max number of XTargets set to %i", NewMax); + c->Message(Chat::White, "Max number of XTargets set to %i", NewMax); } else t->ShowXTargets(c); @@ -11448,11 +11448,11 @@ void command_zopp(Client *c, const Seperator *sep) if (!c) return; else if (sep->argnum < 3 || sep->argnum > 4) - c->Message(0, "Usage: #zopp [trade/summon] [slot id] [item id] [*charges]"); + c->Message(Chat::White, "Usage: #zopp [trade/summon] [slot id] [item id] [*charges]"); else if (!strcasecmp(sep->arg[1], "trade") == 0 && !strcasecmp(sep->arg[1], "t") == 0 && !strcasecmp(sep->arg[1], "summon") == 0 && !strcasecmp(sep->arg[1], "s") == 0) - c->Message(0, "Usage: #zopp [trade/summon] [slot id] [item id] [*charges]"); + c->Message(Chat::White, "Usage: #zopp [trade/summon] [slot id] [item id] [*charges]"); else if (!sep->IsNumber(2) || !sep->IsNumber(3) || (sep->argnum == 4 && !sep->IsNumber(4))) - c->Message(0, "Usage: #zopp [trade/summon] [slot id] [item id] [*charges]"); + c->Message(Chat::White, "Usage: #zopp [trade/summon] [slot id] [item id] [*charges]"); else { ItemPacketType packettype; @@ -11486,12 +11486,12 @@ void command_zopp(Client *c, const Seperator *sep) if (charges < 0 || charges > FakeItem->StackSize) { c->Message(Chat::Red, "Warning: The specified charge count does not meet expected criteria!"); - c->Message(0, "Processing request..results may cause unpredictable behavior."); + c->Message(Chat::White, "Processing request..results may cause unpredictable behavior."); } EQEmu::ItemInstance* FakeItemInst = database.CreateItem(FakeItem, charges); c->SendItemPacket(slotid, FakeItemInst, packettype); - c->Message(0, "Sending zephyr op packet to client - [%s] %s (%u) with %i %s to slot %i.", + c->Message(Chat::White, "Sending zephyr op packet to client - [%s] %s (%u) with %i %s to slot %i.", packettype == ItemPacketTrade ? "Trade" : "Summon", FakeItem->Name, itemid, charges, std::abs(charges == 1) ? "charge" : "charges", slotid); safe_delete(FakeItemInst); @@ -11515,17 +11515,17 @@ void command_questerrors(Client *c, const Seperator *sep) { std::list err; parse->GetErrors(err); - c->Message(0, "Current Quest Errors:"); + c->Message(Chat::White, "Current Quest Errors:"); auto iter = err.begin(); int i = 0; while(iter != err.end()) { if(i >= 30) { - c->Message(0, "Maximum of 30 Errors shown..."); + c->Message(Chat::White, "Maximum of 30 Errors shown..."); break; } - c->Message(0, iter->c_str()); + c->Message(Chat::White, iter->c_str()); ++i; ++iter; } @@ -11540,20 +11540,20 @@ void command_enablerecipe(Client *c, const Seperator *sep) recipe_id = atoi(sep->arg[1]); } else { - c->Message(0, "Invalid number of arguments.\nUsage: #enablerecipe recipe_id"); + c->Message(Chat::White, "Invalid number of arguments.\nUsage: #enablerecipe recipe_id"); return; } if (recipe_id > 0) { success = database.EnableRecipe(recipe_id); if (success) { - c->Message(0, "Recipe enabled."); + c->Message(Chat::White, "Recipe enabled."); } else { - c->Message(0, "Recipe not enabled."); + c->Message(Chat::White, "Recipe not enabled."); } } else { - c->Message(0, "Invalid recipe id.\nUsage: #enablerecipe recipe_id"); + c->Message(Chat::White, "Invalid recipe id.\nUsage: #enablerecipe recipe_id"); } } } @@ -11567,20 +11567,20 @@ void command_disablerecipe(Client *c, const Seperator *sep) recipe_id = atoi(sep->arg[1]); } else { - c->Message(0, "Invalid number of arguments.\nUsage: #disablerecipe recipe_id"); + c->Message(Chat::White, "Invalid number of arguments.\nUsage: #disablerecipe recipe_id"); return; } if (recipe_id > 0) { success = database.DisableRecipe(recipe_id); if (success) { - c->Message(0, "Recipe disabled."); + c->Message(Chat::White, "Recipe disabled."); } else { - c->Message(0, "Recipe not disabled."); + c->Message(Chat::White, "Recipe not disabled."); } } else { - c->Message(0, "Invalid recipe id.\nUsage: #disablerecipe recipe_id"); + c->Message(Chat::White, "Invalid recipe id.\nUsage: #disablerecipe recipe_id"); } } } @@ -11590,13 +11590,13 @@ void command_npctype_cache(Client *c, const Seperator *sep) if (sep->argnum > 0) { for (int i = 0; i < sep->argnum; ++i) { if (strcasecmp(sep->arg[i + 1], "all") == 0) { - c->Message(0, "Clearing all npc types from the cache."); + c->Message(Chat::White, "Clearing all npc types from the cache."); zone->ClearNPCTypeCache(-1); } else { int id = atoi(sep->arg[i + 1]); if (id > 0) { - c->Message(0, "Clearing npc type %d from the cache.", id); + c->Message(Chat::White, "Clearing npc type %d from the cache.", id); zone->ClearNPCTypeCache(id); return; } @@ -11604,9 +11604,9 @@ void command_npctype_cache(Client *c, const Seperator *sep) } } else { - c->Message(0, "Usage:"); - c->Message(0, "#npctype_cache [npctype_id] ..."); - c->Message(0, "#npctype_cache all"); + c->Message(Chat::White, "Usage:"); + c->Message(Chat::White, "#npctype_cache [npctype_id] ..."); + c->Message(Chat::White, "#npctype_cache all"); } } @@ -11614,7 +11614,7 @@ void command_merchantopenshop(Client *c, const Seperator *sep) { Mob *merchant = c->GetTarget(); if (!merchant || merchant->GetClass() != MERCHANT) { - c->Message(0, "You must target a merchant to open their shop."); + c->Message(Chat::White, "You must target a merchant to open their shop."); return; } @@ -11625,7 +11625,7 @@ void command_merchantcloseshop(Client *c, const Seperator *sep) { Mob *merchant = c->GetTarget(); if (!merchant || merchant->GetClass() != MERCHANT) { - c->Message(0, "You must target a merchant to close their shop."); + c->Message(Chat::White, "You must target a merchant to close their shop."); return; } @@ -11643,12 +11643,12 @@ void command_shownpcgloballoot(Client *c, const Seperator *sep) auto tar = c->GetTarget(); if (!tar || !tar->IsNPC()) { - c->Message(0, "You must target an NPC to use this command."); + c->Message(Chat::White, "You must target an NPC to use this command."); return; } auto npc = tar->CastToNPC(); - c->Message(0, "GlobalLoot for %s (%d)", npc->GetName(), npc->GetNPCTypeID()); + c->Message(Chat::White, "GlobalLoot for %s (%d)", npc->GetName(), npc->GetNPCTypeID()); zone->ShowNPCGlobalLoot(c, npc); } @@ -11657,33 +11657,33 @@ void command_tune(Client *c, const Seperator *sep) //Work in progress - Kayen if(sep->arg[1][0] == '\0' || !strcasecmp(sep->arg[1], "help")) { - c->Message(0, "Syntax: #tune [subcommand]."); - c->Message(0, "-- Tune System Commands --"); - c->Message(0, "-- Usage: Returning recommended combat statistical values based on a desired outcome."); - c->Message(0, "-- Note: If targeted mob does not have a target (ie not engaged in combat), YOU will be considered the target."); - c->Message(0, "-- Warning: The calculations done in this process are intense and can potentially cause zone crashes depending on parameters set, use with caution!"); - c->Message(0, "-- Below are OPTIONAL parameters."); - c->Message(0, "-- Note: [interval] Determines how fast the stat being checked increases/decreases till it finds the best result. Default [ATK/AC 50][Acc/Avoid 10] "); - c->Message(0, "-- Note: [loop_max] Determines how many iterations are done to increases/decreases the stat till it finds the best result. Default [ATK/AC 100][Acc/Avoid 1000]"); - c->Message(0, "-- Note: [Stat Override] Will override that stat on mob being checkd with the specified value. Default=0"); - c->Message(0, "-- Note: [Info Level] How much statistical detail is displayed[0 - 3]. Default=0 "); - c->Message(0, "-- Note: Results are only approximations usually accurate to +/- 2 intervals."); + c->Message(Chat::White, "Syntax: #tune [subcommand]."); + c->Message(Chat::White, "-- Tune System Commands --"); + c->Message(Chat::White, "-- Usage: Returning recommended combat statistical values based on a desired outcome."); + c->Message(Chat::White, "-- Note: If targeted mob does not have a target (ie not engaged in combat), YOU will be considered the target."); + c->Message(Chat::White, "-- Warning: The calculations done in this process are intense and can potentially cause zone crashes depending on parameters set, use with caution!"); + c->Message(Chat::White, "-- Below are OPTIONAL parameters."); + c->Message(Chat::White, "-- Note: [interval] Determines how fast the stat being checked increases/decreases till it finds the best result. Default [ATK/AC 50][Acc/Avoid 10] "); + c->Message(Chat::White, "-- Note: [loop_max] Determines how many iterations are done to increases/decreases the stat till it finds the best result. Default [ATK/AC 100][Acc/Avoid 1000]"); + c->Message(Chat::White, "-- Note: [Stat Override] Will override that stat on mob being checkd with the specified value. Default=0"); + c->Message(Chat::White, "-- Note: [Info Level] How much statistical detail is displayed[0 - 3]. Default=0 "); + c->Message(Chat::White, "-- Note: Results are only approximations usually accurate to +/- 2 intervals."); - c->Message(0, "... "); - c->Message(0, "...### Category A ### Target = ATTACKER ### YOU or Target's Target = DEFENDER ###"); - c->Message(0, "...### Category B ### Target = DEFENDER ### YOU or Target's Target = ATTACKER ###"); - c->Message(0, "... "); - c->Message(0, "...#Returns recommended ATK adjustment +/- on ATTACKER that will result in an average mitigation pct on DEFENDER. "); - c->Message(0, "...tune FindATK [A/B] [pct mitigation] [interval][loop_max][AC Overwride][Info Level]"); - c->Message(0, "... "); - c->Message(0, "...#Returns recommended AC adjustment +/- on DEFENDER for an average mitigation pct from ATTACKER. "); - c->Message(0, "...tune FindAC [A/B] [pct mitigation] [interval][loop_max][ATK Overwride][Info Level] "); - c->Message(0, "... "); - c->Message(0, "...#Returns recommended Accuracy adjustment +/- on ATTACKER that will result in a hit chance pct on DEFENDER. "); - c->Message(0, "...tune FindAccuracy [A/B] [hit chance] [interval][loop_max][Avoidance Overwride][Info Level]"); - c->Message(0, "... "); - c->Message(0, "...#Returns recommended Avoidance adjustment +/- on DEFENDER for in a hit chance pct from ATTACKER. "); - c->Message(0, "...tune FindAvoidance [A/B] [pct mitigation] [interval][loop_max][Accuracy Overwride][Info Level] "); + c->Message(Chat::White, "... "); + c->Message(Chat::White, "...### Category A ### Target = ATTACKER ### YOU or Target's Target = DEFENDER ###"); + c->Message(Chat::White, "...### Category B ### Target = DEFENDER ### YOU or Target's Target = ATTACKER ###"); + c->Message(Chat::White, "... "); + c->Message(Chat::White, "...#Returns recommended ATK adjustment +/- on ATTACKER that will result in an average mitigation pct on DEFENDER. "); + c->Message(Chat::White, "...tune FindATK [A/B] [pct mitigation] [interval][loop_max][AC Overwride][Info Level]"); + c->Message(Chat::White, "... "); + c->Message(Chat::White, "...#Returns recommended AC adjustment +/- on DEFENDER for an average mitigation pct from ATTACKER. "); + c->Message(Chat::White, "...tune FindAC [A/B] [pct mitigation] [interval][loop_max][ATK Overwride][Info Level] "); + c->Message(Chat::White, "... "); + c->Message(Chat::White, "...#Returns recommended Accuracy adjustment +/- on ATTACKER that will result in a hit chance pct on DEFENDER. "); + c->Message(Chat::White, "...tune FindAccuracy [A/B] [hit chance] [interval][loop_max][Avoidance Overwride][Info Level]"); + c->Message(Chat::White, "... "); + c->Message(Chat::White, "...#Returns recommended Avoidance adjustment +/- on DEFENDER for in a hit chance pct from ATTACKER. "); + c->Message(Chat::White, "...tune FindAvoidance [A/B] [pct mitigation] [interval][loop_max][Accuracy Overwride][Info Level] "); return; } @@ -11693,7 +11693,7 @@ void command_tune(Client *c, const Seperator *sep) if (!attacker) { - c->Message(0, "#Tune - Error no target selected. [#Tune help]"); + c->Message(Chat::White, "#Tune - Error no target selected. [#Tune help]"); return; } @@ -11730,9 +11730,9 @@ void command_tune(Client *c, const Seperator *sep) else if(!strcasecmp(sep->arg[2], "B")) c->Tune_FindATKByPctMitigation(attacker,defender, pct_mitigation, interval, max_loop,ac_override,info_level); else { - c->Message(0, "#Tune - Error no category selcted. [#Tune help]"); - c->Message(0, "Usage #tune FindATK [A/B] [pct mitigation] [interval][loop_max][AC Overwride][Info Level] "); - c->Message(0, "Example #tune FindATK A 60"); + c->Message(Chat::White, "#Tune - Error no category selcted. [#Tune help]"); + c->Message(Chat::White, "Usage #tune FindATK [A/B] [pct mitigation] [interval][loop_max][AC Overwride][Info Level] "); + c->Message(Chat::White, "Example #tune FindATK A 60"); } return; } @@ -11765,9 +11765,9 @@ void command_tune(Client *c, const Seperator *sep) else if(!strcasecmp(sep->arg[2], "B")) c->Tune_FindACByPctMitigation(attacker, defender, pct_mitigation, interval, max_loop,atk_override,info_level); else { - c->Message(0, "#Tune - Error no category selcted. [#Tune help]"); - c->Message(0, "Usage #tune FindAC [A/B] [pct mitigation] [interval][loop_max][ATK Overwride][Info Level] "); - c->Message(0, "Example #tune FindAC A 60"); + c->Message(Chat::White, "#Tune - Error no category selcted. [#Tune help]"); + c->Message(Chat::White, "Usage #tune FindAC [A/B] [pct mitigation] [interval][loop_max][ATK Overwride][Info Level] "); + c->Message(Chat::White, "Example #tune FindAC A 60"); } return; @@ -11807,9 +11807,9 @@ void command_tune(Client *c, const Seperator *sep) else if(!strcasecmp(sep->arg[2], "B")) c->Tune_FindAccuaryByHitChance(attacker, defender, hit_chance, interval, max_loop,avoid_override,info_level); else { - c->Message(0, "#Tune - Error no category selcted. [#Tune help]"); - c->Message(0, "Usage #tune FindAcccuracy [A/B] [hit chance] [interval][loop_max][Avoidance Overwride][Info Level]"); - c->Message(0, "Exampled #tune FindAccuracy B 30"); + c->Message(Chat::White, "#Tune - Error no category selcted. [#Tune help]"); + c->Message(Chat::White, "Usage #tune FindAcccuracy [A/B] [hit chance] [interval][loop_max][Avoidance Overwride][Info Level]"); + c->Message(Chat::White, "Exampled #tune FindAccuracy B 30"); } return; @@ -11825,7 +11825,7 @@ void command_tune(Client *c, const Seperator *sep) if (!hit_chance) { - c->Message(0, "#Tune - Error must enter the desired hit chance on defender. Ie. Defender to have hit chance of 40 pct."); + c->Message(Chat::White, "#Tune - Error must enter the desired hit chance on defender. Ie. Defender to have hit chance of 40 pct."); return; } @@ -11849,9 +11849,9 @@ void command_tune(Client *c, const Seperator *sep) else if(!strcasecmp(sep->arg[2], "B")) c->Tune_FindAvoidanceByHitChance(attacker, defender, hit_chance, interval, max_loop,acc_override, info_level); else { - c->Message(0, "#Tune - Error no category selcted. [#Tune help]"); - c->Message(0, "Usage #tune FindAvoidance [A/B] [hit chance] [interval][loop_max][Accuracy Overwride][Info Level]"); - c->Message(0, "Exampled #tune FindAvoidance B 30"); + c->Message(Chat::White, "#Tune - Error no category selcted. [#Tune help]"); + c->Message(Chat::White, "Usage #tune FindAvoidance [A/B] [hit chance] [interval][loop_max][Accuracy Overwride][Info Level]"); + c->Message(Chat::White, "Exampled #tune FindAvoidance B 30"); } return; @@ -11875,7 +11875,7 @@ void command_logtest(Client *c, const Seperator *sep){ void command_crashtest(Client *c, const Seperator *sep) { - c->Message(0, "Alright, now we get an GPF ;) "); + c->Message(Chat::White, "Alright, now we get an GPF ;) "); char* gpf = 0; memcpy(gpf, "Ready to crash", 30); } @@ -11893,11 +11893,11 @@ void command_logs(Client *c, const Seperator *sep){ /* #logs list_settings */ if (strcasecmp(sep->arg[1], "list_settings") == 0 || (strcasecmp(sep->arg[1], "set") == 0 && strcasecmp(sep->arg[3], "") == 0)) { - c->Message(0, "[Category ID | console | file | gmsay | Category Description]"); + c->Message(Chat::White, "[Category ID | console | file | gmsay | Category Description]"); int redisplay_columns = 0; for (int i = 0; i < Logs::LogCategory::MaxCategoryID; i++) { if (redisplay_columns == 10) { - c->Message(0, "[Category ID | console | file | gmsay | Category Description]"); + c->Message(Chat::White, "[Category ID | console | file | gmsay | Category Description]"); redisplay_columns = 0; } c->Message( @@ -11928,8 +11928,8 @@ void command_logs(Client *c, const Seperator *sep){ logs_set = 1; } else{ - c->Message(0, "--- #logs set [console|file|gmsay] - Sets log settings during the lifetime of the zone"); - c->Message(0, "--- #logs set gmsay 20 1 - Would output Quest errors to gmsay"); + c->Message(Chat::White, "--- #logs set [console|file|gmsay] - Sets log settings during the lifetime of the zone"); + c->Message(Chat::White, "--- #logs set gmsay 20 1 - Would output Quest errors to gmsay"); } if (logs_set == 1){ c->Message(Chat::Yellow, "Your Log Settings have been applied"); @@ -11947,10 +11947,10 @@ void command_logs(Client *c, const Seperator *sep){ } } else { - c->Message(0, "#logs usage:"); - c->Message(0, "--- #logs reload_all - Reload all settings in world and all zone processes with what is defined in the database"); - c->Message(0, "--- #logs list_settings - Shows current log settings and categories loaded into the current process' memory"); - c->Message(0, "--- #logs set [console|file|gmsay] - Sets log settings during the lifetime of the zone"); + c->Message(Chat::White, "#logs usage:"); + c->Message(Chat::White, "--- #logs reload_all - Reload all settings in world and all zone processes with what is defined in the database"); + c->Message(Chat::White, "--- #logs list_settings - Shows current log settings and categories loaded into the current process' memory"); + c->Message(Chat::White, "--- #logs set [console|file|gmsay] - Sets log settings during the lifetime of the zone"); } } @@ -11979,24 +11979,24 @@ void command_resetaa_timer(Client *c, const Seperator *sep) { if(sep->IsNumber(1)) { int timer_id = atoi(sep->arg[1]); - c->Message(0, "Reset of timer %i for %s", timer_id, c->GetName()); + c->Message(Chat::White, "Reset of timer %i for %s", timer_id, c->GetName()); c->ResetAlternateAdvancementTimer(timer_id); } else if(!strcasecmp(sep->arg[1], "all")) { - c->Message(0, "Reset all timers for %s", c->GetName()); + c->Message(Chat::White, "Reset all timers for %s", c->GetName()); c->ResetAlternateAdvancementTimers(); } else { - c->Message(0, "usage: #resetaa_timer [all | timer_id]"); + c->Message(Chat::White, "usage: #resetaa_timer [all | timer_id]"); } } void command_reloadaa(Client *c, const Seperator *sep) { - c->Message(0, "Reloading Alternate Advancement Data..."); + c->Message(Chat::White, "Reloading Alternate Advancement Data..."); zone->LoadAlternateAdvancement(); - c->Message(0, "Alternate Advancement Data Reloaded"); + c->Message(Chat::White, "Alternate Advancement Data Reloaded"); entity_list.SendAlternateAdvancementStats(); } @@ -12011,7 +12011,7 @@ void command_hotfix(Client *c, const Seperator *sep) { hotfix_name = "hotfix_"; } - c->Message(0, "Creating and applying hotfix"); + c->Message(Chat::White, "Creating and applying hotfix"); std::thread t1( [c, hotfix_name]() { #ifdef WIN32 @@ -12036,7 +12036,7 @@ void command_hotfix(Client *c, const Seperator *sep) { } worldserver.SendPacket(&pack); - if (c) c->Message(0, "Hotfix applied"); + if (c) c->Message(Chat::White, "Hotfix applied"); }); t1.detach(); @@ -12048,12 +12048,12 @@ void command_load_shared_memory(Client *c, const Seperator *sep) { std::string hotfix_name; if(strcasecmp(hotfix.c_str(), sep->arg[1]) == 0) { - c->Message(0, "Cannot attempt to load this shared memory segment as it is already loaded."); + c->Message(Chat::White, "Cannot attempt to load this shared memory segment as it is already loaded."); return; } hotfix_name = sep->arg[1]; - c->Message(0, "Loading shared memory segment %s", hotfix_name.c_str()); + c->Message(Chat::White, "Loading shared memory segment %s", hotfix_name.c_str()); std::thread t1([c,hotfix_name]() { #ifdef WIN32 if(hotfix_name.length() > 0) { @@ -12069,7 +12069,7 @@ void command_load_shared_memory(Client *c, const Seperator *sep) { if(system(StringFormat("./shared_memory").c_str())); } #endif - c->Message(0, "Shared memory segment finished loading."); + c->Message(Chat::White, "Shared memory segment finished loading."); }); t1.detach(); @@ -12080,7 +12080,7 @@ void command_apply_shared_memory(Client *c, const Seperator *sep) { database.GetVariable("hotfix_name", hotfix); std::string hotfix_name = sep->arg[1]; - c->Message(0, "Applying shared memory segment %s", hotfix_name.c_str()); + c->Message(Chat::White, "Applying shared memory segment %s", hotfix_name.c_str()); database.SetVariable("hotfix_name", hotfix_name); ServerPacket pack(ServerOP_ChangeSharedMem, hotfix_name.length() + 1); @@ -12370,54 +12370,54 @@ void command_network(Client *c, const Seperator *sep) if (!strcasecmp(sep->arg[2], "all")) { - c->Message(0, "max_packet_size: %llu", (uint64_t)opts.daybreak_options.max_packet_size); - c->Message(0, "max_connection_count: %llu", (uint64_t)opts.daybreak_options.max_connection_count); - c->Message(0, "keepalive_delay_ms: %llu", (uint64_t)opts.daybreak_options.keepalive_delay_ms); - c->Message(0, "resend_delay_factor: %.2f", opts.daybreak_options.resend_delay_factor); - c->Message(0, "resend_delay_ms: %llu", (uint64_t)opts.daybreak_options.resend_delay_ms); - c->Message(0, "resend_delay_min: %llu", (uint64_t)opts.daybreak_options.resend_delay_min); - c->Message(0, "resend_delay_max: %llu", (uint64_t)opts.daybreak_options.resend_delay_max); - c->Message(0, "connect_delay_ms: %llu", (uint64_t)opts.daybreak_options.connect_delay_ms); - c->Message(0, "connect_stale_ms: %llu", (uint64_t)opts.daybreak_options.connect_stale_ms); - c->Message(0, "stale_connection_ms: %llu", (uint64_t)opts.daybreak_options.stale_connection_ms); - c->Message(0, "crc_length: %llu", (uint64_t)opts.daybreak_options.crc_length); - c->Message(0, "hold_size: %llu", (uint64_t)opts.daybreak_options.hold_size); - c->Message(0, "hold_length_ms: %llu", (uint64_t)opts.daybreak_options.hold_length_ms); - c->Message(0, "simulated_in_packet_loss: %llu", (uint64_t)opts.daybreak_options.simulated_in_packet_loss); - c->Message(0, "simulated_out_packet_loss: %llu", (uint64_t)opts.daybreak_options.simulated_out_packet_loss); - c->Message(0, "tic_rate_hertz: %.2f", opts.daybreak_options.tic_rate_hertz); - c->Message(0, "resend_timeout: %llu", (uint64_t)opts.daybreak_options.resend_timeout); - c->Message(0, "connection_close_time: %llu", (uint64_t)opts.daybreak_options.connection_close_time); - c->Message(0, "encode_passes[0]: %llu", (uint64_t)opts.daybreak_options.encode_passes[0]); - c->Message(0, "encode_passes[1]: %llu", (uint64_t)opts.daybreak_options.encode_passes[1]); - c->Message(0, "port: %llu", (uint64_t)opts.daybreak_options.port); + c->Message(Chat::White, "max_packet_size: %llu", (uint64_t)opts.daybreak_options.max_packet_size); + c->Message(Chat::White, "max_connection_count: %llu", (uint64_t)opts.daybreak_options.max_connection_count); + c->Message(Chat::White, "keepalive_delay_ms: %llu", (uint64_t)opts.daybreak_options.keepalive_delay_ms); + c->Message(Chat::White, "resend_delay_factor: %.2f", opts.daybreak_options.resend_delay_factor); + c->Message(Chat::White, "resend_delay_ms: %llu", (uint64_t)opts.daybreak_options.resend_delay_ms); + c->Message(Chat::White, "resend_delay_min: %llu", (uint64_t)opts.daybreak_options.resend_delay_min); + c->Message(Chat::White, "resend_delay_max: %llu", (uint64_t)opts.daybreak_options.resend_delay_max); + c->Message(Chat::White, "connect_delay_ms: %llu", (uint64_t)opts.daybreak_options.connect_delay_ms); + c->Message(Chat::White, "connect_stale_ms: %llu", (uint64_t)opts.daybreak_options.connect_stale_ms); + c->Message(Chat::White, "stale_connection_ms: %llu", (uint64_t)opts.daybreak_options.stale_connection_ms); + c->Message(Chat::White, "crc_length: %llu", (uint64_t)opts.daybreak_options.crc_length); + c->Message(Chat::White, "hold_size: %llu", (uint64_t)opts.daybreak_options.hold_size); + c->Message(Chat::White, "hold_length_ms: %llu", (uint64_t)opts.daybreak_options.hold_length_ms); + c->Message(Chat::White, "simulated_in_packet_loss: %llu", (uint64_t)opts.daybreak_options.simulated_in_packet_loss); + c->Message(Chat::White, "simulated_out_packet_loss: %llu", (uint64_t)opts.daybreak_options.simulated_out_packet_loss); + c->Message(Chat::White, "tic_rate_hertz: %.2f", opts.daybreak_options.tic_rate_hertz); + c->Message(Chat::White, "resend_timeout: %llu", (uint64_t)opts.daybreak_options.resend_timeout); + c->Message(Chat::White, "connection_close_time: %llu", (uint64_t)opts.daybreak_options.connection_close_time); + c->Message(Chat::White, "encode_passes[0]: %llu", (uint64_t)opts.daybreak_options.encode_passes[0]); + c->Message(Chat::White, "encode_passes[1]: %llu", (uint64_t)opts.daybreak_options.encode_passes[1]); + c->Message(Chat::White, "port: %llu", (uint64_t)opts.daybreak_options.port); } else { - c->Message(0, "Unknown get option: %s", sep->arg[2]); - c->Message(0, "Available options:"); + c->Message(Chat::White, "Unknown get option: %s", sep->arg[2]); + c->Message(Chat::White, "Available options:"); //Todo the rest of these when im less lazy. - //c->Message(0, "max_packet_size"); - //c->Message(0, "max_connection_count"); - //c->Message(0, "keepalive_delay_ms"); - //c->Message(0, "resend_delay_factor"); - //c->Message(0, "resend_delay_ms"); - //c->Message(0, "resend_delay_min"); - //c->Message(0, "resend_delay_max"); - //c->Message(0, "connect_delay_ms"); - //c->Message(0, "connect_stale_ms"); - //c->Message(0, "stale_connection_ms"); - //c->Message(0, "crc_length"); - //c->Message(0, "hold_size"); - //c->Message(0, "hold_length_ms"); - //c->Message(0, "simulated_in_packet_loss"); - //c->Message(0, "simulated_out_packet_loss"); - //c->Message(0, "tic_rate_hertz"); - //c->Message(0, "resend_timeout"); - //c->Message(0, "connection_close_time"); - //c->Message(0, "encode_passes[0]"); - //c->Message(0, "encode_passes[1]"); - //c->Message(0, "port"); - c->Message(0, "all"); + //c->Message(Chat::White, "max_packet_size"); + //c->Message(Chat::White, "max_connection_count"); + //c->Message(Chat::White, "keepalive_delay_ms"); + //c->Message(Chat::White, "resend_delay_factor"); + //c->Message(Chat::White, "resend_delay_ms"); + //c->Message(Chat::White, "resend_delay_min"); + //c->Message(Chat::White, "resend_delay_max"); + //c->Message(Chat::White, "connect_delay_ms"); + //c->Message(Chat::White, "connect_stale_ms"); + //c->Message(Chat::White, "stale_connection_ms"); + //c->Message(Chat::White, "crc_length"); + //c->Message(Chat::White, "hold_size"); + //c->Message(Chat::White, "hold_length_ms"); + //c->Message(Chat::White, "simulated_in_packet_loss"); + //c->Message(Chat::White, "simulated_out_packet_loss"); + //c->Message(Chat::White, "tic_rate_hertz"); + //c->Message(Chat::White, "resend_timeout"); + //c->Message(Chat::White, "connection_close_time"); + //c->Message(Chat::White, "encode_passes[0]"); + //c->Message(Chat::White, "encode_passes[1]"); + //c->Message(Chat::White, "port"); + c->Message(Chat::White, "all"); } } else if (!strcasecmp(sep->arg[1], "setopt")) @@ -12428,7 +12428,7 @@ void command_network(Client *c, const Seperator *sep) if (!strcasecmp(sep->arg[3], "")) { - c->Message(0, "Missing value for set"); + c->Message(Chat::White, "Missing value for set"); return; } @@ -12509,30 +12509,30 @@ void command_network(Client *c, const Seperator *sep) manager->SetOptions(opts); } else { - c->Message(0, "Unknown set option: %s", sep->arg[2]); - c->Message(0, "Available options:"); - c->Message(0, "max_connection_count"); - c->Message(0, "keepalive_delay_ms"); - c->Message(0, "resend_delay_factor"); - c->Message(0, "resend_delay_ms"); - c->Message(0, "resend_delay_min"); - c->Message(0, "resend_delay_max"); - c->Message(0, "connect_delay_ms"); - c->Message(0, "connect_stale_ms"); - c->Message(0, "stale_connection_ms"); - c->Message(0, "hold_size"); - c->Message(0, "hold_length_ms"); - c->Message(0, "simulated_in_packet_loss"); - c->Message(0, "simulated_out_packet_loss"); - c->Message(0, "resend_timeout"); - c->Message(0, "connection_close_time"); + c->Message(Chat::White, "Unknown set option: %s", sep->arg[2]); + c->Message(Chat::White, "Available options:"); + c->Message(Chat::White, "max_connection_count"); + c->Message(Chat::White, "keepalive_delay_ms"); + c->Message(Chat::White, "resend_delay_factor"); + c->Message(Chat::White, "resend_delay_ms"); + c->Message(Chat::White, "resend_delay_min"); + c->Message(Chat::White, "resend_delay_max"); + c->Message(Chat::White, "connect_delay_ms"); + c->Message(Chat::White, "connect_stale_ms"); + c->Message(Chat::White, "stale_connection_ms"); + c->Message(Chat::White, "hold_size"); + c->Message(Chat::White, "hold_length_ms"); + c->Message(Chat::White, "simulated_in_packet_loss"); + c->Message(Chat::White, "simulated_out_packet_loss"); + c->Message(Chat::White, "resend_timeout"); + c->Message(Chat::White, "connection_close_time"); } } else { - c->Message(0, "Unknown command: %s", sep->arg[1]); - c->Message(0, "Network commands avail:"); - c->Message(0, "getopt optname - Retrieve the current option value set."); - c->Message(0, "setopt optname - Set the current option allowed."); + c->Message(Chat::White, "Unknown command: %s", sep->arg[1]); + c->Message(Chat::White, "Network commands avail:"); + c->Message(Chat::White, "getopt optname - Retrieve the current option value set."); + c->Message(Chat::White, "setopt optname - Set the current option allowed."); } } diff --git a/zone/corpse.cpp b/zone/corpse.cpp index 2dc2872ec..e3a5eb80e 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -1371,7 +1371,7 @@ void Corpse::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { void Corpse::QueryLoot(Client* to) { int x = 0, y = 0; // x = visible items, y = total items - to->Message(0, "Coin: %ip, %ig, %is, %ic", platinum, gold, silver, copper); + to->Message(Chat::White, "Coin: %ip, %ig, %is, %ic", platinum, gold, silver, copper); ItemList::iterator cur,end; cur = itemlist.begin(); @@ -1405,19 +1405,19 @@ void Corpse::QueryLoot(Client* to) { const EQEmu::ItemData* item = database.GetItem(sitem->item_id); if (item) - to->Message(0, "LootSlot: %i Item: %s (%d), Count: %i", sitem->lootslot, item->Name, item->ID, sitem->charges); + to->Message(Chat::White, "LootSlot: %i Item: %s (%d), Count: %i", sitem->lootslot, item->Name, item->ID, sitem->charges); else - to->Message(0, "Error: 0x%04x", sitem->item_id); + to->Message(Chat::White, "Error: 0x%04x", sitem->item_id); y++; } } if (IsPlayerCorpse()) { - to->Message(0, "%i visible %s (%i total) on %s (DBID: %i).", x, x==1?"item":"items", y, this->GetName(), this->GetCorpseDBID()); + to->Message(Chat::White, "%i visible %s (%i total) on %s (DBID: %i).", x, x==1?"item":"items", y, this->GetName(), this->GetCorpseDBID()); } else { - to->Message(0, "%i %s on %s.", y, y==1?"item":"items", this->GetName()); + to->Message(Chat::White, "%i %s on %s.", y, y==1?"item":"items", this->GetName()); } } @@ -1434,7 +1434,7 @@ bool Corpse::Summon(Client* client, bool spell, bool CheckDistance) { is_corpse_changed = true; } else { - client->Message(0, "Corpse is too far away."); + client->Message(Chat::White, "Corpse is too far away."); return false; } } @@ -1449,14 +1449,14 @@ bool Corpse::Summon(Client* client, bool spell, bool CheckDistance) { is_corpse_changed = true; } else { - client->Message(0, "Corpse is too far away."); + client->Message(Chat::White, "Corpse is too far away."); return false; } consented = true; } } if(!consented) { - client->Message(0, "You do not have permission to move this corpse."); + client->Message(Chat::White, "You do not have permission to move this corpse."); return false; } } diff --git a/zone/entity.cpp b/zone/entity.cpp index e52935ded..9003dc7f6 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -2902,15 +2902,15 @@ void EntityList::ListNPCCorpses(Client *client) uint32 x = 0; auto it = corpse_list.begin(); - client->Message(0, "NPC Corpses in the zone:"); + client->Message(Chat::White, "NPC Corpses in the zone:"); while (it != corpse_list.end()) { if (it->second->IsNPCCorpse()) { - client->Message(0, " %5d: %s", it->first, it->second->GetName()); + client->Message(Chat::White, " %5d: %s", it->first, it->second->GetName()); x++; } ++it; } - client->Message(0, "%d npc corpses listed.", x); + client->Message(Chat::White, "%d npc corpses listed.", x); } void EntityList::ListPlayerCorpses(Client *client) @@ -2918,15 +2918,15 @@ void EntityList::ListPlayerCorpses(Client *client) uint32 x = 0; auto it = corpse_list.begin(); - client->Message(0, "Player Corpses in the zone:"); + client->Message(Chat::White, "Player Corpses in the zone:"); while (it != corpse_list.end()) { if (it->second->IsPlayerCorpse()) { - client->Message(0, " %5d: %s", it->first, it->second->GetName()); + client->Message(Chat::White, " %5d: %s", it->first, it->second->GetName()); x++; } ++it; } - client->Message(0, "%d player corpses listed.", x); + client->Message(Chat::White, "%d player corpses listed.", x); } // returns the number of corpses deleted. A negative number indicates an error code. diff --git a/zone/global_loot_manager.cpp b/zone/global_loot_manager.cpp index 8e990c0ac..ccdf88840 100644 --- a/zone/global_loot_manager.cpp +++ b/zone/global_loot_manager.cpp @@ -21,14 +21,14 @@ std::vector GlobalLootManager::GetGlobalLootTables(NPC *mob) const void GlobalLootManager::ShowZoneGlobalLoot(Client *to) const { for (auto &e : m_entries) - to->Message(0, " %s : %d table %d", e.GetDescription().c_str(), e.GetID(), e.GetLootTableID()); + to->Message(Chat::White, " %s : %d table %d", e.GetDescription().c_str(), e.GetID(), e.GetLootTableID()); } void GlobalLootManager::ShowNPCGlobalLoot(Client *to, NPC *who) const { for (auto &e : m_entries) { if (e.PassesRules(who)) - to->Message(0, " %s : %d table %d", e.GetDescription().c_str(), e.GetID(), e.GetLootTableID()); + to->Message(Chat::White, " %s : %d table %d", e.GetDescription().c_str(), e.GetID(), e.GetLootTableID()); } } diff --git a/zone/groups.cpp b/zone/groups.cpp index a4104b26a..cef37fbda 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -199,7 +199,7 @@ void Group::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinu Client *c = members[i]->CastToClient(); //I could not get MoneyOnCorpse to work, so we use this c->AddMoneyToPP(cpsplit, spsplit, gpsplit, ppsplit, true); - c->Message(2, msg.c_str()); + c->Message(Chat::Green, msg.c_str()); } } } @@ -1680,9 +1680,9 @@ void Group::NotifyMainTank(Client *c, uint8 toggle) if (c->ClientVersion() < EQEmu::versions::ClientVersion::SoD) { if(toggle) - c->Message(0, "%s is now Main Tank.", MainTankName.c_str()); + c->Message(Chat::White, "%s is now Main Tank.", MainTankName.c_str()); else - c->Message(0, "%s is no longer Main Tank.", MainTankName.c_str()); + c->Message(Chat::White, "%s is no longer Main Tank.", MainTankName.c_str()); } else { @@ -1775,9 +1775,9 @@ void Group::NotifyPuller(Client *c, uint8 toggle) if (c->ClientVersion() < EQEmu::versions::ClientVersion::SoD) { if(toggle) - c->Message(0, "%s is now Puller.", PullerName.c_str()); + c->Message(Chat::White, "%s is now Puller.", PullerName.c_str()); else - c->Message(0, "%s is no longer Puller.", PullerName.c_str()); + c->Message(Chat::White, "%s is no longer Puller.", PullerName.c_str()); } else { diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index 43157ed2d..eacfcb474 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -189,7 +189,7 @@ uint8 *ZoneGuildManager::MakeGuildMembers(uint32 guild_id, const char *prefix_na } void ZoneGuildManager::ListGuilds(Client *c) const { - c->Message(0, "Listing guilds on the server:"); + c->Message(Chat::White, "Listing guilds on the server:"); char leadername[64]; std::map::const_iterator cur, end; cur = m_guilds.begin(); @@ -199,12 +199,12 @@ void ZoneGuildManager::ListGuilds(Client *c) const { leadername[0] = '\0'; database.GetCharName(cur->second->leader_char_id, leadername); if (leadername[0] == '\0') - c->Message(0, " Guild #%i <%s>", cur->first, cur->second->name.c_str()); + c->Message(Chat::White, " Guild #%i <%s>", cur->first, cur->second->name.c_str()); else - c->Message(0, " Guild #%i <%s> Leader: %s", cur->first, cur->second->name.c_str(), leadername); + c->Message(Chat::White, " Guild #%i <%s> Leader: %s", cur->first, cur->second->name.c_str(), leadername); r++; } - c->Message(0, "%i guilds listed.", r); + c->Message(Chat::White, "%i guilds listed.", r); } @@ -212,17 +212,17 @@ void ZoneGuildManager::DescribeGuild(Client *c, uint32 guild_id) const { std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - c->Message(0, "Guild %d not found.", guild_id); + c->Message(Chat::White, "Guild %d not found.", guild_id); return; } const GuildInfo *info = res->second; - c->Message(0, "Guild info DB# %i <%s>", guild_id, info->name.c_str()); + c->Message(Chat::White, "Guild info DB# %i <%s>", guild_id, info->name.c_str()); char leadername[64]; database.GetCharName(info->leader_char_id, leadername); - c->Message(0, "Guild Leader: %s", leadername); + c->Message(Chat::White, "Guild Leader: %s", leadername); char permbuffer[256]; uint8 i; @@ -232,8 +232,8 @@ void ZoneGuildManager::DescribeGuild(Client *c, uint32 guild_id) const { for(r = 0; r < _MaxGuildAction; r++) permptr += sprintf(permptr, " %s: %c", GuildActionNames[r], info->ranks[i].permissions[r]?'Y':'N'); - c->Message(0, "Rank %i: %s", i, info->ranks[i].name.c_str()); - c->Message(0, "Permissions: %s", permbuffer); + c->Message(Chat::White, "Rank %i: %s", i, info->ranks[i].name.c_str()); + c->Message(Chat::White, "Permissions: %s", permbuffer); } } @@ -537,14 +537,14 @@ void ZoneGuildManager::AddMemberApproval(uint32 refid,Client* name) if(tmp != 0) { if(!tmp->AddMemberApproval(name)) - name->Message(0,"Unable to add to list."); + name->Message(Chat::White,"Unable to add to list."); else { - name->Message(0,"Added to list."); + name->Message(Chat::White,"Added to list."); } } else - name->Message(0,"Unable to find guild reference id."); + name->Message(Chat::White,"Unable to find guild reference id."); } ZoneGuildManager::~ZoneGuildManager() @@ -1397,7 +1397,7 @@ bool GuildApproval::ProcessApproval() if(deletion_timer->Check() || !owner) { if(owner) - owner->Message(0,"You took too long! Your guild request has been deleted."); + owner->Message(Chat::White,"You took too long! Your guild request has been deleted."); return false; } @@ -1414,7 +1414,7 @@ GuildApproval::GuildApproval(const char* guildname, Client* owner,uint32 id) this->owner = owner; this->refid = id; if(owner) - owner->Message(0,"You can now start getting your guild approved, tell your %i members to #guildapprove %i, you have 30 minutes to create your guild.",tmp,GetID()); + owner->Message(Chat::White,"You can now start getting your guild approved, tell your %i members to #guildapprove %i, you have 30 minutes to create your guild.",tmp,GetID()); for(int i=0;iMessage(0,"%i: %s",i,members[i]->GetName()); + requestee->Message(Chat::White,"%i: %s",i,members[i]->GetName()); } } @@ -1484,8 +1484,8 @@ void GuildApproval::GuildApproved() { if(members[i]) { - owner->Message(0, "%s",members[i]->GetName()); - owner->Message(0, "%i",members[i]->CharacterID()); + owner->Message(Chat::White, "%s",members[i]->GetName()); + owner->Message(Chat::White, "%i",members[i]->CharacterID()); guild_mgr.SetGuild(members[i]->CharacterID(),tmpeq,0); size_t len = MBUFFER - strlen(gmembers)+1; strncat(gmembers," ",len); @@ -1521,7 +1521,7 @@ void GuildApproval::GuildApproved() memcpy(pack->pBuffer, &tmpeq, 4); worldserver.SendPacket(pack); safe_delete(pack); - owner->Message(0, "Your guild was created."); + owner->Message(Chat::White, "Your guild was created."); owner = 0; } diff --git a/zone/hate_list.cpp b/zone/hate_list.cpp index 242a4c8e3..478c9ac50 100644 --- a/zone/hate_list.cpp +++ b/zone/hate_list.cpp @@ -608,7 +608,7 @@ void HateList::PrintHateListToClient(Client *c) while (iterator != list.end()) { struct_HateList *e = (*iterator); - c->Message(0, "- name: %s, damage: %d, hate: %d", + c->Message(Chat::White, "- name: %s, damage: %d, hate: %d", (e->entity_on_hatelist && e->entity_on_hatelist->GetName()) ? e->entity_on_hatelist->GetName() : "(null)", e->hatelist_damage, e->stored_hate_amount); diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 94ca78007..500663491 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -3397,7 +3397,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool Log(Logs::General, Logs::Error, "Client::InterrogateInventory() called for %s by %s with an error state of %s", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE")); } if (!silent) { - requester->Message(1, "--- Inventory Interrogation Report for %s (requested by: %s, error state: %s) ---", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE")); + requester->Message(Chat::Default, "--- Inventory Interrogation Report for %s (requested by: %s, error state: %s) ---", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE")); } // call InterrogateInventory_ for report @@ -3419,8 +3419,8 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool Log(Logs::Detail, Logs::None, "[CLIENT] Client::InterrogateInventory() -- End"); } if (!silent) { - requester->Message(1, "Target interrogation flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); - requester->Message(1, "--- End of Interrogation Report ---"); + requester->Message(Chat::Default, "Target interrogation flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); + requester->Message(Chat::Default, "--- End of Interrogation Report ---"); } instmap.clear(); diff --git a/zone/mob.cpp b/zone/mob.cpp index a5d7ae261..f9665af32 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -1551,39 +1551,39 @@ void Mob::ShowStats(Client* client) } else if (IsCorpse()) { if (IsPlayerCorpse()) { - client->Message(0, " CharID: %i PlayerCorpse: %i", CastToCorpse()->GetCharID(), CastToCorpse()->GetCorpseDBID()); + client->Message(Chat::White, " CharID: %i PlayerCorpse: %i", CastToCorpse()->GetCharID(), CastToCorpse()->GetCorpseDBID()); } else { - client->Message(0, " NPCCorpse", GetID()); + client->Message(Chat::White, " NPCCorpse", GetID()); } } else { - client->Message(0, " Level: %i AC: %i Class: %i Size: %1.1f Haste: %i", GetLevel(), ACSum(), GetClass(), GetSize(), GetHaste()); - client->Message(0, " HP: %i Max HP: %i",GetHP(), GetMaxHP()); - client->Message(0, " Mana: %i Max Mana: %i", GetMana(), GetMaxMana()); - client->Message(0, " Total ATK: %i Worn/Spell ATK (Cap %i): %i", GetATK(), RuleI(Character, ItemATKCap), GetATKBonus()); - client->Message(0, " STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetSTR(), GetSTA(), GetDEX(), GetAGI(), GetINT(), GetWIS(), GetCHA()); - client->Message(0, " MR: %i PR: %i FR: %i CR: %i DR: %i Corruption: %i PhR: %i", GetMR(), GetPR(), GetFR(), GetCR(), GetDR(), GetCorrup(), GetPhR()); - client->Message(0, " Race: %i BaseRace: %i Texture: %i HelmTexture: %i Gender: %i BaseGender: %i", GetRace(), GetBaseRace(), GetTexture(), GetHelmTexture(), GetGender(), GetBaseGender()); + client->Message(Chat::White, " Level: %i AC: %i Class: %i Size: %1.1f Haste: %i", GetLevel(), ACSum(), GetClass(), GetSize(), GetHaste()); + client->Message(Chat::White, " HP: %i Max HP: %i",GetHP(), GetMaxHP()); + client->Message(Chat::White, " Mana: %i Max Mana: %i", GetMana(), GetMaxMana()); + client->Message(Chat::White, " Total ATK: %i Worn/Spell ATK (Cap %i): %i", GetATK(), RuleI(Character, ItemATKCap), GetATKBonus()); + client->Message(Chat::White, " STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetSTR(), GetSTA(), GetDEX(), GetAGI(), GetINT(), GetWIS(), GetCHA()); + client->Message(Chat::White, " MR: %i PR: %i FR: %i CR: %i DR: %i Corruption: %i PhR: %i", GetMR(), GetPR(), GetFR(), GetCR(), GetDR(), GetCorrup(), GetPhR()); + client->Message(Chat::White, " Race: %i BaseRace: %i Texture: %i HelmTexture: %i Gender: %i BaseGender: %i", GetRace(), GetBaseRace(), GetTexture(), GetHelmTexture(), GetGender(), GetBaseGender()); if (client->Admin() >= 100) - client->Message(0, " EntityID: %i PetID: %i OwnerID: %i AIControlled: %i Targetted: %i", GetID(), GetPetID(), GetOwnerID(), IsAIControlled(), targeted); + client->Message(Chat::White, " EntityID: %i PetID: %i OwnerID: %i AIControlled: %i Targetted: %i", GetID(), GetPetID(), GetOwnerID(), IsAIControlled(), targeted); if (IsNPC()) { NPC *n = CastToNPC(); uint32 spawngroupid = 0; if(n->respawn2 != 0) spawngroupid = n->respawn2->SpawnGroupID(); - client->Message(0, " NPCID: %u SpawnGroupID: %u Grid: %i LootTable: %u FactionID: %i SpellsID: %u ", GetNPCTypeID(),spawngroupid, n->GetGrid(), n->GetLoottableID(), n->GetNPCFactionID(), n->GetNPCSpellsID()); - client->Message(0, " Accuracy: %i MerchantID: %i EmoteID: %i Runspeed: %.3f Walkspeed: %.3f", n->GetAccuracyRating(), n->MerchantType, n->GetEmoteID(), static_cast(0.025f * n->GetRunspeed()), static_cast(0.025f * n->GetWalkspeed())); + client->Message(Chat::White, " NPCID: %u SpawnGroupID: %u Grid: %i LootTable: %u FactionID: %i SpellsID: %u ", GetNPCTypeID(),spawngroupid, n->GetGrid(), n->GetLoottableID(), n->GetNPCFactionID(), n->GetNPCSpellsID()); + client->Message(Chat::White, " Accuracy: %i MerchantID: %i EmoteID: %i Runspeed: %.3f Walkspeed: %.3f", n->GetAccuracyRating(), n->MerchantType, n->GetEmoteID(), static_cast(0.025f * n->GetRunspeed()), static_cast(0.025f * n->GetWalkspeed())); n->QueryLoot(client); } if (IsAIControlled()) { - client->Message(0, " AggroRange: %1.0f AssistRange: %1.0f", GetAggroRange(), GetAssistRange()); + client->Message(Chat::White, " AggroRange: %1.0f AssistRange: %1.0f", GetAggroRange(), GetAssistRange()); } - client->Message(0, " compute_tohit: %i TotalToHit: %i", compute_tohit(EQEmu::skills::SkillHandtoHand), GetTotalToHit(EQEmu::skills::SkillHandtoHand, 0)); - client->Message(0, " compute_defense: %i TotalDefense: %i", compute_defense(), GetTotalDefense()); - client->Message(0, " offense: %i mitigation ac: %i", offense(EQEmu::skills::SkillHandtoHand), GetMitigationAC()); + client->Message(Chat::White, " compute_tohit: %i TotalToHit: %i", compute_tohit(EQEmu::skills::SkillHandtoHand), GetTotalToHit(EQEmu::skills::SkillHandtoHand, 0)); + client->Message(Chat::White, " compute_defense: %i TotalDefense: %i", compute_defense(), GetTotalDefense()); + client->Message(Chat::White, " offense: %i mitigation ac: %i", offense(EQEmu::skills::SkillHandtoHand), GetMitigationAC()); } } @@ -1620,33 +1620,33 @@ void Mob::DoAnim(const int animnum, int type, bool ackreq, eqFilterType filter) void Mob::ShowBuffs(Client* client) { if(SPDAT_RECORDS <= 0) return; - client->Message(0, "Buffs on: %s", this->GetName()); + client->Message(Chat::White, "Buffs on: %s", this->GetName()); uint32 i; uint32 buff_count = GetMaxTotalSlots(); for (i=0; i < buff_count; i++) { if (buffs[i].spellid != SPELL_UNKNOWN) { if (spells[buffs[i].spellid].buffdurationformula == DF_Permanent) - client->Message(0, " %i: %s: Permanent", i, spells[buffs[i].spellid].name); + client->Message(Chat::White, " %i: %s: Permanent", i, spells[buffs[i].spellid].name); else - client->Message(0, " %i: %s: %i tics left", i, spells[buffs[i].spellid].name, buffs[i].ticsremaining); + client->Message(Chat::White, " %i: %s: %i tics left", i, spells[buffs[i].spellid].name, buffs[i].ticsremaining); } } if (IsClient()){ - client->Message(0, "itembonuses:"); - client->Message(0, "Atk:%i Ac:%i HP(%i):%i Mana:%i", itembonuses.ATK, itembonuses.AC, itembonuses.HPRegen, itembonuses.HP, itembonuses.Mana); - client->Message(0, "Str:%i Sta:%i Dex:%i Agi:%i Int:%i Wis:%i Cha:%i", + client->Message(Chat::White, "itembonuses:"); + client->Message(Chat::White, "Atk:%i Ac:%i HP(%i):%i Mana:%i", itembonuses.ATK, itembonuses.AC, itembonuses.HPRegen, itembonuses.HP, itembonuses.Mana); + client->Message(Chat::White, "Str:%i Sta:%i Dex:%i Agi:%i Int:%i Wis:%i Cha:%i", itembonuses.STR,itembonuses.STA,itembonuses.DEX,itembonuses.AGI,itembonuses.INT,itembonuses.WIS,itembonuses.CHA); - client->Message(0, "SvMagic:%i SvFire:%i SvCold:%i SvPoison:%i SvDisease:%i", + client->Message(Chat::White, "SvMagic:%i SvFire:%i SvCold:%i SvPoison:%i SvDisease:%i", itembonuses.MR,itembonuses.FR,itembonuses.CR,itembonuses.PR,itembonuses.DR); - client->Message(0, "DmgShield:%i Haste:%i", itembonuses.DamageShield, itembonuses.haste ); - client->Message(0, "spellbonuses:"); - client->Message(0, "Atk:%i Ac:%i HP(%i):%i Mana:%i", spellbonuses.ATK, spellbonuses.AC, spellbonuses.HPRegen, spellbonuses.HP, spellbonuses.Mana); - client->Message(0, "Str:%i Sta:%i Dex:%i Agi:%i Int:%i Wis:%i Cha:%i", + client->Message(Chat::White, "DmgShield:%i Haste:%i", itembonuses.DamageShield, itembonuses.haste ); + client->Message(Chat::White, "spellbonuses:"); + client->Message(Chat::White, "Atk:%i Ac:%i HP(%i):%i Mana:%i", spellbonuses.ATK, spellbonuses.AC, spellbonuses.HPRegen, spellbonuses.HP, spellbonuses.Mana); + client->Message(Chat::White, "Str:%i Sta:%i Dex:%i Agi:%i Int:%i Wis:%i Cha:%i", spellbonuses.STR,spellbonuses.STA,spellbonuses.DEX,spellbonuses.AGI,spellbonuses.INT,spellbonuses.WIS,spellbonuses.CHA); - client->Message(0, "SvMagic:%i SvFire:%i SvCold:%i SvPoison:%i SvDisease:%i", + client->Message(Chat::White, "SvMagic:%i SvFire:%i SvCold:%i SvPoison:%i SvDisease:%i", spellbonuses.MR,spellbonuses.FR,spellbonuses.CR,spellbonuses.PR,spellbonuses.DR); - client->Message(0, "DmgShield:%i Haste:%i", spellbonuses.DamageShield, spellbonuses.haste ); + client->Message(Chat::White, "DmgShield:%i Haste:%i", spellbonuses.DamageShield, spellbonuses.haste ); } } @@ -1654,15 +1654,15 @@ void Mob::ShowBuffList(Client* client) { if(SPDAT_RECORDS <= 0) return; - client->Message(0, "Buffs on: %s", this->GetCleanName()); + client->Message(Chat::White, "Buffs on: %s", this->GetCleanName()); uint32 i; uint32 buff_count = GetMaxTotalSlots(); for (i = 0; i < buff_count; i++) { if (buffs[i].spellid != SPELL_UNKNOWN) { if (spells[buffs[i].spellid].buffdurationformula == DF_Permanent) - client->Message(0, " %i: %s: Permanent", i, spells[buffs[i].spellid].name); + client->Message(Chat::White, " %i: %s: Permanent", i, spells[buffs[i].spellid].name); else - client->Message(0, " %i: %s: %i tics left", i, spells[buffs[i].spellid].name, buffs[i].ticsremaining); + client->Message(Chat::White, " %i: %s: %i tics left", i, spells[buffs[i].spellid].name, buffs[i].ticsremaining); } } } diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 6b7218417..31a0fcb40 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -2758,7 +2758,7 @@ void NPC::AISpellsList(Client *c) return; for (auto it = AIspells.begin(); it != AIspells.end(); ++it) - c->Message(0, "%s (%d): Type %d, Priority %d, Recast Delay %d, Resist Adjust %d, Min HP %d, Max HP %d", + c->Message(Chat::White, "%s (%d): Type %d, Priority %d, Recast Delay %d, Resist Adjust %d, Min HP %d, Max HP %d", spells[it->spellid].name, it->spellid, it->type, it->priority, it->recast_delay, it->resist_adjust, it->min_hp, it->max_hp); return; diff --git a/zone/mob_info.cpp b/zone/mob_info.cpp index 174a00330..8cf486dea 100644 --- a/zone/mob_info.cpp +++ b/zone/mob_info.cpp @@ -624,7 +624,7 @@ inline void NPCCommandsMenu(Client* client, NPC* npc) if (menu_commands.length() > 0) { std::string dev_menu = "[" + EQEmu::SayLinkEngine::GenerateQuestSaylink("#devtools", false, "DevTools") + "] ";; - client->Message(0, "| %s [Show Commands] %s", dev_menu.c_str(), menu_commands.c_str()); + client->Message(Chat::White, "| %s [Show Commands] %s", dev_menu.c_str(), menu_commands.c_str()); } } diff --git a/zone/npc.cpp b/zone/npc.cpp index 30bf0b614..ebbf5397f 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -611,7 +611,7 @@ void NPC::ClearItemList() { void NPC::QueryLoot(Client* to) { - to->Message(0, "| # Current Loot (%s) LootTableID: %i", GetName(), GetLoottableID()); + to->Message(Chat::White, "| # Current Loot (%s) LootTableID: %i", GetName(), GetLoottableID()); int item_count = 0; for (auto cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++item_count) { @@ -639,7 +639,7 @@ void NPC::QueryLoot(Client* to) ); } - to->Message(0, "| %i Platinum %i Gold %i Silver %i Copper", platinum, gold, silver, copper); + to->Message(Chat::White, "| %i Platinum %i Gold %i Silver %i Copper", platinum, gold, silver, copper); } void NPC::AddCash(uint16 in_copper, uint16 in_silver, uint16 in_gold, uint16 in_platinum) { @@ -1190,17 +1190,17 @@ NPC* NPC::SpawnNPC(const char* spawncommand, const glm::vec4& position, Client* if (client) { // Notify client of spawn data - client->Message(0, "New spawn:"); - client->Message(0, "Name: %s", npc->name); - client->Message(0, "Race: %u", npc->race); - client->Message(0, "Level: %u", npc->level); - client->Message(0, "Material: %u", npc->texture); - client->Message(0, "Current/Max HP: %i", npc->max_hp); - client->Message(0, "Gender: %u", npc->gender); - client->Message(0, "Class: %u", npc->class_); - client->Message(0, "Weapon Item Number: %u/%u", npc->d_melee_texture1, npc->d_melee_texture2); - client->Message(0, "MerchantID: %u", npc->MerchantType); - client->Message(0, "Bodytype: %u", npc->bodytype); + client->Message(Chat::White, "New spawn:"); + client->Message(Chat::White, "Name: %s", npc->name); + client->Message(Chat::White, "Race: %u", npc->race); + client->Message(Chat::White, "Level: %u", npc->level); + client->Message(Chat::White, "Material: %u", npc->texture); + client->Message(Chat::White, "Current/Max HP: %i", npc->max_hp); + client->Message(Chat::White, "Gender: %u", npc->gender); + client->Message(Chat::White, "Class: %u", npc->class_); + client->Message(Chat::White, "Weapon Item Number: %u/%u", npc->d_melee_texture1, npc->d_melee_texture2); + client->Message(Chat::White, "MerchantID: %u", npc->MerchantType); + client->Message(Chat::White, "Bodytype: %u", npc->bodytype); } return npc; @@ -1471,7 +1471,7 @@ uint32 ZoneDatabase::AddNPCTypes(const char *zone, uint32 zone_version, Client * npc_type_id = results.LastInsertedID(); if (client) - client->Message(0, "%s npc_type ID %i created successfully!", numberlessName, npc_type_id); + client->Message(Chat::White, "%s npc_type ID %i created successfully!", numberlessName, npc_type_id); return 1; } @@ -1694,7 +1694,7 @@ void NPC::PickPocket(Client* thief) return; } - thief->Message(0, "This target's pockets are empty"); + thief->Message(Chat::White, "This target's pockets are empty"); thief->SendPickPocketResponse(this, 0, PickPocketFailed); } diff --git a/zone/object.cpp b/zone/object.cpp index 4306c6642..241d3a3f1 100644 --- a/zone/object.cpp +++ b/zone/object.cpp @@ -572,7 +572,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object) if (sender->ClientVersion() >= EQEmu::versions::ClientVersion::RoF) { coa->drop_id = 0xFFFFFFFF; - sender->Message(0, "Someone else is using that. Try again later."); + sender->Message(Chat::White, "Someone else is using that. Try again later."); } } diff --git a/zone/pathfinder_nav_mesh.cpp b/zone/pathfinder_nav_mesh.cpp index 090afa920..262d7a923 100644 --- a/zone/pathfinder_nav_mesh.cpp +++ b/zone/pathfinder_nav_mesh.cpp @@ -355,7 +355,7 @@ void PathfinderNavmesh::DebugCommand(Client *c, const Seperator *sep) { if (sep->arg[1][0] == '\0' || !strcasecmp(sep->arg[1], "help")) { - c->Message(0, "#path show: Plots a path from the user to their target."); + c->Message(Chat::White, "#path show: Plots a path from the user to their target."); return; } diff --git a/zone/pathfinder_waypoint.cpp b/zone/pathfinder_waypoint.cpp index 58ad5afea..83d924499 100644 --- a/zone/pathfinder_waypoint.cpp +++ b/zone/pathfinder_waypoint.cpp @@ -200,9 +200,9 @@ void PathfinderWaypoint::DebugCommand(Client *c, const Seperator *sep) { if(sep->arg[1][0] == '\0' || !strcasecmp(sep->arg[1], "help")) { - c->Message(0, "Syntax: #path shownodes: Spawns a npc to represent every npc node."); - c->Message(0, "#path show: Plots a path from the user to their target."); - c->Message(0, "#path info node_id: Gives information about node info (requires shownode target)."); + c->Message(Chat::White, "Syntax: #path shownodes: Spawns a npc to represent every npc node."); + c->Message(Chat::White, "#path show: Plots a path from the user to their target."); + c->Message(Chat::White, "#path info node_id: Gives information about node info (requires shownode target)."); return; } @@ -425,11 +425,11 @@ void PathfinderWaypoint::NodeInfo(Client *c) return; } - c->Message(0, "Pathing node: %i at (%.2f, %.2f, %.2f) with bestz %.2f", + c->Message(Chat::White, "Pathing node: %i at (%.2f, %.2f, %.2f) with bestz %.2f", node->id, node->v.x, node->v.y, node->v.z, node->bestz); for (auto &edge : node->edges) { - c->Message(0, "id: %i, distance: %.2f, door id: %i, is teleport: %i", + c->Message(Chat::White, "id: %i, distance: %.2f, door id: %i, is teleport: %i", edge.first, edge.second.distance, edge.second.door_id, diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index cc19c59fd..9c8898b2e 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -1097,7 +1097,7 @@ uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) { initiator->GetPP().disciplines.values[r] = spell_id_; database.SaveCharacterDisc(char_id, r, spell_id_); change = true; - initiator->Message(0, "You have learned a new discipline!"); + initiator->Message(Chat::White, "You have learned a new discipline!"); ++count; // success counter } break; // continue the 1st loop @@ -1109,7 +1109,7 @@ uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) { initiator->GetPP().disciplines.values[r] = spell_id_; database.SaveCharacterDisc(char_id, r, spell_id_); change = true; - initiator->Message(0, "You have learned a new discipline!"); + initiator->Message(Chat::White, "You have learned a new discipline!"); ++count; } break; @@ -1118,7 +1118,7 @@ uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) { initiator->GetPP().disciplines.values[r] = spell_id_; database.SaveCharacterDisc(char_id, r, spell_id_); change = true;; - initiator->Message(0, "You have learned a new discipline!"); + initiator->Message(Chat::White, "You have learned a new discipline!"); ++count; // success counter break; // continue the 1st loop } @@ -1411,7 +1411,7 @@ void QuestManager::itemlink(int item_id) { linker.SetLinkType(EQEmu::saylink::SayLinkItemData); linker.SetItemData(item); - initiator->Message(0, "%s tells you, %s", owner->GetCleanName(), linker.GenerateLink().c_str()); + initiator->Message(Chat::White, "%s tells you, %s", owner->GetCleanName(), linker.GenerateLink().c_str()); } } @@ -2171,11 +2171,11 @@ bool QuestManager::createBot(const char *name, const char *lastname, uint8 level std::string test_name = name; bool available_flag = false; if(!database.botdb.QueryNameAvailablity(test_name, available_flag)) { - initiator->Message(0, "%s for '%s'", BotDatabase::fail::QueryNameAvailablity(), (char*)name); + initiator->Message(Chat::White, "%s for '%s'", BotDatabase::fail::QueryNameAvailablity(), (char*)name); return false; } if (!available_flag) { - initiator->Message(0, "The name %s is already being used or is invalid. Please choose a different name.", (char*)name); + initiator->Message(Chat::White, "The name %s is already being used or is invalid. Please choose a different name.", (char*)name); return false; } @@ -2184,23 +2184,23 @@ bool QuestManager::createBot(const char *name, const char *lastname, uint8 level if(NewBot) { if(!NewBot->IsValidRaceClassCombo()) { - initiator->Message(0, "That Race/Class combination cannot be created."); + initiator->Message(Chat::White, "That Race/Class combination cannot be created."); return false; } if(!NewBot->IsValidName()) { - initiator->Message(0, "%s has invalid characters. You can use only the A-Z, a-z and _ characters in a bot name.", NewBot->GetCleanName()); + initiator->Message(Chat::White, "%s has invalid characters. You can use only the A-Z, a-z and _ characters in a bot name.", NewBot->GetCleanName()); return false; } // Now that all validation is complete, we can save our newly created bot if(!NewBot->Save()) { - initiator->Message(0, "Unable to save %s as a bot.", NewBot->GetCleanName()); + initiator->Message(Chat::White, "Unable to save %s as a bot.", NewBot->GetCleanName()); } else { - initiator->Message(0, "%s saved as bot %u.", NewBot->GetCleanName(), NewBot->GetBotID()); + initiator->Message(Chat::White, "%s saved as bot %u.", NewBot->GetCleanName(), NewBot->GetBotID()); return true; } } diff --git a/zone/raids.cpp b/zone/raids.cpp index 51fd2296f..9b5485f40 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -813,7 +813,7 @@ void Raid::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum //I could not get MoneyOnCorpse to work, so we use this members[i].member->AddMoneyToPP(cpsplit, spsplit, gpsplit, ppsplit, true); - members[i].member->Message(2, msg.c_str()); + members[i].member->Message(Chat::Green, msg.c_str()); } } } diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 3940834b8..cc0ea1b3b 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -551,7 +551,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) { if (bIsBehind || bCanFrontalBS || (IsNPC() && CanFacestab())) { // Player is behind other OR can do Frontal Backstab if (bCanFrontalBS && IsClient()) // I don't think there is any message ... - CastToClient()->Message(0,"Your fierce attack is executed with such grace, your target did not see it coming!"); + CastToClient()->Message(Chat::White,"Your fierce attack is executed with such grace, your target did not see it coming!"); RogueBackstab(other,false,ReuseTime); if (level > 54) { diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 1f8acfa2f..6286f9c51 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -387,7 +387,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove TryTriggerOnValueAmount(false, true); #ifdef SPELL_EFFECT_SPAM if (caster) - caster->Message(0, "You have gained %+i mana!", effect_value); + caster->Message(Chat::White, "You have gained %+i mana!", effect_value); #endif } } @@ -745,19 +745,19 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove WipeHateList(); if (IsClient() && caster->IsClient()) { - caster->Message(0, "Unable to cast charm on a fellow player."); + caster->Message(Chat::White, "Unable to cast charm on a fellow player."); BuffFadeByEffect(SE_Charm); break; } else if(IsCorpse()) { - caster->Message(0, "Unable to cast charm on a corpse."); + caster->Message(Chat::White, "Unable to cast charm on a corpse."); BuffFadeByEffect(SE_Charm); break; } else if(caster->GetPet() != nullptr && caster->IsClient()) { - caster->Message(0, "You cannot charm something when you already have a pet."); + caster->Message(Chat::White, "You cannot charm something when you already have a pet."); BuffFadeByEffect(SE_Charm); break; } else if(GetOwner()) { - caster->Message(0, "You cannot charm someone else's pet!"); + caster->Message(Chat::White, "You cannot charm someone else's pet!"); BuffFadeByEffect(SE_Charm); break; } diff --git a/zone/spells.cpp b/zone/spells.cpp index f6cf829c5..e0ade3798 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -1211,7 +1211,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo if(!HasInstrument) { // if the instrument is missing, log it and interrupt the song Log(Logs::Detail, Logs::Spells, "Song %d: Canceled. Missing required instrument %d", spell_id, component); if(c->GetGM()) - c->Message(0, "Your GM status allows you to finish casting even though you're missing a required instrument."); + c->Message(Chat::White, "Your GM status allows you to finish casting even though you're missing a required instrument."); else { InterruptSpell(); return; @@ -1248,7 +1248,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo if (missingreags) { if(c->GetGM()) - c->Message(0, "Your GM status allows you to finish casting even though you're missing required components."); + c->Message(Chat::White, "Your GM status allows you to finish casting even though you're missing required components."); else { InterruptSpell(); return; diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 40d301e7d..895e01e90 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -1266,18 +1266,18 @@ void TaskManager::ExplainTask(Client*c, int TaskID) { if(!c) return; if((TaskID<=0) || (TaskID>=MAXTASKS)) { - c->Message(0, "TaskID out-of-range."); + c->Message(Chat::White, "TaskID out-of-range."); return; } if(Tasks[TaskID] == nullptr) { - c->Message(0, "Task does not exist."); + c->Message(Chat::White, "Task does not exist."); return; } char Explanation[1000], *ptr; - c->Message(0, "Task %4i: Title: %s", TaskID, Tasks[TaskID]->Description.c_str()); - c->Message(0, "%3i Activities", Tasks[TaskID]->ActivityCount); + c->Message(Chat::White, "Task %4i: Title: %s", TaskID, Tasks[TaskID]->Description.c_str()); + c->Message(Chat::White, "%3i Activities", Tasks[TaskID]->ActivityCount); ptr = Explanation; for(int i=0; iActivityCount; i++) { @@ -1936,7 +1936,7 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation *Task, int T // Send the updated task/activity list to the client taskmanager->SendSingleActiveTaskToClient(c, *info, TaskComplete, false); // Inform the client the task has been updated, both by a chat message - c->Message(0, "Your task '%s' has been updated.", Task->Title.c_str()); + c->Message(Chat::White, "Your task '%s' has been updated.", Task->Title.c_str()); if(Task->Activity[ActivityID].GoalMethod != METHODQUEST) { if (!ignore_quest_update){ @@ -2306,12 +2306,12 @@ void ClientTaskState::ResetTaskActivity(Client *c, int TaskID, int ActivityID) void ClientTaskState::ShowClientTasks(Client *c) { - c->Message(0, "Task Information:"); + c->Message(Chat::White, "Task Information:"); if (ActiveTask.TaskID != TASKSLOTEMPTY) { - c->Message(0, "Task: %i %s", ActiveTask.TaskID, taskmanager->Tasks[ActiveTask.TaskID]->Title.c_str()); - c->Message(0, " Description: [%s]\n", taskmanager->Tasks[ActiveTask.TaskID]->Description.c_str()); + c->Message(Chat::White, "Task: %i %s", ActiveTask.TaskID, taskmanager->Tasks[ActiveTask.TaskID]->Title.c_str()); + c->Message(Chat::White, " Description: [%s]\n", taskmanager->Tasks[ActiveTask.TaskID]->Description.c_str()); for (int j = 0; j < taskmanager->GetActivityCount(ActiveTask.TaskID); j++) { - c->Message(0, " Activity: %2d, DoneCount: %2d, Status: %d (0=Hidden, 1=Active, 2=Complete)", + c->Message(Chat::White, " Activity: %2d, DoneCount: %2d, Status: %d (0=Hidden, 1=Active, 2=Complete)", ActiveTask.Activity[j].ActivityID, ActiveTask.Activity[j].DoneCount, ActiveTask.Activity[j].State); } @@ -2321,11 +2321,11 @@ void ClientTaskState::ShowClientTasks(Client *c) if (ActiveQuests[i].TaskID == TASKSLOTEMPTY) continue; - c->Message(0, "Quest: %i %s", ActiveQuests[i].TaskID, + c->Message(Chat::White, "Quest: %i %s", ActiveQuests[i].TaskID, taskmanager->Tasks[ActiveQuests[i].TaskID]->Title.c_str()); - c->Message(0, " Description: [%s]\n", taskmanager->Tasks[ActiveQuests[i].TaskID]->Description.c_str()); + c->Message(Chat::White, " Description: [%s]\n", taskmanager->Tasks[ActiveQuests[i].TaskID]->Description.c_str()); for (int j = 0; j < taskmanager->GetActivityCount(ActiveQuests[i].TaskID); j++) { - c->Message(0, " Activity: %2d, DoneCount: %2d, Status: %d (0=Hidden, 1=Active, 2=Complete)", + c->Message(Chat::White, " Activity: %2d, DoneCount: %2d, Status: %d (0=Hidden, 1=Active, 2=Complete)", ActiveQuests[i].Activity[j].ActivityID, ActiveQuests[i].Activity[j].DoneCount, ActiveQuests[i].Activity[j].State); } @@ -3309,7 +3309,7 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID, bool enfor ActiveTaskCount++; taskmanager->SendSingleActiveTaskToClient(c, *active_slot, false, true); - c->Message(0, "You have been assigned the task '%s'.", taskmanager->Tasks[TaskID]->Title.c_str()); + c->Message(Chat::White, "You have been assigned the task '%s'.", taskmanager->Tasks[TaskID]->Title.c_str()); std::string buf = std::to_string(TaskID); diff --git a/zone/tune.cpp b/zone/tune.cpp index e4d730abc..22ca90375 100644 --- a/zone/tune.cpp +++ b/zone/tune.cpp @@ -249,9 +249,9 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh if (Msg){ - GM->Message(0, "######### Melee Mitigation Report: Start [Detail Level %i]#########", Msg); - GM->Message(0, "#ATTACKER: %s", attacker->GetCleanName()); - GM->Message(0, "#DEFENDER: %s", defender->GetCleanName()); + GM->Message(Chat::White, "######### Melee Mitigation Report: Start [Detail Level %i]#########", Msg); + GM->Message(Chat::White, "#ATTACKER: %s", attacker->GetCleanName()); + GM->Message(Chat::White, "#DEFENDER: %s", defender->GetCleanName()); } if (RuleB(Combat, UseIntervalAC)) { @@ -264,16 +264,16 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh float weight = 0.0; if (Msg >= 2){ - GM->Message(0, " "); - GM->Message(0, "### Calculate Mitigation Rating ###"); + GM->Message(Chat::White, " "); + GM->Message(Chat::White, "### Calculate Mitigation Rating ###"); if (aabonuses.CombatStability) - GM->Message(0, "# %i #### DEFENDER SE_CombatStability(259) AA Bonus", aabonuses.CombatStability); + GM->Message(Chat::White, "# %i #### DEFENDER SE_CombatStability(259) AA Bonus", aabonuses.CombatStability); if (spellbonuses.CombatStability) - GM->Message(0, "# %i #### DEFENDER SE_CombatStability(259) Spell Bonus", spellbonuses.CombatStability); + GM->Message(Chat::White, "# %i #### DEFENDER SE_CombatStability(259) Spell Bonus", spellbonuses.CombatStability); if (itembonuses.CombatStability) - GM->Message(0, "# %i #### DEFENDER SE_CombatStability(259) Worn Bonus", itembonuses.CombatStability); + GM->Message(Chat::White, "# %i #### DEFENDER SE_CombatStability(259) Worn Bonus", itembonuses.CombatStability); - GM->Message(0, "# %.2f #### DEFENDER Base Soft Cap", softcap); + GM->Message(Chat::White, "# %.2f #### DEFENDER Base Soft Cap", softcap); } float monkweight = RuleI(Combat, MonkACBonusWeight); @@ -287,11 +287,11 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh armor = ac_override; if (Msg >=2 ){ - GM->Message(0, "# %i #### DEFENDER AC Equiped/Worn Bonus", itembonuses.AC); - GM->Message(0, "# %i #### DEFENDER SE_ArmorClass(1) AA Bonus", aabonuses.AC); - GM->Message(0, "# %i #### DEFENDER SE_ArmorClass(1) Spell Bonus", spellbonuses.AC); - GM->Message(0, "# %i #### DEFENDER Shield AC", shield_ac); - GM->Message(0, "# %i #### DEFENDER Total Client Armor - NO shield", armor); + GM->Message(Chat::White, "# %i #### DEFENDER AC Equiped/Worn Bonus", itembonuses.AC); + GM->Message(Chat::White, "# %i #### DEFENDER SE_ArmorClass(1) AA Bonus", aabonuses.AC); + GM->Message(Chat::White, "# %i #### DEFENDER SE_ArmorClass(1) Spell Bonus", spellbonuses.AC); + GM->Message(Chat::White, "# %i #### DEFENDER Shield AC", shield_ac); + GM->Message(Chat::White, "# %i #### DEFENDER Total Client Armor - NO shield", armor); } } else if (IsNPC()) { @@ -301,9 +301,9 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh armor = ac_override; if (Msg >=2 ){ - GM->Message(0, "# %i #### DEFENDER AC Equiped/Worn Bonus", itembonuses.AC); - GM->Message(0, "# %i #### DEFENDER SE_ArmorClass(1) Spell Bonus", spellbonuses.AC); - GM->Message(0, "# %i #### DEFENDER NPC AC Stat", CastToNPC()->GetRawAC()); + GM->Message(Chat::White, "# %i #### DEFENDER AC Equiped/Worn Bonus", itembonuses.AC); + GM->Message(Chat::White, "# %i #### DEFENDER SE_ArmorClass(1) Spell Bonus", spellbonuses.AC); + GM->Message(Chat::White, "# %i #### DEFENDER NPC AC Stat", CastToNPC()->GetRawAC()); } int PetACBonus = 0; @@ -311,7 +311,7 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh if (!IsPet()){ armor = (armor / RuleR(Combat, NPCACFactor)); if (Msg >=2 ) - GM->Message(0, "# %i #### DEFENDER NPC Armor after RuleR(Combat, NPCACFactor) %.2f", armor, RuleR(Combat, NPCACFactor)); + GM->Message(Chat::White, "# %i #### DEFENDER NPC Armor after RuleR(Combat, NPCACFactor) %.2f", armor, RuleR(Combat, NPCACFactor)); } Mob *owner = nullptr; @@ -325,18 +325,18 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh if (Msg >=2 ){ if (owner->aabonuses.PetMeleeMitigation) - GM->Message(0, "# %i #### DEFENDER Pet Owner SE_PetMeleeMitigation(379) AA Bonus", owner->aabonuses.PetMeleeMitigation); + GM->Message(Chat::White, "# %i #### DEFENDER Pet Owner SE_PetMeleeMitigation(379) AA Bonus", owner->aabonuses.PetMeleeMitigation); if (owner->spellbonuses.PetMeleeMitigation) - GM->Message(0, "# %i #### DEFENDER Pet Owner SE_PetMeleeMitigation(379) Spell Bonus",owner->spellbonuses.PetMeleeMitigation); + GM->Message(Chat::White, "# %i #### DEFENDER Pet Owner SE_PetMeleeMitigation(379) Spell Bonus",owner->spellbonuses.PetMeleeMitigation); if (owner->itembonuses.PetMeleeMitigation) - GM->Message(0, "# %i #### DEFENDER Pet Owner SE_PetMeleeMitigation(379) Worn Bonus", owner->itembonuses.PetMeleeMitigation); + GM->Message(Chat::White, "# %i #### DEFENDER Pet Owner SE_PetMeleeMitigation(379) Worn Bonus", owner->itembonuses.PetMeleeMitigation); } } armor += spellbonuses.AC + itembonuses.AC + PetACBonus + 1; if (Msg >= 2) - GM->Message(0, "# %i #### DEFENDER NPC Total Base Armor",armor); + GM->Message(Chat::White, "# %i #### DEFENDER NPC Total Base Armor",armor); } if (opts) { @@ -405,38 +405,38 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh armor = softcap + softcap_armor; if (Msg >= 2) - GM->Message(0, "# %i #### DEFENDER Final Armor [Soft Cap %i Soft Cap Armor %i]",armor, softcap,softcap_armor); + GM->Message(Chat::White, "# %i #### DEFENDER Final Armor [Soft Cap %i Soft Cap Armor %i]",armor, softcap,softcap_armor); } int tmp_armor = armor; if (GetClass() == WIZARD || GetClass() == MAGICIAN || GetClass() == NECROMANCER || GetClass() == ENCHANTER){ mitigation_rating = ((GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) / 4.0) + armor + 1; if (Msg >= 2) - GM->Message(0, "# + %.2f #### DEFENDER Armor Bonus [Defense Skill %i Heroic Agi %i]", mitigation_rating - tmp_armor, GetSkill(EQEmu::skills::SkillDefense), itembonuses.HeroicAGI); + GM->Message(Chat::White, "# + %.2f #### DEFENDER Armor Bonus [Defense Skill %i Heroic Agi %i]", mitigation_rating - tmp_armor, GetSkill(EQEmu::skills::SkillDefense), itembonuses.HeroicAGI); } else{ mitigation_rating = ((GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) / 3.0) + (armor * 1.333333) + 1; if (Msg >= 2) - GM->Message(0, "# + %.2f #### DEFENDER Armor Bonus [Defense Skill %i Heroic Agi %i]", mitigation_rating - tmp_armor, GetSkill(EQEmu::skills::SkillDefense), itembonuses.HeroicAGI); + GM->Message(Chat::White, "# + %.2f #### DEFENDER Armor Bonus [Defense Skill %i Heroic Agi %i]", mitigation_rating - tmp_armor, GetSkill(EQEmu::skills::SkillDefense), itembonuses.HeroicAGI); } mitigation_rating *= 0.847; if (Msg >= 1) - GM->Message(0, "# %.2f #### DEFENDER Final Mitigation Rating", mitigation_rating); + GM->Message(Chat::White, "# %.2f #### DEFENDER Final Mitigation Rating", mitigation_rating); if (Msg >= 2){ - GM->Message(0, " "); - GM->Message(0, "### Mitigation Bonus Effects ###"); + GM->Message(Chat::White, " "); + GM->Message(Chat::White, "### Mitigation Bonus Effects ###"); if (itembonuses.MeleeMitigation) - GM->Message(0, "# %i #### DEFENDER Item Mod2 Shielding", itembonuses.MeleeMitigation); + GM->Message(Chat::White, "# %i #### DEFENDER Item Mod2 Shielding", itembonuses.MeleeMitigation); if (aabonuses.MeleeMitigationEffect) - GM->Message(0, "# %i #### DEFENDER SE_MeleeMitigation(168) AA Bonus", aabonuses.MeleeMitigationEffect); + GM->Message(Chat::White, "# %i #### DEFENDER SE_MeleeMitigation(168) AA Bonus", aabonuses.MeleeMitigationEffect); if (spellbonuses.MeleeMitigationEffect) - GM->Message(0, "# %i #### DEFENDER SE_MeleeMitigation(168) Spell Bonus", spellbonuses.MeleeMitigationEffect); + GM->Message(Chat::White, "# %i #### DEFENDER SE_MeleeMitigation(168) Spell Bonus", spellbonuses.MeleeMitigationEffect); if (itembonuses.MeleeMitigationEffect) - GM->Message(0, "# %i #### DEFENDER SE_MeleeMitigation(168) Worn Bonus", itembonuses.MeleeMitigationEffect); + GM->Message(Chat::White, "# %i #### DEFENDER SE_MeleeMitigation(168) Worn Bonus", itembonuses.MeleeMitigationEffect); } mitigation_rating = mod_mitigation_rating(mitigation_rating, attacker); @@ -458,31 +458,31 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh attack_rating = attacker->mod_attack_rating(attack_rating, this); if (Msg >= 2){ - GM->Message(0, " "); - GM->Message(0, "### Calculate Attack Rating ###"); + GM->Message(Chat::White, " "); + GM->Message(Chat::White, "### Calculate Attack Rating ###"); if (attacker->IsClient()){ - GM->Message(0, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK); - GM->Message(0, "# %i #### ATTACKER SE_ATK(2) AA Bonus", attacker->aabonuses.ATK); - GM->Message(0, "# %i #### ATTACKER SE_ATK(2) spell Bonus", attacker->spellbonuses.ATK); - GM->Message(0, "# %i #### ATTACKER Leadership Bonus", attacker->CastToClient()->GroupLeadershipAAOffenseEnhancement()); - GM->Message(0, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK); - GM->Message(0, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK); - GM->Message(0, "# %.2f #### ATTACKER Strength Stat ATK Bonus [Stat Amt: %i]", ((attacker->GetSTR()-66) * 0.9),attacker->GetSTR()); - GM->Message(0, "# %.2f #### ATTACKER Offensive Skill ATK Bonus [Stat Amt: %i]", (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345), attacker->GetSkill(EQEmu::skills::SkillOffense)); + GM->Message(Chat::White, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK); + GM->Message(Chat::White, "# %i #### ATTACKER SE_ATK(2) AA Bonus", attacker->aabonuses.ATK); + GM->Message(Chat::White, "# %i #### ATTACKER SE_ATK(2) spell Bonus", attacker->spellbonuses.ATK); + GM->Message(Chat::White, "# %i #### ATTACKER Leadership Bonus", attacker->CastToClient()->GroupLeadershipAAOffenseEnhancement()); + GM->Message(Chat::White, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK); + GM->Message(Chat::White, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK); + GM->Message(Chat::White, "# %.2f #### ATTACKER Strength Stat ATK Bonus [Stat Amt: %i]", ((attacker->GetSTR()-66) * 0.9),attacker->GetSTR()); + GM->Message(Chat::White, "# %.2f #### ATTACKER Offensive Skill ATK Bonus [Stat Amt: %i]", (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345), attacker->GetSkill(EQEmu::skills::SkillOffense)); } else{ - GM->Message(0, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK); - GM->Message(0, "# %i #### ATTACKER SE_ATK(2) spell Bonus", attacker->spellbonuses.ATK); - GM->Message(0, "# %i #### ATTACKER NPC ATK Stat", attacker->CastToNPC()->ATK); - GM->Message(0, "# %.2f #### ATTACKER Strength Stat ATK Bonus [Stat Amt: %i]", ((attacker->GetSTR()-66) * 0.9),attacker->GetSTR()); - GM->Message(0, "# %.2f #### ATTACKER Offensive Skill ATK Bonus [Stat Amt: %i]", (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345), attacker->GetSkill(EQEmu::skills::SkillOffense)); + GM->Message(Chat::White, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK); + GM->Message(Chat::White, "# %i #### ATTACKER SE_ATK(2) spell Bonus", attacker->spellbonuses.ATK); + GM->Message(Chat::White, "# %i #### ATTACKER NPC ATK Stat", attacker->CastToNPC()->ATK); + GM->Message(Chat::White, "# %.2f #### ATTACKER Strength Stat ATK Bonus [Stat Amt: %i]", ((attacker->GetSTR()-66) * 0.9),attacker->GetSTR()); + GM->Message(Chat::White, "# %.2f #### ATTACKER Offensive Skill ATK Bonus [Stat Amt: %i]", (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345), attacker->GetSkill(EQEmu::skills::SkillOffense)); } } if (Msg >= 1){ - GM->Message(0, "# %.2f #### ATTACKER Final Attack Rating", attack_rating); - GM->Message(0, "######### Melee Mitigation Report: Complete #########", Msg); + GM->Message(Chat::White, "# %.2f #### ATTACKER Final Attack Rating", attack_rating); + GM->Message(Chat::White, "######### Melee Mitigation Report: Complete #########", Msg); } diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index fb0a85490..bc9e3870d 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -70,7 +70,7 @@ void NPC::AI_SetRoambox(float distance, float max_x, float min_x, float max_y, f void NPC::DisplayWaypointInfo(Client *c) { - c->Message(0, "Mob is on grid %d, in spawn group %d, on waypoint %d/%d", + c->Message(Chat::White, "Mob is on grid %d, in spawn group %d, on waypoint %d/%d", GetGrid(), GetSp2(), GetCurWp(), @@ -81,7 +81,7 @@ void NPC::DisplayWaypointInfo(Client *c) { cur = Waypoints.begin(); end = Waypoints.end(); for (; cur != end; ++cur) { - c->Message(0, "Waypoint %d: (%.2f,%.2f,%.2f,%.2f) pause %d", + c->Message(Chat::White, "Waypoint %d: (%.2f,%.2f,%.2f,%.2f) pause %d", cur->index, cur->x, cur->y, @@ -895,7 +895,7 @@ void ZoneDatabase::AssignGrid(Client *client, int grid, int spawn2id) { return; } - client->Message(0, "Grid assign: spawn2 id = %d updated", spawn2id); + client->Message(Chat::White, "Grid assign: spawn2 id = %d updated", spawn2id); } diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 4d1399f68..2fc29e3b6 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -578,7 +578,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) printf("Zoning %s to %s(%u) - %u\n", client != nullptr ? client->GetCleanName() : "Unknown", szp->zone, database.GetZoneID(szp->zone), szp->instance_id); if (client != 0) { if (strcasecmp(szp->adminname, szp->name) == 0) - client->Message(0, "Zoning to: %s", szp->zone); + client->Message(Chat::White, "Zoning to: %s", szp->zone); else if (client->GetAnon() == 1 && client->Admin() > szp->adminrank) break; else { diff --git a/zone/zone.cpp b/zone/zone.cpp index d20b2934e..f364ab298 100755 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -1770,14 +1770,14 @@ void Zone::SpawnStatus(Mob* client) { while(iterator.MoreElements()) { if (iterator.GetData()->timer.GetRemainingTime() == 0xFFFFFFFF) - client->Message(0, " %d: %1.1f, %1.1f, %1.1f: disabled", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ()); + client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: disabled", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ()); else - client->Message(0, " %d: %1.1f, %1.1f, %1.1f: %1.2f", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ(), (float)iterator.GetData()->timer.GetRemainingTime() / 1000); + client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: %1.2f", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ(), (float)iterator.GetData()->timer.GetRemainingTime() / 1000); x++; iterator.Advance(); } - client->Message(0, "%i spawns listed.", x); + client->Message(Chat::White, "%i spawns listed.", x); } void Zone::ShowEnabledSpawnStatus(Mob* client) @@ -1792,7 +1792,7 @@ void Zone::ShowEnabledSpawnStatus(Mob* client) { if (iterator.GetData()->timer.GetRemainingTime() != 0xFFFFFFFF) { - client->Message(0, " %d: %1.1f, %1.1f, %1.1f: %1.2f", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ(), (float)iterator.GetData()->timer.GetRemainingTime() / 1000); + client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: %1.2f", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ(), (float)iterator.GetData()->timer.GetRemainingTime() / 1000); iEnabledCount++; } @@ -1800,7 +1800,7 @@ void Zone::ShowEnabledSpawnStatus(Mob* client) iterator.Advance(); } - client->Message(0, "%i of %i spawns listed.", iEnabledCount, x); + client->Message(Chat::White, "%i of %i spawns listed.", iEnabledCount, x); } void Zone::ShowDisabledSpawnStatus(Mob* client) @@ -1815,7 +1815,7 @@ void Zone::ShowDisabledSpawnStatus(Mob* client) { if (iterator.GetData()->timer.GetRemainingTime() == 0xFFFFFFFF) { - client->Message(0, " %d: %1.1f, %1.1f, %1.1f: disabled", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ()); + client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: disabled", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ()); iDisabledCount++; } @@ -1823,7 +1823,7 @@ void Zone::ShowDisabledSpawnStatus(Mob* client) iterator.Advance(); } - client->Message(0, "%i of %i spawns listed.", iDisabledCount, x); + client->Message(Chat::White, "%i of %i spawns listed.", iDisabledCount, x); } void Zone::ShowSpawnStatusByID(Mob* client, uint32 spawnid) @@ -1839,9 +1839,9 @@ void Zone::ShowSpawnStatusByID(Mob* client, uint32 spawnid) if (iterator.GetData()->GetID() == spawnid) { if (iterator.GetData()->timer.GetRemainingTime() == 0xFFFFFFFF) - client->Message(0, " %d: %1.1f, %1.1f, %1.1f: disabled", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ()); + client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: disabled", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ()); else - client->Message(0, " %d: %1.1f, %1.1f, %1.1f: %1.2f", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ(), (float)iterator.GetData()->timer.GetRemainingTime() / 1000); + client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: %1.2f", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ(), (float)iterator.GetData()->timer.GetRemainingTime() / 1000); iSpawnIDCount++; @@ -1853,9 +1853,9 @@ void Zone::ShowSpawnStatusByID(Mob* client, uint32 spawnid) } if(iSpawnIDCount > 0) - client->Message(0, "%i of %i spawns listed.", iSpawnIDCount, x); + client->Message(Chat::White, "%i of %i spawns listed.", iSpawnIDCount, x); else - client->Message(0, "No matching spawn id was found in this zone."); + client->Message(Chat::White, "No matching spawn id was found in this zone."); } bool ZoneDatabase::GetDecayTimes(npcDecayTimes_Struct *npcCorpseDecayTimes) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 7c90bcc11..91f456768 100755 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -3544,10 +3544,10 @@ void ZoneDatabase::ListAllInstances(Client* client, uint32 charid) char name[64]; database.GetCharName(charid, name); - client->Message(0, "%s is part of the following instances:", name); + client->Message(Chat::White, "%s is part of the following instances:", name); for (auto row = results.begin(); row != results.end(); ++row) { - client->Message(0, "%s - id: %lu, version: %lu", database.GetZoneName(atoi(row[1])), + client->Message(Chat::White, "%s - id: %lu, version: %lu", database.GetZoneName(atoi(row[1])), (unsigned long)atoi(row[0]), (unsigned long)atoi(row[2])); } } diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 5950d4025..800ee8cd2 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -814,7 +814,7 @@ bool Client::HasZoneFlag(uint32 zone_id) const { void Client::SendZoneFlagInfo(Client *to) const { if(zone_flags.empty()) { - to->Message(0, "%s has no zone flags.", GetName()); + to->Message(Chat::White, "%s has no zone flags.", GetName()); return; } @@ -823,7 +823,7 @@ void Client::SendZoneFlagInfo(Client *to) const { end = zone_flags.end(); char empty[1] = { '\0' }; - to->Message(0, "Flags for %s:", GetName()); + to->Message(Chat::White, "Flags for %s:", GetName()); for(; cur != end; ++cur) { uint32 zoneid = *cur; @@ -843,7 +843,7 @@ void Client::SendZoneFlagInfo(Client *to) const { strcpy(flag_name, "(ERROR GETTING NAME)"); } - to->Message(0, "Has Flag %s for zone %s (%d,%s)", flag_name, long_name, zoneid, short_name); + to->Message(Chat::White, "Has Flag %s for zone %s (%d,%s)", flag_name, long_name, zoneid, short_name); if(long_name != empty) delete[] long_name; } From 20bd37dde70dfbe5a091fcd0552ac3802ac6056c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 11 Aug 2019 01:09:11 -0500 Subject: [PATCH 5/7] More function name refactoring --- common/eq_constants.h | 2 +- zone/attack.cpp | 2 +- zone/bot.cpp | 8 ++--- zone/bot_command.cpp | 4 +-- zone/client.cpp | 10 +++---- zone/client_packet.cpp | 64 ++++++++++++++++++++-------------------- zone/client_process.cpp | 4 +-- zone/merc.cpp | 4 +-- zone/mob.cpp | 8 ++--- zone/mob.h | 8 ++--- zone/oldcode.cpp | 2 +- zone/special_attacks.cpp | 2 +- zone/tasks.cpp | 6 ++-- 13 files changed, 62 insertions(+), 62 deletions(-) diff --git a/common/eq_constants.h b/common/eq_constants.h index bf65f2bfb..6c3e28da0 100644 --- a/common/eq_constants.h +++ b/common/eq_constants.h @@ -71,7 +71,7 @@ //#define AT_Trader 300 // Bazaar Trader Mode (not present in SoF or RoF2) // animations for AT_Anim -#define ANIM_FREEZE 102 +#define ANIM_FREEZE 102 #define ANIM_STAND 0x64 #define ANIM_SIT 0x6e #define ANIM_CROUCH 0x6f diff --git a/zone/attack.cpp b/zone/attack.cpp index 58a661969..780a8fba4 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1914,7 +1914,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //Check that we can attack before we calc heading and face our target if (!IsAttackAllowed(other)) { if (this->GetOwnerID()) - this->Say_StringID(NOT_LEGAL_TARGET); + this->SayString(NOT_LEGAL_TARGET); if (other) { if (other->IsClient()) other->CastToClient()->RemoveXTarget(this, false); diff --git a/zone/bot.cpp b/zone/bot.cpp index 4398f2fd5..cd525022a 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -2276,12 +2276,12 @@ void Bot::AI_Process() { // Berserk updates should occur if primary AI criteria are met if (GetClass() == WARRIOR || GetClass() == BERSERKER) { if (!berserk && GetHP() > 0 && GetHPRatio() < 30.0f) { - entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_START, GetName()); + entity_list.MessageCloseString(this, false, 200, 0, BERSERK_START, GetName()); berserk = true; } if (berserk && GetHPRatio() >= 30.0f) { - entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_END, GetName()); + entity_list.MessageCloseString(this, false, 200, 0, BERSERK_END, GetName()); berserk = false; } } @@ -5364,7 +5364,7 @@ bool Bot::TryFinishingBlow(Mob *defender, int &damage) if (defender->GetLevel() <= levelreq && (chance >= zone->random.Int(1, 1000))) { Log(Logs::Detail, Logs::Combat, "Landed a finishing blow: levelreq at %d, other level %d", levelreq, defender->GetLevel()); - entity_list.MessageClose_StringID(this, false, 200, Chat::MeleeCrit, FINISHING_BLOW, GetName()); + entity_list.MessageCloseString(this, false, 200, Chat::MeleeCrit, FINISHING_BLOW, GetName()); damage = fb_damage; return true; } else { @@ -5572,7 +5572,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) { if (bIsBehind || bCanFrontalBS) { int chance = (10 + (GetDEX() / 10) + (itembonuses.HeroicDEX / 10)); if(level >= 60 && other->GetLevel() <= 45 && !other->CastToNPC()->IsEngaged() && other->GetHP()<= 32000 && other->IsNPC() && zone->random.Real(0, 99) < chance) { - entity_list.MessageClose_StringID(this, false, 200, Chat::MeleeCrit, ASSASSINATES, GetName()); + entity_list.MessageCloseString(this, false, 200, Chat::MeleeCrit, ASSASSINATES, GetName()); RogueAssassinate(other); } else { RogueBackstab(other); diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index 90d694004..fc5b78ff1 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -7454,7 +7454,7 @@ void bot_subcommand_pet_get_lost(Client *c, const Seperator *sep) if (!bot_iter->GetPet() || bot_iter->GetPet()->IsCharmed()) continue; - bot_iter->GetPet()->Say_StringID(PET_GETLOST_STRING); + bot_iter->GetPet()->SayString(PET_GETLOST_STRING); bot_iter->GetPet()->Depop(false); bot_iter->SetPetID(0); database.botdb.DeletePetItems(bot_iter->GetBotID()); @@ -7500,7 +7500,7 @@ void bot_subcommand_pet_remove(Client *c, const Seperator *sep) } if (bot_iter->GetPet()) { - bot_iter->GetPet()->Say_StringID(PET_GETLOST_STRING); + bot_iter->GetPet()->SayString(PET_GETLOST_STRING); bot_iter->GetPet()->Depop(false); bot_iter->SetPetID(0); } diff --git a/zone/client.cpp b/zone/client.cpp index bf2fb3a0d..c1293be3f 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -7948,7 +7948,7 @@ void Client::MerchantRejectMessage(Mob *merchant, int primaryfaction) } // If no primary faction or biggest influence is your faction hit if (primaryfaction <= 0 || lowestvalue == tmpFactionValue) { - merchant->Say_StringID(zone->random.Int(WONT_SELL_DEEDS1, WONT_SELL_DEEDS6)); + merchant->SayString(zone->random.Int(WONT_SELL_DEEDS1, WONT_SELL_DEEDS6)); } else if (lowestvalue == fmod.race_mod) { // race biggest // Non-standard race (ex. illusioned to wolf) if (GetRace() > PLAYER_RACE_COUNT) { @@ -7967,7 +7967,7 @@ void Client::MerchantRejectMessage(Mob *merchant, int primaryfaction) messageid = WONT_SELL_NONSTDRACE1; break; } - merchant->Say_StringID(messageid); + merchant->SayString(messageid); } else { // normal player races messageid = zone->random.Int(1, 4); switch (messageid) { @@ -7987,15 +7987,15 @@ void Client::MerchantRejectMessage(Mob *merchant, int primaryfaction) messageid = WONT_SELL_RACE1; break; } - merchant->Say_StringID(messageid, itoa(GetRace())); + merchant->SayString(messageid, itoa(GetRace())); } } else if (lowestvalue == fmod.class_mod) { - merchant->Say_StringID(zone->random.Int(WONT_SELL_CLASS1, WONT_SELL_CLASS5), itoa(GetClass())); + merchant->SayString(zone->random.Int(WONT_SELL_CLASS1, WONT_SELL_CLASS5), itoa(GetClass())); } else { // Must be deity - these two sound the best for that. // Can't use a message with a field, GUI wants class/race names. // for those message IDs. These are straight text. - merchant->Say_StringID(zone->random.Int(WONT_SELL_DEEDS1, WONT_SELL_DEEDS2)); + merchant->SayString(zone->random.Int(WONT_SELL_DEEDS1, WONT_SELL_DEEDS2)); } return; } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 67c766597..e0ae5562e 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -8727,7 +8727,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) #endif // This Seems to be handled in OP_DeleteItem handling //DeleteItemInInventory(slot_id, 1, false); - //entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name); + //entity_list.MessageCloseString(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name); //Should add intoxication level to the PP at some point //CheckIncreaseSkill(ALCOHOL_TOLERANCE, nullptr, 25); } @@ -9953,11 +9953,11 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (target) { auto owner = target->GetOwner(); if (owner) - target->Say_StringID(PET_LEADERIS, owner->GetCleanName()); + target->SayString(PET_LEADERIS, owner->GetCleanName()); else - target->Say_StringID(I_FOLLOW_NOONE); + target->SayString(I_FOLLOW_NOONE); } else if (mypet) { - mypet->Say_StringID(PET_LEADERIS, GetName()); + mypet->SayString(PET_LEADERIS, GetName()); } } @@ -9996,7 +9996,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) break; //prevent pet from attacking stuff while feared if (!mypet->IsAttackAllowed(target)) { - mypet->SayTo_StringID(this, NOT_LEGAL_TARGET); + mypet->SayString(this, NOT_LEGAL_TARGET); break; } @@ -10045,7 +10045,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) } if (!mypet->IsAttackAllowed(GetTarget())) { - mypet->SayTo_StringID(this, NOT_LEGAL_TARGET); + mypet->SayString(this, NOT_LEGAL_TARGET); break; } @@ -10070,7 +10070,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; //keeps pet running while feared if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { - mypet->SayTo_StringID(this, Chat::PetResponse, PET_CALMING); + mypet->SayString(this, Chat::PetResponse, PET_CALMING); mypet->WipeHateList(); mypet->SetTarget(nullptr); if (mypet->IsPetStop()) { @@ -10101,13 +10101,13 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) SetPet(nullptr); } - mypet->SayTo_StringID(this, Chat::PetResponse, PET_GETLOST_STRING); + mypet->SayString(this, Chat::PetResponse, PET_GETLOST_STRING); mypet->CastToNPC()->Depop(); //Oddly, the client (Titanium) will still allow "/pet get lost" command despite me adding the code below. If someone can figure that out, you can uncomment this code and use it. /* if((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 2) || mypet->GetPetType() != petAnimation) { - mypet->Say_StringID(PET_GETLOST_STRING); + mypet->SayString(PET_GETLOST_STRING); mypet->CastToNPC()->Depop(); } */ @@ -10119,7 +10119,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { if (mypet->IsNPC()) { - mypet->SayTo_StringID(this, Chat::PetResponse, PET_GUARDINGLIFE); + mypet->SayString(this, Chat::PetResponse, PET_GUARDINGLIFE); mypet->SetPetOrder(SPO_Guard); mypet->CastToNPC()->SaveGuardSpot(mypet->GetPosition()); if (!mypet->GetTarget()) // want them to not twitch if they're chasing something down @@ -10136,7 +10136,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { - mypet->SayTo_StringID(this, Chat::PetResponse, PET_FOLLOWING); + mypet->SayString(this, Chat::PetResponse, PET_FOLLOWING); mypet->SetPetOrder(SPO_Follow); mypet->SendAppearancePacket(AT_Anim, ANIM_STAND); if (mypet->IsPetStop()) { @@ -10179,7 +10179,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { - mypet->SayTo_StringID(this, Chat::PetResponse, PET_GUARDME_STRING); + mypet->SayString(this, Chat::PetResponse, PET_GUARDME_STRING); mypet->SetPetOrder(SPO_Follow); mypet->SendAppearancePacket(AT_Anim, ANIM_STAND); if (mypet->IsPetStop()) { @@ -10195,13 +10195,13 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { if (mypet->GetPetOrder() == SPO_Sit) { - mypet->SayTo_StringID(this, Chat::PetResponse, PET_SIT_STRING); + mypet->SayString(this, Chat::PetResponse, PET_SIT_STRING); mypet->SetPetOrder(SPO_Follow); mypet->SendAppearancePacket(AT_Anim, ANIM_STAND); } else { - mypet->SayTo_StringID(this, Chat::PetResponse, PET_SIT_STRING); + mypet->SayString(this, Chat::PetResponse, PET_SIT_STRING); mypet->SetPetOrder(SPO_Sit); mypet->SetRunAnimSpeed(0); if (!mypet->UseBardSpellLogic()) //maybe we can have a bard pet @@ -10215,7 +10215,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { - mypet->SayTo_StringID(this, Chat::PetResponse, PET_SIT_STRING); + mypet->SayString(this, Chat::PetResponse, PET_SIT_STRING); mypet->SetPetOrder(SPO_Follow); mypet->SendAppearancePacket(AT_Anim, ANIM_STAND); } @@ -10225,7 +10225,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { - mypet->SayTo_StringID(this, Chat::PetResponse, PET_SIT_STRING); + mypet->SayString(this, Chat::PetResponse, PET_SIT_STRING); mypet->SetPetOrder(SPO_Sit); mypet->SetRunAnimSpeed(0); if (!mypet->UseBardSpellLogic()) //maybe we can have a bard pet @@ -10248,9 +10248,9 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) MessageString(Chat::PetResponse, PET_HOLD_SET_ON); if (m_ClientVersionBit & EQEmu::versions::maskUFAndLater) - mypet->SayTo_StringID(this, Chat::PetResponse, PET_NOW_HOLDING); + mypet->SayString(this, Chat::PetResponse, PET_NOW_HOLDING); else - mypet->SayTo_StringID(this, Chat::PetResponse, PET_ON_HOLD); + mypet->SayString(this, Chat::PetResponse, PET_ON_HOLD); mypet->SetHeld(true); } @@ -10265,9 +10265,9 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) MessageString(Chat::PetResponse, PET_HOLD_SET_ON); if (m_ClientVersionBit & EQEmu::versions::maskUFAndLater) - mypet->SayTo_StringID(this, Chat::PetResponse, PET_NOW_HOLDING); + mypet->SayString(this, Chat::PetResponse, PET_NOW_HOLDING); else - mypet->SayTo_StringID(this, Chat::PetResponse, PET_ON_HOLD); + mypet->SayString(this, Chat::PetResponse, PET_ON_HOLD); mypet->SetHeld(true); mypet->SetGHeld(false); SetPetCommandState(PET_BUTTON_GHOLD, 0); @@ -10294,9 +10294,9 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) { if (m_ClientVersionBit & EQEmu::versions::maskUFAndLater) { MessageString(Chat::PetResponse, PET_ON_GHOLD); - mypet->SayTo_StringID(this, Chat::PetResponse, PET_GHOLD_ON_MSG); + mypet->SayString(this, Chat::PetResponse, PET_GHOLD_ON_MSG); } else { - mypet->SayTo_StringID(this, Chat::PetResponse, PET_ON_HOLD); + mypet->SayString(this, Chat::PetResponse, PET_ON_HOLD); } mypet->SetGHeld(true); } @@ -10309,9 +10309,9 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) { if (m_ClientVersionBit & EQEmu::versions::maskUFAndLater) { MessageString(Chat::PetResponse, PET_ON_GHOLD); - mypet->SayTo_StringID(this, Chat::PetResponse, PET_GHOLD_ON_MSG); + mypet->SayString(this, Chat::PetResponse, PET_GHOLD_ON_MSG); } else { - mypet->SayTo_StringID(this, Chat::PetResponse, PET_ON_HOLD); + mypet->SayString(this, Chat::PetResponse, PET_ON_HOLD); } mypet->SetGHeld(true); mypet->SetHeld(false); @@ -10432,7 +10432,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) SetPetCommandState(PET_BUTTON_REGROUP, 0); } } - mypet->SayTo_StringID(this, Chat::PetResponse, PET_GETLOST_STRING); + mypet->SayString(this, Chat::PetResponse, PET_GETLOST_STRING); } break; } @@ -10443,7 +10443,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) mypet->SetPetStop(true); mypet->StopNavigation(); mypet->SetTarget(nullptr); - mypet->SayTo_StringID(this, Chat::PetResponse, PET_GETLOST_STRING); + mypet->SayString(this, Chat::PetResponse, PET_GETLOST_STRING); if (mypet->IsPetRegroup()) { mypet->SetPetRegroup(false); SetPetCommandState(PET_BUTTON_REGROUP, 0); @@ -10456,7 +10456,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { mypet->SetPetStop(false); - mypet->SayTo_StringID(this, Chat::PetResponse, PET_GETLOST_STRING); + mypet->SayString(this, Chat::PetResponse, PET_GETLOST_STRING); } break; } @@ -10466,11 +10466,11 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (aabonuses.PetCommands[PetCommand]) { if (mypet->IsPetRegroup()) { mypet->SetPetRegroup(false); - mypet->SayTo_StringID(this, Chat::PetResponse, PET_OFF_REGROUPING); + mypet->SayString(this, Chat::PetResponse, PET_OFF_REGROUPING); } else { mypet->SetPetRegroup(true); mypet->SetTarget(nullptr); - mypet->SayTo_StringID(this, Chat::PetResponse, PET_ON_REGROUPING); + mypet->SayString(this, Chat::PetResponse, PET_ON_REGROUPING); if (mypet->IsPetStop()) { mypet->SetPetStop(false); SetPetCommandState(PET_BUTTON_STOP, 0); @@ -10485,7 +10485,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (aabonuses.PetCommands[PetCommand]) { mypet->SetPetRegroup(true); mypet->SetTarget(nullptr); - mypet->SayTo_StringID(this, Chat::PetResponse, PET_ON_REGROUPING); + mypet->SayString(this, Chat::PetResponse, PET_ON_REGROUPING); if (mypet->IsPetStop()) { mypet->SetPetStop(false); SetPetCommandState(PET_BUTTON_STOP, 0); @@ -10498,7 +10498,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if (aabonuses.PetCommands[PetCommand]) { mypet->SetPetRegroup(false); - mypet->SayTo_StringID(this, Chat::PetResponse, PET_OFF_REGROUPING); + mypet->SayString(this, Chat::PetResponse, PET_OFF_REGROUPING); } break; } @@ -13043,7 +13043,7 @@ void Client::Handle_OP_ShopRequest(const EQApplicationPacket *app) // 1199 I don't have time for that now. etc if (!tmp->CastToNPC()->IsMerchantOpen()) { - tmp->Say_StringID(zone->random.Int(1199, 1202)); + tmp->SayString(zone->random.Int(1199, 1202)); action = 0; } diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 7e08054d8..7465ac925 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -1527,7 +1527,7 @@ void Client::OPGMTraining(const EQApplicationPacket *app) // welcome message if (pTrainer && pTrainer->IsNPC()) { - pTrainer->Say_StringID(zone->random.Int(1204, 1207), GetCleanName()); + pTrainer->SayString(zone->random.Int(1204, 1207), GetCleanName()); } } @@ -1556,7 +1556,7 @@ void Client::OPGMEndTraining(const EQApplicationPacket *app) // goodbye message if (pTrainer->IsNPC()) { - pTrainer->Say_StringID(zone->random.Int(1208, 1211), GetCleanName()); + pTrainer->SayString(zone->random.Int(1208, 1211), GetCleanName()); } } diff --git a/zone/merc.cpp b/zone/merc.cpp index c2b433d52..c48c3fb66 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -1637,11 +1637,11 @@ void Merc::AI_Process() { // TODO: Do mercs berserk? Find this out on live... //if (GetClass() == WARRIOR || GetClass() == BERSERKER) { // if(GetHP() > 0 && !berserk && this->GetHPRatio() < 30) { - // entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_START, GetName()); + // entity_list.MessageCloseString(this, false, 200, 0, BERSERK_START, GetName()); // this->berserk = true; // } // if (berserk && this->GetHPRatio() > 30) { - // entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_END, GetName()); + // entity_list.MessageCloseString(this, false, 200, 0, BERSERK_END, GetName()); // this->berserk = false; // } //} diff --git a/zone/mob.cpp b/zone/mob.cpp index f9665af32..108749f0b 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -2844,7 +2844,7 @@ void Mob::Say(const char *format, ...) // // this is like the above, but the first parameter is a string id // -void Mob::Say_StringID(uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9) +void Mob::SayString(uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9) { char string_id_str[10]; @@ -2857,7 +2857,7 @@ void Mob::Say_StringID(uint32 string_id, const char *message3, const char *messa ); } -void Mob::Say_StringID(uint32 type, uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9) +void Mob::SayString(uint32 type, uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9) { char string_id_str[10]; @@ -2870,7 +2870,7 @@ void Mob::Say_StringID(uint32 type, uint32 string_id, const char *message3, cons ); } -void Mob::SayTo_StringID(Client *to, uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9) +void Mob::SayString(Client *to, uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9) { if (!to) return; @@ -2880,7 +2880,7 @@ void Mob::SayTo_StringID(Client *to, uint32 string_id, const char *message3, con to->MessageString(Chat::NPCQuestSay, GENERIC_STRINGID_SAY, GetCleanName(), string_id_str.c_str(), message3, message4, message5, message6, message7, message8, message9); } -void Mob::SayTo_StringID(Client *to, uint32 type, uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9) +void Mob::SayString(Client *to, uint32 type, uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9) { if (!to) return; diff --git a/zone/mob.h b/zone/mob.h index 5134f1ace..1a19eb9fb 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -734,13 +734,13 @@ public: const char *message7 = nullptr, const char *message8 = nullptr, const char *message9 = nullptr) { } void Say(const char *format, ...); - void Say_StringID(uint32 string_id, const char *message3 = 0, const char *message4 = 0, const char *message5 = 0, + void SayString(uint32 string_id, const char *message3 = 0, const char *message4 = 0, const char *message5 = 0, const char *message6 = 0, const char *message7 = 0, const char *message8 = 0, const char *message9 = 0); - void Say_StringID(uint32 type, uint32 string_id, const char *message3 = 0, const char *message4 = 0, const char *message5 = 0, + void SayString(uint32 type, uint32 string_id, const char *message3 = 0, const char *message4 = 0, const char *message5 = 0, const char *message6 = 0, const char *message7 = 0, const char *message8 = 0, const char *message9 = 0); - void SayTo_StringID(Client *to, uint32 string_id, const char *message3 = 0, const char *message4 = 0, const char *message5 = 0, + void SayString(Client *to, uint32 string_id, const char *message3 = 0, const char *message4 = 0, const char *message5 = 0, const char *message6 = 0, const char *message7 = 0, const char *message8 = 0, const char *message9 = 0); - void SayTo_StringID(Client *to, uint32 type, uint32 string_id, const char *message3 = 0, const char *message4 = 0, const char *message5 = 0, + void SayString(Client *to, uint32 type, uint32 string_id, const char *message3 = 0, const char *message4 = 0, const char *message5 = 0, const char *message6 = 0, const char *message7 = 0, const char *message8 = 0, const char *message9 = 0); void Shout(const char *format, ...); void Emote(const char *format, ...); diff --git a/zone/oldcode.cpp b/zone/oldcode.cpp index 059504328..9f20f686c 100644 --- a/zone/oldcode.cpp +++ b/zone/oldcode.cpp @@ -1233,7 +1233,7 @@ Message(0, "Disc packet id=%d, %x,%x,%x", disc_in->disc_id, disc_in->unknown3[0] return; duration = 11; reuse = 60*60; - entity_list.MessageClose_StringID(this, false, 100, 0, DISCIPLINE_FEARLESS, GetName()); + entity_list.MessageCloseString(this, false, 100, 0, DISCIPLINE_FEARLESS, GetName()); //entity_list.MessageClose(this, false, 100, 0, "%s becomes fearless!", GetName()); break; } diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index cc0ea1b3b..d9666efc6 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -1953,7 +1953,7 @@ void Mob::Taunt(NPC *who, bool always_succeed, int chance_bonus, bool FromSpell, } if (who->CanTalk()) - who->Say_StringID(SUCCESSFUL_TAUNT, GetCleanName()); + who->SayString(SUCCESSFUL_TAUNT, GetCleanName()); } else { MessageString(Chat::SpellFailure, FAILED_TAUNT); } diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 895e01e90..9137898c3 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -1001,7 +1001,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i return; if (TaskSets[TaskSetID].empty()) { - mob->SayTo_StringID(c, Chat::Yellow, MAX_ACTIVE_TASKS, c->GetName()); // I think this is suppose to be yellow + mob->SayString(c, Chat::Yellow, MAX_ACTIVE_TASKS, c->GetName()); // I think this is suppose to be yellow return; } @@ -1033,7 +1033,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i if (TaskListIndex > 0) { SendTaskSelector(c, mob, TaskListIndex, TaskList); } else { - mob->SayTo_StringID(c, Chat::Yellow, MAX_ACTIVE_TASKS, c->GetName()); // check color, I think this might be only for (Shared) Tasks, w/e -- think should be yellow + mob->SayString(c, Chat::Yellow, MAX_ACTIVE_TASKS, c->GetName()); // check color, I think this might be only for (Shared) Tasks, w/e -- think should be yellow } return; @@ -1065,7 +1065,7 @@ void TaskManager::TaskQuestSetSelector(Client *c, ClientTaskState *state, Mob *m if (TaskListIndex > 0) { SendTaskSelector(c, mob, TaskListIndex, TaskList); } else { - mob->SayTo_StringID(c, Chat::Yellow, MAX_ACTIVE_TASKS, c->GetName()); // check color, I think this might be only for (Shared) Tasks, w/e -- think should be yellow + mob->SayString(c, Chat::Yellow, MAX_ACTIVE_TASKS, c->GetName()); // check color, I think this might be only for (Shared) Tasks, w/e -- think should be yellow } return; From 04a18786f99bd4522daf7a32bb9cafb1599ef401 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 11 Aug 2019 01:21:55 -0500 Subject: [PATCH 6/7] Bot compile fixes --- zone/bot.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index cd525022a..9cce41c2f 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -3838,32 +3838,32 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli } if (client != GetOwner()) { - client->Message(CC_Red, "You are not the owner of this bot - Trade Canceled."); + client->Message(Chat::Red, "You are not the owner of this bot - Trade Canceled."); client->ResetTrade(); return; } if ((beginSlotID != invslot::TRADE_BEGIN) && (beginSlotID != invslot::slotCursor)) { - client->Message(CC_Red, "Trade request processing from illegal 'begin' slot - Trade Canceled."); + client->Message(Chat::Red, "Trade request processing from illegal 'begin' slot - Trade Canceled."); client->ResetTrade(); return; } if ((endSlotID != invslot::TRADE_END) && (endSlotID != invslot::slotCursor)) { - client->Message(CC_Red, "Trade request processing from illegal 'end' slot - Trade Canceled."); + client->Message(Chat::Red, "Trade request processing from illegal 'end' slot - Trade Canceled."); client->ResetTrade(); return; } if (((beginSlotID == invslot::slotCursor) && (endSlotID != invslot::slotCursor)) || ((beginSlotID != invslot::slotCursor) && (endSlotID == invslot::slotCursor))) { - client->Message(CC_Red, "Trade request processing illegal slot range - Trade Canceled."); + client->Message(Chat::Red, "Trade request processing illegal slot range - Trade Canceled."); client->ResetTrade(); return; } if (endSlotID < beginSlotID) { - client->Message(CC_Red, "Trade request processing in reverse slot order - Trade Canceled."); + client->Message(Chat::Red, "Trade request processing in reverse slot order - Trade Canceled."); client->ResetTrade(); return; } if (client->IsEngaged() || IsEngaged()) { - client->Message(CC_Yellow, "You may not perform a trade while engaged - Trade Canceled!"); + client->Message(Chat::Yellow, "You may not perform a trade while engaged - Trade Canceled!"); client->ResetTrade(); return; } @@ -3879,23 +3879,23 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli if (!trade_instance->GetItem()) { // TODO: add logging - client->Message(CC_Red, "A server error was encountered while processing client slot %i - Trade Canceled.", trade_index); + client->Message(Chat::Red, "A server error was encountered while processing client slot %i - Trade Canceled.", trade_index); client->ResetTrade(); return; } if ((trade_index != invslot::slotCursor) && !trade_instance->IsDroppable()) { // TODO: add logging - client->Message(CC_Red, "Trade hack detected - Trade Canceled."); + client->Message(Chat::Red, "Trade hack detected - Trade Canceled."); client->ResetTrade(); return; } if (trade_instance->IsStackable() && (trade_instance->GetCharges() < trade_instance->GetItem()->StackSize)) { // temp until partial stacks are implemented - client->Message(CC_Yellow, "'%s' is only a partially stacked item - Trade Canceled!", trade_instance->GetItem()->Name); + client->Message(Chat::Yellow, "'%s' is only a partially stacked item - Trade Canceled!", trade_instance->GetItem()->Name); client->ResetTrade(); return; } if (CheckLoreConflict(trade_instance->GetItem())) { - client->Message(CC_Yellow, "This bot already has lore equipment matching the item '%s' - Trade Canceled!", trade_instance->GetItem()->Name); + client->Message(Chat::Yellow, "This bot already has lore equipment matching the item '%s' - Trade Canceled!", trade_instance->GetItem()->Name); client->ResetTrade(); return; } @@ -3925,13 +3925,13 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli if ((trade_iterator.tradeItemInstance->GetItem()->LoreGroup == -1) && (check_iterator.tradeItemInstance->GetItem()->ID == trade_iterator.tradeItemInstance->GetItem()->ID)) { // TODO: add logging - client->Message(CC_Red, "Trade hack detected - Trade Canceled."); + client->Message(Chat::Red, "Trade hack detected - Trade Canceled."); client->ResetTrade(); return; } if ((trade_iterator.tradeItemInstance->GetItem()->LoreGroup > 0) && (check_iterator.tradeItemInstance->GetItem()->LoreGroup == trade_iterator.tradeItemInstance->GetItem()->LoreGroup)) { // TODO: add logging - client->Message(CC_Red, "Trade hack detected - Trade Canceled."); + client->Message(Chat::Red, "Trade hack detected - Trade Canceled."); client->ResetTrade(); return; } @@ -4040,14 +4040,14 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli if (!return_instance->GetItem()) { // TODO: add logging - client->Message(CC_Red, "A server error was encountered while processing bot slot %i - Trade Canceled.", return_iterator.fromBotSlot); + client->Message(Chat::Red, "A server error was encountered while processing bot slot %i - Trade Canceled.", return_iterator.fromBotSlot); client->ResetTrade(); return; } // non-failing checks above are causing this to trigger (i.e., !ItemClassCommon and !IsEquipable{race, class, min_level}) // this process is hindered by not having bots use the inventory trade method (TODO: implement bot inventory use) if (client->CheckLoreConflict(return_instance->GetItem())) { - client->Message(CC_Yellow, "You already have lore equipment matching the item '%s' - Trade Canceled!", return_instance->GetItem()->Name); + client->Message(Chat::Yellow, "You already have lore equipment matching the item '%s' - Trade Canceled!", return_instance->GetItem()->Name); client->ResetTrade(); return; } @@ -4104,7 +4104,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli } if (return_iterator.toClientSlot == invslot::SLOT_INVALID) { - client->Message(CC_Yellow, "You do not have room to complete this trade - Trade Canceled!"); + client->Message(Chat::Yellow, "You do not have room to complete this trade - Trade Canceled!"); client->ResetTrade(); return; } @@ -4130,7 +4130,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli //} if (!database.botdb.DeleteItemBySlot(GetBotID(), return_iterator.fromBotSlot)) - client->Message(CC_Red, "%s (slot: %i, name: '%s')", BotDatabase::fail::DeleteItemBySlot(), return_iterator.fromBotSlot, (return_instance ? return_instance->GetItem()->Name : "nullptr")); + client->Message(Chat::Red, "%s (slot: %i, name: '%s')", BotDatabase::fail::DeleteItemBySlot(), return_iterator.fromBotSlot, (return_instance ? return_instance->GetItem()->Name : "nullptr")); BotRemoveEquipItem(return_iterator.fromBotSlot); if (return_instance) @@ -4145,7 +4145,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli // TODO: code for stackables if (!database.botdb.SaveItemBySlot(this, trade_iterator.toBotSlot, trade_iterator.tradeItemInstance)) - client->Message(CC_Red, "%s (slot: %i, name: '%s')", BotDatabase::fail::SaveItemBySlot(), trade_iterator.toBotSlot, (trade_iterator.tradeItemInstance ? trade_iterator.tradeItemInstance->GetItem()->Name : "nullptr")); + client->Message(Chat::Red, "%s (slot: %i, name: '%s')", BotDatabase::fail::SaveItemBySlot(), trade_iterator.toBotSlot, (trade_iterator.tradeItemInstance ? trade_iterator.tradeItemInstance->GetItem()->Name : "nullptr")); m_inv.PutItem(trade_iterator.toBotSlot, *trade_iterator.tradeItemInstance); this->BotAddEquipItem(trade_iterator.toBotSlot, (trade_iterator.tradeItemInstance ? trade_iterator.tradeItemInstance->GetID() : 0)); @@ -4190,9 +4190,9 @@ bool Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, EQEmu::skills::Sk Mob *my_owner = GetBotOwner(); if (my_owner && my_owner->IsClient() && my_owner->CastToClient()->GetBotOptionDeathMarquee()) { if (killerMob) - my_owner->CastToClient()->SendMarqueeMessage(CC_Yellow, 510, 0, 1000, 3000, StringFormat("%s has been slain by %s", GetCleanName(), killerMob->GetCleanName())); + my_owner->CastToClient()->SendMarqueeMessage(Chat::Yellow, 510, 0, 1000, 3000, StringFormat("%s has been slain by %s", GetCleanName(), killerMob->GetCleanName())); else - my_owner->CastToClient()->SendMarqueeMessage(CC_Yellow, 510, 0, 1000, 3000, StringFormat("%s has been slain", GetCleanName())); + my_owner->CastToClient()->SendMarqueeMessage(Chat::Yellow, 510, 0, 1000, 3000, StringFormat("%s has been slain", GetCleanName())); } Mob *give_exp = hate_list.GetDamageTopOnHateList(this); From e9cb8781bfeb30e4625a8d020d3d1a6276f128f2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 11 Aug 2019 01:32:51 -0500 Subject: [PATCH 7/7] More build fixes for bot --- zone/bot_command.cpp | 6 +++--- zone/client_packet.cpp | 2 +- zone/effects.cpp | 2 +- zone/forage.cpp | 2 +- zone/oldcode.cpp | 2 +- zone/spells.cpp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index fc5b78ff1..749553de1 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -84,7 +84,7 @@ namespace { //#define BCSTSPELLDUMP // only needed if you're adding/tailoring bot command spells and need a file dump -#define m_message Chat::WhiteSmoke +#define m_message Chat::White #define m_action Chat::Yellow #define m_note Chat::Gray #define m_usage Chat::Cyan @@ -7310,7 +7310,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) itm = itminst->GetItem(); if (itminst && itm && c->CheckLoreConflict(itm)) { - c->MessageString(Chat::WhiteSmoke, PICK_LORE); + c->MessageString(Chat::White, PICK_LORE); return; } @@ -7324,7 +7324,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) if (!c->CheckLoreConflict(itma->GetItem())) continue; - c->MessageString(Chat::WhiteSmoke, PICK_LORE); + c->MessageString(Chat::White, PICK_LORE); return; } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index e0ae5562e..38e7aaff4 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -4825,7 +4825,7 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app) Message(0, "This corpse can be resurrected for %i minutes and %i seconds.", min, sec); } else { - MessageString(Chat::WhiteSmoke, CORPSE_TOO_OLD); + MessageString(Chat::White, CORPSE_TOO_OLD); } */ } diff --git a/zone/effects.cpp b/zone/effects.cpp index f6996c030..25923b35f 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -623,7 +623,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { /*char val1[20]={0};*/ //unused /*char val2[20]={0};*/ //unused uint32 remain = p_timers.GetRemainingTime(DiscTimer); - //MessageString(Chat::WhiteSmoke, DISCIPLINE_CANUSEIN, ConvertArray((remain)/60,val1), ConvertArray(remain%60,val2)); + //MessageString(Chat::White, DISCIPLINE_CANUSEIN, ConvertArray((remain)/60,val1), ConvertArray(remain%60,val2)); Message(0, "You can use this discipline in %d minutes %d seconds.", ((remain)/60), (remain%60)); return(false); } diff --git a/zone/forage.cpp b/zone/forage.cpp index c3310a0d3..12d2f61a1 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -223,7 +223,7 @@ void Client::GoFish() //TODO: generate a message if we're already fishing /*if (!fishing_timer.Check()) { //this isn't the right check, may need to add something to the Client class like 'bool is_fishing' - MessageString(Chat::WhiteSmoke, ALREADY_FISHING); //You are already fishing! + MessageString(Chat::White, ALREADY_FISHING); //You are already fishing! return; }*/ diff --git a/zone/oldcode.cpp b/zone/oldcode.cpp index 9f20f686c..7329c73f3 100644 --- a/zone/oldcode.cpp +++ b/zone/oldcode.cpp @@ -1198,7 +1198,7 @@ Message(0, "Disc packet id=%d, %x,%x,%x", disc_in->disc_id, disc_in->unknown3[0] char val1[20]={0}; char val2[20]={0}; uint32 remain = p_timers.GetRemainingTime(pTimerDisciplineReuse); - MessageString(Chat::WhiteSmoke,DISCIPLINE_CANUSEIN,ConvertArray((remain)/60,val1),ConvertArray(remain%60,val2)); + MessageString(Chat::White,DISCIPLINE_CANUSEIN,ConvertArray((remain)/60,val1),ConvertArray(remain%60,val2)); //Message(0,"You can use a new discipline in %i minutes %i seconds.", (disc_timer.GetRemainingTime()/1000)/60, disc_timer.GetRemainingTime()/1000%60); return; } diff --git a/zone/spells.cpp b/zone/spells.cpp index e0ade3798..9392ab7af 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -4004,7 +4004,7 @@ void Corpse::CastRezz(uint16 spellid, Mob* Caster) /* if(!can_rez) { if(Caster && Caster->IsClient()) - Caster->MessageString(Chat::WhiteSmoke, CORPSE_TOO_OLD); + Caster->MessageString(Chat::White, CORPSE_TOO_OLD); return; } */