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); }