Unify chat constants usage

This commit is contained in:
Akkadius 2019-08-11 00:00:55 -05:00
parent 24d2a5723b
commit 57354579aa
50 changed files with 1352 additions and 1432 deletions

View File

@ -94,6 +94,8 @@ class PTimerList;
# define _ISNAN_(a) std::isnan(a) # define _ISNAN_(a) std::isnan(a)
#endif #endif
#define SQL(...) #__VA_ARGS__
class Database : public DBcore { class Database : public DBcore {
public: public:
Database(); Database();

View File

@ -476,7 +476,7 @@ bool Database::CheckDatabaseConversions() {
CheckDatabaseConvertCorpseDeblob(); CheckDatabaseConvertCorpseDeblob();
/* Run EQEmu Server script (Checks for database updates) */ /* 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; return true;
} }

View File

@ -87,200 +87,114 @@ typedef enum {
_eaMaxAppearance _eaMaxAppearance
} EmuAppearance; } EmuAppearance;
#define MT_NPCQuestSay 10 namespace Chat {
// msg_type's for custom usercolors const uint16 White = 0;
#define MT_Say 256 const uint16 DimGray = 1;
#define MT_Tell 257 const uint16 Default = 1;
#define MT_Group 258 const uint16 Green = 2;
#define MT_Guild 259 const uint16 BrightBlue = 3;
#define MT_OOC 260 const uint16 LightBlue = 4;
#define MT_Auction 261 const uint16 Magenta = 5;
#define MT_Shout 262 const uint16 Gray = 6;
#define MT_Emote 263 const uint16 LightGray = 7;
#define MT_Spells 264 const uint16 NPCQuestSay = 10;
#define MT_YouHitOther 265 const uint16 DarkGray = 12;
#define MT_OtherHitsYou 266 const uint16 Red = 13;
#define MT_YouMissOther 267 const uint16 Lime = 14;
#define MT_OtherMissesYou 268 const uint16 Yellow = 15;
#define MT_Broadcasts 269 const uint16 Blue = 16;
#define MT_Skills 270 const uint16 LightNavy = 17;
#define MT_Disciplines 271 const uint16 Cyan = 18;
#define MT_Unused1 272 const uint16 Black = 20;
#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
// TODO: Really should combine above and below into one /**
* User colors
//from showeq */
enum ChatColor const uint16 Say = 256;
{ const uint16 Tell = 257;
/* const uint16 Group = 258;
CC_Default = 0, const uint16 Guild = 259;
CC_DarkGrey = 1, const uint16 OOC = 260;
CC_DarkGreen = 2, const uint16 Auction = 261;
CC_DarkBlue = 3, const uint16 Shout = 262;
CC_Purple = 5, const uint16 Emote = 263;
CC_LightGrey = 6, const uint16 Spells = 264;
*/ const uint16 YouHitOther = 265;
const uint16 OtherHitYou = 266;
CC_WhiteSmoke = 0, // FF|F0F0F0 const uint16 YouMissOther = 267;
CC_Green = 2, // FF|008000 const uint16 OtherMissYou = 268;
CC_BrightBlue = 3, // FF|0040FF const uint16 Broadcasts = 269;
CC_Magenta = 5, // FF|F000F0 const uint16 Skills = 270;
CC_Gray = 6, // FF|808080 const uint16 Disciplines = 271;
CC_LightGray = 7, // FF|E0E0E0 const uint16 Unused1 = 272;
//CC_WhiteSmoke2 = 10, // FF|F0F0F0 const uint16 DefaultText = 273;
CC_DarkGray = 12, // FF|A0A0A0 const uint16 Unused2 = 274;
CC_Red = 13, // FF|F00000 const uint16 MerchantOffer = 275;
CC_Lime = 14, // FF|00F000 const uint16 MerchantExchange = 276;
CC_Yellow = 15, // FF|F0F000 const uint16 YourDeath = 277;
CC_Blue = 16, // FF|0000F0 const uint16 OtherDeath = 278;
CC_LightNavy = 17, // FF|0000AF const uint16 OtherHitOther = 279;
CC_Cyan = 18, // FF|00F0F0 const uint16 OtherMissOther = 280;
CC_Black = 20, // FF|000000 const uint16 Who = 281;
const uint16 YellForHelp = 282;
// any index <= 255 that is not defined above const uint16 NonMelee = 283;
CC_DimGray = 1, // FF|606060 const uint16 SpellWornOff = 284;
CC_Default = 1, const uint16 MoneySplit = 285;
const uint16 Loot = 286;
CC_User_Say = 256, const uint16 DiceRoll = 287;
CC_User_Tell = 257, const uint16 OtherSpells = 288;
CC_User_Group = 258, const uint16 SpellFailure = 289;
CC_User_Guild = 259, const uint16 ChatChannel = 290;
CC_User_OOC = 260, const uint16 Chat1 = 291;
CC_User_Auction = 261, const uint16 Chat2 = 292;
CC_User_Shout = 262, const uint16 Chat3 = 293;
CC_User_Emote = 263, const uint16 Chat4 = 294;
CC_User_Spells = 264, const uint16 Chat5 = 295;
CC_User_YouHitOther = 265, const uint16 Chat6 = 296;
CC_User_OtherHitYou = 266, const uint16 Chat7 = 297;
CC_User_YouMissOther = 267, const uint16 Chat8 = 298;
CC_User_OtherMissYou = 268, const uint16 Chat9 = 299;
CC_User_Duels = 269, const uint16 Chat10 = 300;
CC_User_Skills = 270, const uint16 MeleeCrit = 301;
CC_User_Disciplines = 271, const uint16 SpellCrit = 302;
CC_User_Default = 273, const uint16 TooFarAway = 303;
CC_User_MerchantOffer = 275, const uint16 NPCRampage = 304;
CC_User_MerchantExchange = 276, const uint16 NPCFlurry = 305;
CC_User_YourDeath = 277, const uint16 NPCEnrage = 306;
CC_User_OtherDeath = 278, const uint16 EchoSay = 307;
CC_User_OtherHitOther = 279, const uint16 EchoTell = 308;
CC_User_OtherMissOther = 280, const uint16 EchoGroup = 309;
CC_User_Who = 281, const uint16 EchoGuild = 310;
CC_User_Yell = 282, const uint16 EchoOOC = 311;
CC_User_NonMelee = 283, const uint16 EchoAuction = 312;
CC_User_SpellWornOff = 284, const uint16 EchoShout = 313;
CC_User_MoneySplit = 285, const uint16 EchoEmote = 314;
CC_User_Loot = 286, const uint16 EchoChat1 = 315;
CC_User_Random = 287, const uint16 EchoChat2 = 316;
CC_User_OtherSpells = 288, const uint16 EchoChat3 = 317;
CC_User_SpellFailure = 289, const uint16 EchoChat4 = 318;
CC_User_ChatChannel = 290, const uint16 EchoChat5 = 319;
CC_User_Chat1 = 291, const uint16 EchoChat6 = 320;
CC_User_Chat2 = 292, const uint16 EchoChat7 = 321;
CC_User_Chat3 = 293, const uint16 EchoChat8 = 322;
CC_User_Chat4 = 294, const uint16 EchoChat9 = 323;
CC_User_Chat5 = 295, const uint16 EchoChat10 = 324;
CC_User_Chat6 = 296, const uint16 DotDamage = 325;
CC_User_Chat7 = 297, const uint16 ItemLink = 326;
CC_User_Chat8 = 298, const uint16 RaidSay = 327;
CC_User_Chat9 = 299, const uint16 MyPet = 328;
CC_User_Chat10 = 300, const uint16 DamageShield = 329;
CC_User_MeleeCrit = 301, const uint16 LeaderShip = 330;
CC_User_SpellCrit = 302, const uint16 PetFlurry = 331;
CC_User_TooFarAway = 303, const uint16 PetCritical = 332;
CC_User_NPCRampage = 304, const uint16 FocusEffect = 333;
CC_User_NPCFurry = 305, const uint16 Experience = 334;
CC_User_NPCEnrage = 306, const uint16 System = 335;
CC_User_EchoSay = 307, const uint16 PetSpell = 336;
CC_User_EchoTell = 308, const uint16 PetResponse = 337;
CC_User_EchoGroup = 309, const uint16 ItemSpeech = 338;
CC_User_EchoGuild = 310, const uint16 StrikeThrough = 339;
CC_User_EchoOOC = 311, const uint16 Stun = 340;
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,
}; };
//ZoneChange_Struct->success values //ZoneChange_Struct->success values

View File

@ -81,14 +81,6 @@ namespace Console {
}; };
} }
enum GameChatColor {
yellow = 15,
red = 13,
light_green = 14,
light_cyan = 258,
light_purple = 5
};
/** /**
* EQEmuLogSys Constructor * EQEmuLogSys Constructor
*/ */
@ -306,22 +298,22 @@ uint16 EQEmuLogSys::GetGMSayColorFromCategory(uint16 log_category)
switch (log_category) { switch (log_category) {
case Logs::Status: case Logs::Status:
case Logs::Normal: case Logs::Normal:
return GameChatColor::yellow; return Chat::Yellow;
case Logs::MySQLError: case Logs::MySQLError:
case Logs::Error: case Logs::Error:
return GameChatColor::red; return Chat::Red;
case Logs::MySQLQuery: case Logs::MySQLQuery:
case Logs::Debug: case Logs::Debug:
return GameChatColor::light_green; return Chat::Lime;
case Logs::Quests: case Logs::Quests:
return GameChatColor::light_cyan; return Chat::Group;
case Logs::Commands: case Logs::Commands:
case Logs::Mercenaries: case Logs::Mercenaries:
return GameChatColor::light_purple; return Chat::Magenta;
case Logs::Crash: case Logs::Crash:
return GameChatColor::red; return Chat::Red;
default: default:
return GameChatColor::yellow; return Chat::Yellow;
} }
} }

View File

@ -123,6 +123,17 @@ std::vector<std::string> SplitString(const std::string &str, char delim) {
return ret; return ret;
} }
static std::string implode(char *sep, std::vector<std::string> src)
{
std::ostringstream output;
std::vector<std::string>::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 EscapeString(const std::string &s) {
std::string ret; std::string ret;

View File

@ -30,6 +30,7 @@ const std::string ucfirst(std::string s);
std::vector<std::string> split(std::string str_to_split, char delimiter); std::vector<std::string> split(std::string str_to_split, char delimiter);
const std::string StringFormat(const char* format, ...); const std::string StringFormat(const char* format, ...);
const std::string vStringFormat(const char* format, va_list args); const std::string vStringFormat(const char* format, va_list args);
static std::string implode(char *sep, std::vector<std::string> src);
std::vector<std::string> SplitString(const std::string &s, char delim); std::vector<std::string> SplitString(const std::string &s, char delim);
std::string EscapeString(const char *src, size_t sz); std::string EscapeString(const char *src, size_t sz);
std::string EscapeString(const std::string &s); std::string EscapeString(const std::string &s);

View File

@ -122,7 +122,7 @@ bool Adventure::Process()
else if(status == AS_WaitingForPrimaryEndTime) else if(status == AS_WaitingForPrimaryEndTime)
{ {
//Do partial failure: send a message to the clients that they can only get a certain amount of points. //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."); "receive a lesser reward. This adventure will end in 30 minutes and your party will be ejected from the dungeon.");
SetStatus(AS_WaitingForSecondaryEndTime); SetStatus(AS_WaitingForSecondaryEndTime);
} }

View File

@ -123,7 +123,7 @@ int main(int argc, char** argv) {
if (!std::ifstream("eqemu_config.json")) { if (!std::ifstream("eqemu_config.json")) {
CheckForServerScript(true); CheckForServerScript(true);
/* Run EQEmu Server script (Checks for database updates) */ /* Run EQEmu Server script (Checks for database updates) */
system("perl eqemu_server.pl convert_xml"); if(system("perl eqemu_server.pl convert_xml"));
} }
else { else {
/* Download EQEmu Server Maintenance Script if doesn't exist */ /* 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; std::cout << "Pulling down EQEmu Server Maintenance Script (eqemu_server.pl)..." << std::endl;
#ifdef _WIN32 #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 #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 #endif
} }
} }

View File

@ -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)) 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); 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; return;
} }
@ -1091,7 +1091,7 @@ void Client::FinishAlternateAdvancementPurchase(AA::Rank *rank, bool ignore_cost
SendAlternateAdvancementStats(); SendAlternateAdvancementStats();
if(rank->prev) { 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->title_sid).c_str(),
std::to_string(rank->prev->current_value).c_str(), std::to_string(rank->prev->current_value).c_str(),
std::to_string(cost).c_str(), std::to_string(cost).c_str(),
@ -1104,7 +1104,7 @@ void Client::FinishAlternateAdvancementPurchase(AA::Rank *rank, bool ignore_cost
} }
} }
else { 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(rank->title_sid).c_str(),
std::to_string(cost).c_str(), std::to_string(cost).c_str(),
cost == 1 ? std::to_string(AA_POINT).c_str() : std::to_string(AA_POINTS).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; uint32 aaremain_sec = aaremain % 60;
if(aaremain_hr >= 1) { 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); aaremain_hr, aaremain_min, aaremain_sec);
} }
else { 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); aaremain_min, aaremain_sec);
} }
@ -1200,7 +1200,7 @@ void Client::ActivateAlternateAdvancementAbility(int rank_id, int target_id) {
CommonBreakInvisible(); CommonBreakInvisible();
if (spells[rank->spell].sneak && (!hidden || (hidden && (Timer::GetCurrentTime() - tmHidden) < 4000))) { if (spells[rank->spell].sneak && (!hidden || (hidden && (Timer::GetCurrentTime() - tmHidden) < 4000))) {
Message_StringID(MT_SpellFailure, SNEAK_RESTRICT); Message_StringID(Chat::SpellFailure, SNEAK_RESTRICT);
return; return;
} }
// //
@ -1214,7 +1214,7 @@ void Client::ActivateAlternateAdvancementAbility(int rank_id, int target_id) {
SetAppearance(eaStanding, false); SetAppearance(eaStanding, false);
if (GetAppearance() != eaStanding) { if (GetAppearance() != eaStanding) {
Message_StringID(MT_SpellFailure, STAND_TO_CAST); Message_StringID(Chat::SpellFailure, STAND_TO_CAST);
return; return;
} }
} }

View File

@ -1319,7 +1319,7 @@ void Mob::DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts)
if (other->AvoidDamage(this, hit)) { if (other->AvoidDamage(this, hit)) {
int strike_through = itembonuses.StrikeThrough + spellbonuses.StrikeThrough + aabonuses.StrikeThrough; int strike_through = itembonuses.StrikeThrough + spellbonuses.StrikeThrough + aabonuses.StrikeThrough;
if (strike_through && zone->random.Roll(strike_through)) { if (strike_through && zone->random.Roll(strike_through)) {
Message_StringID(MT_StrikeThrough, Message_StringID(Chat::StrikeThrough,
STRIKETHROUGH_STRING); // You strike through your opponents defenses! STRIKETHROUGH_STRING); // You strike through your opponents defenses!
hit.damage_done = 1; // set to one, we will check this to continue 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_resist2 = other->spellbonuses.FrontalStunResist + other->itembonuses.FrontalStunResist + other->aabonuses.FrontalStunResist;
int stun_resist = other->spellbonuses.StunResist + other->itembonuses.StunResist + other->aabonuses.StunResist; int stun_resist = other->spellbonuses.StunResist + other->itembonuses.StunResist + other->aabonuses.StunResist;
if (zone->random.Roll(stun_resist2)) { 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)) { } else if (zone->random.Roll(stun_resist)) {
other->Message_StringID(MT_Stun, SHAKE_OFF_STUN); other->Message_StringID(Chat::Stun, SHAKE_OFF_STUN);
} else { } else {
other->Stun(3000); // yuck -- 3 seconds 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 if (DivineAura() && !GetGM()) {//cant attack while invulnerable unless your a gm
Log(Logs::Detail, Logs::Combat, "Attack canceled, Divine Aura is in effect."); 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; return false;
} }
@ -1619,7 +1619,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, EQEmu::skills::Sk
this, /* Sender */ this, /* Sender */
false, /* Skip Sender */ false, /* Skip Sender */
RuleI(Range, DamageMessages), RuleI(Range, DamageMessages),
MT_NonMelee, /* 283 */ Chat::NonMelee, /* 283 */
HIT_NON_MELEE, /* %1 hit %2 for %3 points of non-melee damage. */ HIT_NON_MELEE, /* %1 hit %2 for %3 points of non-melee damage. */
killerMob->GetCleanName(), /* Message1 */ killerMob->GetCleanName(), /* Message1 */
GetCleanName(), /* Message2 */ GetCleanName(), /* Message2 */
@ -2129,7 +2129,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, EQEmu::skills::Skill
{ {
if (IsLDoNTrapped()) 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); SpellFinished(GetLDoNTrapSpellID(), other, EQEmu::spells::CastingSlot::Item, 0, -1, spells[GetLDoNTrapSpellID()].ResistDiff, false);
SetLDoNTrapSpellID(0); SetLDoNTrapSpellID(0);
SetLDoNTrapped(false); SetLDoNTrapped(false);
@ -2173,7 +2173,7 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQEmu::skills::Skil
this, /* Sender */ this, /* Sender */
false, /* Skip Sender */ false, /* Skip Sender */
RuleI(Range, DamageMessages), RuleI(Range, DamageMessages),
MT_NonMelee, /* 283 */ Chat::NonMelee, /* 283 */
HIT_NON_MELEE, /* %1 hit %2 for %3 points of non-melee damage. */ HIT_NON_MELEE, /* %1 hit %2 for %3 points of non-melee damage. */
killer_mob->GetCleanName(), /* Message1 */ killer_mob->GetCleanName(), /* Message1 */
GetCleanName(), /* Message2 */ 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. //we used to do a message to the client, but its gone now.
// emote goes with every one ... even npcs // 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` } //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()); 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->AddToHateList(attacker, 1, 0, true, false, false, spell_id);
pet->SetTarget(attacker); 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); damage = AffectMagicalDamage(damage, spell_id, iBuffTic, attacker);
if (origdmg != damage && attacker && attacker->IsClient()) { if (origdmg != damage && attacker && attacker->IsClient()) {
if (attacker->CastToClient()->GetFilter(FilterDamageShields) != FilterHide) 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()) { 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. //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 */ this, /* Sender */
true, /* Skip Sender */ true, /* Skip Sender */
RuleI(Range, SpellMessages), RuleI(Range, SpellMessages),
MT_WornOff, /* 284 */ Chat::SpellWornOff, /* 284 */
HAS_BEEN_AWAKENED, // %1 has been awakened by %2. HAS_BEEN_AWAKENED, // %1 has been awakened by %2.
GetCleanName(), /* Message1 */ GetCleanName(), /* Message1 */
attacker->GetCleanName() /* Message2 */ attacker->GetCleanName() /* Message2 */
@ -3564,13 +3564,13 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
else { else {
// stun resist passed! // stun resist passed!
if (IsClient()) if (IsClient())
Message_StringID(MT_Stun, SHAKE_OFF_STUN); Message_StringID(Chat::Stun, SHAKE_OFF_STUN);
} }
} }
else { else {
// stun resist 2 passed! // stun resist 2 passed!
if (IsClient()) if (IsClient())
Message_StringID(MT_Stun, AVOID_STUNNING_BLOW); Message_StringID(Chat::Stun, AVOID_STUNNING_BLOW);
} }
} }
else { 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) { if (((spell_id != SPELL_UNKNOWN) || (FromDamageShield)) && damage>0) {
//special crap for spell damage, looks hackish to me //special crap for spell damage, looks hackish to me
char val1[20] = { 0 }; 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 { else {
if (damage > 0) { if (damage > 0) {
@ -3680,14 +3680,14 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
char val1[20] = { 0 }; char val1[20] = { 0 };
if (FromDamageShield) { if (FromDamageShield) {
if (attacker->CastToClient()->GetFilter(FilterDamageShields) != FilterHide) 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 { else {
entity_list.MessageClose_StringID( entity_list.MessageClose_StringID(
this, /* Sender */ this, /* Sender */
true, /* Skip Sender */ true, /* Skip Sender */
RuleI(Range, SpellMessages), RuleI(Range, SpellMessages),
MT_NonMelee, /* 283 */ Chat::NonMelee, /* 283 */
HIT_NON_MELEE, /* %1 hit %2 for %3 points of non-melee damage. */ HIT_NON_MELEE, /* %1 hit %2 for %3 points of non-melee damage. */
attacker->GetCleanName(), /* Message1 */ attacker->GetCleanName(), /* Message1 */
GetCleanName(), /* Message2 */ 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. // So we can see our dot dmg like live shows it.
if (spell_id != SPELL_UNKNOWN && damage > 0 && attacker && attacker != this && attacker->IsClient()) { 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 //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); YOUR_HIT_DOT, GetCleanName(), itoa(damage), spells[spell_id].name);
/* older clients don't have the below String ID, but it will be filtered */ /* 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 */ attacker, /* Sender */
true, /* Skip Sender */ true, /* Skip Sender */
RuleI(Range, SpellMessages), RuleI(Range, SpellMessages),
MT_DoTDamage, /* Type: 325 */ Chat::DotDamage, /* Type: 325 */
FilterDOT, /* FilterType: 19 */ FilterDOT, /* FilterType: 19 */
OTHER_HIT_DOT, /* MessageFormat: %1 has taken %2 damage from %3 by %4. */ OTHER_HIT_DOT, /* MessageFormat: %1 has taken %2 damage from %3 by %4. */
GetCleanName(), /* Message1 */ GetCleanName(), /* Message1 */
itoa(damage), /* Message2 */ itoa(damage), /* Message2 */
attacker->GetCleanName(), /* Message3 */ attacker->GetCleanName(), /* Message3 */
spells[spell_id].name /* Message4 */ spells[spell_id].name /* Message4 */
); );
} }
} //end packet sending } //end packet sending
@ -3792,42 +3792,42 @@ void Mob::HealDamage(uint32 amount, Mob *caster, uint16 spell_id)
// message to caster // message to caster
if (caster->IsClient() && caster == this) { if (caster->IsClient() && caster == this) {
if (caster->CastToClient()->ClientVersionBit() & EQEmu::versions::maskSoFAndLater) 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); HOT_HEAL_SELF, itoa(acthealed), spells[spell_id].name);
else else
FilteredMessage_StringID(caster, MT_NonMelee, FilterHealOverTime, FilteredMessage_StringID(caster, Chat::NonMelee, FilterHealOverTime,
YOU_HEALED, GetCleanName(), itoa(acthealed)); YOU_HEALED, GetCleanName(), itoa(acthealed));
} }
else if (caster->IsClient() && caster != this) { else if (caster->IsClient() && caster != this) {
if (caster->CastToClient()->ClientVersionBit() & EQEmu::versions::maskSoFAndLater) 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), HOT_HEAL_OTHER, GetCleanName(), itoa(acthealed),
spells[spell_id].name); spells[spell_id].name);
else else
caster->FilteredMessage_StringID(caster, MT_NonMelee, FilterHealOverTime, caster->FilteredMessage_StringID(caster, Chat::NonMelee, FilterHealOverTime,
YOU_HEAL, GetCleanName(), itoa(acthealed)); YOU_HEAL, GetCleanName(), itoa(acthealed));
} }
// message to target // message to target
if (IsClient() && caster != this) { if (IsClient() && caster != this) {
if (CastToClient()->ClientVersionBit() & EQEmu::versions::maskSoFAndLater) if (CastToClient()->ClientVersionBit() & EQEmu::versions::maskSoFAndLater)
FilteredMessage_StringID(this, MT_NonMelee, FilterHealOverTime, FilteredMessage_StringID(this, Chat::NonMelee, FilterHealOverTime,
HOT_HEALED_OTHER, caster->GetCleanName(), HOT_HEALED_OTHER, caster->GetCleanName(),
itoa(acthealed), spells[spell_id].name); itoa(acthealed), spells[spell_id].name);
else else
FilteredMessage_StringID(this, MT_NonMelee, FilterHealOverTime, FilteredMessage_StringID(this, Chat::NonMelee, FilterHealOverTime,
YOU_HEALED, caster->GetCleanName(), itoa(acthealed)); YOU_HEALED, caster->GetCleanName(), itoa(acthealed));
} }
} }
else { // normal heals else { // normal heals
FilteredMessage_StringID(caster, MT_NonMelee, FilterSpellDamage, FilteredMessage_StringID(caster, Chat::NonMelee, FilterSpellDamage,
YOU_HEALED, caster->GetCleanName(), itoa(acthealed)); YOU_HEALED, caster->GetCleanName(), itoa(acthealed));
if (caster != this) if (caster != this)
caster->FilteredMessage_StringID(caster, MT_NonMelee, FilterSpellDamage, caster->FilteredMessage_StringID(caster, Chat::NonMelee, FilterSpellDamage,
YOU_HEAL, GetCleanName(), itoa(acthealed)); YOU_HEAL, GetCleanName(), itoa(acthealed));
} }
} }
else { 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()) { if (IsPet()) {
Mob *own = GetOwner(); Mob *own = GetOwner();
if (own) if (own)
own->Message_StringID(13, PROC_PETTOOLOW); own->Message_StringID(Chat::Red, PROC_PETTOOLOW);
} }
else { else {
Message_StringID(13, PROC_TOOLOW); Message_StringID(Chat::Red, PROC_TOOLOW);
} }
} }
else { else {
@ -4030,10 +4030,10 @@ void Mob::TryWeaponProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *
if (IsPet()) { if (IsPet()) {
Mob *own = GetOwner(); Mob *own = GetOwner();
if (own) if (own)
own->Message_StringID(13, PROC_PETTOOLOW); own->Message_StringID(Chat::Red, PROC_PETTOOLOW);
} }
else { else {
Message_StringID(13, PROC_TOOLOW); Message_StringID(Chat::Red, PROC_TOOLOW);
} }
} }
else { else {
@ -4187,7 +4187,7 @@ void Mob::TryPetCriticalHit(Mob *defender, DamageHitInfo &hit)
this, /* Sender */ this, /* Sender */
false, /* Skip Sender */ false, /* Skip Sender */
RuleI(Range, CriticalDamage), RuleI(Range, CriticalDamage),
MT_CritMelee, /* Type: 301 */ Chat::MeleeCrit, /* Type: 301 */
FilterMeleeCrits, /* FilterType: 12 */ FilterMeleeCrits, /* FilterType: 12 */
CRITICAL_HIT, /* MessageFormat: %1 scores a critical hit! (%2) */ CRITICAL_HIT, /* MessageFormat: %1 scores a critical hit! (%2) */
GetCleanName(), /* Message1 */ GetCleanName(), /* Message1 */
@ -4247,7 +4247,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
this, /* Sender */ this, /* Sender */
false, /* Skip Sender */ false, /* Skip Sender */
RuleI(Range, CriticalDamage), RuleI(Range, CriticalDamage),
MT_CritMelee, /* Type: 301 */ Chat::MeleeCrit, /* Type: 301 */
FilterMeleeCrits, /* FilterType: 12 */ FilterMeleeCrits, /* FilterType: 12 */
FEMALE_SLAYUNDEAD, /* MessageFormat: %1's holy blade cleanses her target!(%2) */ FEMALE_SLAYUNDEAD, /* MessageFormat: %1's holy blade cleanses her target!(%2) */
GetCleanName(), /* Message1 */ GetCleanName(), /* Message1 */
@ -4260,7 +4260,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
this, /* Sender */ this, /* Sender */
false, /* Skip Sender */ false, /* Skip Sender */
RuleI(Range, CriticalDamage), RuleI(Range, CriticalDamage),
MT_CritMelee, /* Type: 301 */ Chat::MeleeCrit, /* Type: 301 */
FilterMeleeCrits, /* FilterType: 12 */ FilterMeleeCrits, /* FilterType: 12 */
MALE_SLAYUNDEAD, /* MessageFormat: %1's holy blade cleanses his target!(%2) */ MALE_SLAYUNDEAD, /* MessageFormat: %1's holy blade cleanses his target!(%2) */
GetCleanName(), /* Message1 */ GetCleanName(), /* Message1 */
@ -4344,7 +4344,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
this, /* Sender */ this, /* Sender */
false, /* Skip Sender */ false, /* Skip Sender */
RuleI(Range, CriticalDamage), RuleI(Range, CriticalDamage),
MT_CritMelee, /* Type: 301 */ Chat::MeleeCrit, /* Type: 301 */
FilterMeleeCrits, /* FilterType: 12 */ FilterMeleeCrits, /* FilterType: 12 */
DEADLY_STRIKE, /* MessageFormat: %1 scores a Deadly Strike!(%2) */ DEADLY_STRIKE, /* MessageFormat: %1 scores a Deadly Strike!(%2) */
GetCleanName(), /* Message1 */ GetCleanName(), /* Message1 */
@ -4372,7 +4372,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
this, /* Sender */ this, /* Sender */
false, /* Skip Sender */ false, /* Skip Sender */
RuleI(Range, CriticalDamage), RuleI(Range, CriticalDamage),
MT_CritMelee, /* Type: 301 */ Chat::MeleeCrit, /* Type: 301 */
FilterMeleeCrits, /* FilterType: 12 */ FilterMeleeCrits, /* FilterType: 12 */
CRIPPLING_BLOW, /* MessageFormat: %1 lands a Crippling Blow!(%2) */ CRIPPLING_BLOW, /* MessageFormat: %1 lands a Crippling Blow!(%2) */
GetCleanName(), /* Message1 */ GetCleanName(), /* Message1 */
@ -4394,7 +4394,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
this, /* Sender */ this, /* Sender */
false, /* Skip Sender */ false, /* Skip Sender */
RuleI(Range, CriticalDamage), RuleI(Range, CriticalDamage),
MT_CritMelee, /* Type: 301 */ Chat::MeleeCrit, /* Type: 301 */
FilterMeleeCrits, /* FilterType: 12 */ FilterMeleeCrits, /* FilterType: 12 */
CRITICAL_HIT, /* MessageFormat: %1 scores a critical hit! (%2) */ CRITICAL_HIT, /* MessageFormat: %1 scores a critical hit! (%2) */
GetCleanName(), /* Message1 */ GetCleanName(), /* Message1 */
@ -4431,7 +4431,7 @@ bool Mob::TryFinishingBlow(Mob *defender, int &damage)
this, /* Sender */ this, /* Sender */
false, /* Skip Sender */ false, /* Skip Sender */
RuleI(Range, CriticalDamage), RuleI(Range, CriticalDamage),
MT_CritMelee, /* Type: 301 */ Chat::MeleeCrit, /* Type: 301 */
FilterMeleeCrits, /* FilterType: 12 */ FilterMeleeCrits, /* FilterType: 12 */
FINISHING_BLOW, /* MessageFormat: %1 scores a Finishing Blow!!) */ FINISHING_BLOW, /* MessageFormat: %1 scores a Finishing Blow!!) */
GetCleanName() /* Message1 */ 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 // so ahhh the angle you can riposte is larger than the angle you can hit :P
if (!defender->IsFacingMob(this)) { if (!defender->IsFacingMob(this)) {
defender->Message_StringID(MT_TooFarAway, CANT_SEE_TARGET); defender->Message_StringID(Chat::TooFarAway, CANT_SEE_TARGET);
return; return;
} }
@ -5042,7 +5042,7 @@ void Mob::CommonOutgoingHitSuccess(Mob* defender, DamageHitInfo &hit, ExtraAttac
else if (GetClass() == RANGER && GetLevel() > 50) { // no double dmg on headshot else if (GetClass() == RANGER && GetLevel() > 50) { // no double dmg on headshot
if ((defender->IsNPC() && !defender->IsMoving() && !defender->IsRooted()) || !RuleB(Combat, ArcheryBonusRequiresStationary)) { if ((defender->IsNPC() && !defender->IsMoving() && !defender->IsRooted()) || !RuleB(Combat, ArcheryBonusRequiresStationary)) {
hit.damage_done *= 2; 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); Attack(target, hand, false, false, IsFromSpell);
if (zone->random.Roll(flurrychance)) if (zone->random.Roll(flurrychance))
Attack(target, hand, false, false, IsFromSpell); Attack(target, hand, false, false, IsFromSpell);
Message_StringID(MT_NPCFlurry, YOU_FLURRY); Message_StringID(Chat::NPCFlurry, YOU_FLURRY);
} }
} }
} }

View File

@ -710,13 +710,13 @@ void Mob::MakeAura(uint16 spell_id)
AuraRecord record; AuraRecord record;
if (!database.GetAuraEntry(spell_id, 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); Log(Logs::General, Logs::Error, "Unable to find data for aura %d, check auras table.", spell_id);
return; return;
} }
if (!IsValidSpell(record.spell_id)) { 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.", Log(Logs::General, Logs::Error, "Casted spell (%d) is not valid for aura %d, check auras table.",
record.spell_id, spell_id); record.spell_id, spell_id);
return; return;
@ -744,7 +744,7 @@ void Mob::MakeAura(uint16 spell_id)
const auto base = database.LoadNPCTypesData(record.npc_type); const auto base = database.LoadNPCTypesData(record.npc_type);
if (base == nullptr) { 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, Log(Logs::General, Logs::Error,
"Unable to load NPC data for aura %s (NPC ID %d), check auras and npc_types tables.", "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); spells[spell_id].teleport_zone, record.npc_type);
@ -841,10 +841,10 @@ void Mob::AddTrap(Aura *aura, AuraRecord &record)
bool Mob::CanSpawnAura(bool trap) bool Mob::CanSpawnAura(bool trap)
{ {
if (trap && !HasFreeTrapSlots()) { if (trap && !HasFreeTrapSlots()) {
Message_StringID(MT_SpellFailure, NO_MORE_TRAPS); Message_StringID(Chat::SpellFailure, NO_MORE_TRAPS);
return false; return false;
} else if (!trap && !HasFreeAuraSlots()) { } else if (!trap && !HasFreeAuraSlots()) {
Message_StringID(MT_SpellFailure, NO_MORE_AURAS); Message_StringID(Chat::SpellFailure, NO_MORE_AURAS);
return false; return false;
} }
@ -878,8 +878,6 @@ void Mob::RemoveAllAuras()
} }
trap_mgr.count = 0; trap_mgr.count = 0;
return;
} }
void Mob::RemoveAura(int spawn_id, bool skip_strip, bool expired) 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); aura.aura->Depop(skip_strip);
if (expired && IsClient()) { if (expired && IsClient()) {
CastToClient()->SendColoredText( 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 // need to update client UI too
auto app = new EQApplicationPacket(OP_UpdateAura, sizeof(AuraDestory_Struct)); auto app = new EQApplicationPacket(OP_UpdateAura, sizeof(AuraDestory_Struct));
auto ads = (AuraDestory_Struct *)app->pBuffer; 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); aura.aura->Depop(skip_strip);
if (expired && IsClient()) if (expired && IsClient())
CastToClient()->SendColoredText( 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) { while (trap_mgr.count - 1 > i) {
i++; i++;
aura.spawn_id = trap_mgr.auras[i].spawn_id; aura.spawn_id = trap_mgr.auras[i].spawn_id;

View File

@ -159,9 +159,9 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to
bool stance_flag = false; bool stance_flag = false;
if (!database.botdb.LoadStance(this, stance_flag) && bot_owner) 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) 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)); SetTaunting((GetClass() == WARRIOR || GetClass() == PALADIN || GetClass() == SHADOWKNIGHT) && (GetBotStance() == EQEmu::constants::stanceAggressive));
SetPauseAI(false); SetPauseAI(false);
@ -178,17 +178,17 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to
memset(&_botInspectMessage, 0, sizeof(InspectMessage_Struct)); memset(&_botInspectMessage, 0, sizeof(InspectMessage_Struct));
if (!database.botdb.LoadInspectMessage(GetBotID(), _botInspectMessage) && bot_owner) 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) 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; std::string error_message;
EquipBot(&error_message); EquipBot(&error_message);
if(!error_message.empty()) { if(!error_message.empty()) {
if(bot_owner) if(bot_owner)
bot_owner->Message(13, error_message.c_str()); bot_owner->Message(Chat::Red, error_message.c_str());
error_message.clear(); error_message.clear();
} }
@ -206,12 +206,12 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to
GenerateBaseStats(); GenerateBaseStats();
if (!database.botdb.LoadTimers(this) && bot_owner) 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(); LoadAAs();
if (!database.botdb.LoadBuffs(this) && bot_owner) 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); CalcBotStats(false);
hp_regen = CalcHPRegen(); hp_regen = CalcHPRegen();
@ -1701,28 +1701,28 @@ bool Bot::Save()
if(!GetBotID()) { // New bot record if(!GetBotID()) { // New bot record
uint32 bot_id = 0; uint32 bot_id = 0;
if (!database.botdb.SaveNewBot(this, bot_id) || !bot_id) { 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; return false;
} }
SetBotID(bot_id); SetBotID(bot_id);
} }
else { // Update existing bot record else { // Update existing bot record
if (!database.botdb.SaveBot(this)) { 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; return false;
} }
} }
// All of these continue to process if any fail // All of these continue to process if any fail
if (!database.botdb.SaveBuffs(this)) 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)) 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)) 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()) 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; return true;
} }
@ -1734,26 +1734,26 @@ bool Bot::DeleteBot()
return false; return false;
if (!database.botdb.DeleteHealRotation(GetBotID())) { if (!database.botdb.DeleteHealRotation(GetBotID())) {
bot_owner->Message(13, "%s", BotDatabase::fail::DeleteHealRotation()); bot_owner->Message(Chat::Red, "%s", BotDatabase::fail::DeleteHealRotation());
return false; return false;
} }
std::string query = StringFormat("DELETE FROM `bot_heal_rotation_members` WHERE `bot_id` = '%u'", GetBotID()); std::string query = StringFormat("DELETE FROM `bot_heal_rotation_members` WHERE `bot_id` = '%u'", GetBotID());
auto results = database.QueryDatabase(query); auto results = database.QueryDatabase(query);
if (!results.Success()) { 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; return false;
} }
query = StringFormat("DELETE FROM `bot_heal_rotation_targets` WHERE `target_name` LIKE '%s'", GetCleanName()); query = StringFormat("DELETE FROM `bot_heal_rotation_targets` WHERE `target_name` LIKE '%s'", GetCleanName());
results = database.QueryDatabase(query); results = database.QueryDatabase(query);
if (!results.Success()) { 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; return false;
} }
if (!DeletePet()) { 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; return false;
} }
@ -1763,32 +1763,32 @@ bool Bot::DeleteBot()
std::string error_message; std::string error_message;
if (!database.botdb.RemoveMemberFromBotGroup(GetBotID())) { 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; return false;
} }
if (!database.botdb.DeleteItems(GetBotID())) { 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; return false;
} }
if (!database.botdb.DeleteTimers(GetBotID())) { 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; return false;
} }
if (!database.botdb.DeleteBuffs(GetBotID())) { 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; return false;
} }
if (!database.botdb.DeleteStance(GetBotID())) { 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; return false;
} }
if (!database.botdb.DeleteBot(GetBotID())) { 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; return false;
} }
@ -1832,7 +1832,7 @@ bool Bot::LoadPet()
uint32 pet_index = 0; uint32 pet_index = 0;
if (!database.botdb.LoadPetIndex(GetBotID(), pet_index)) { 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; return false;
} }
if (!pet_index) if (!pet_index)
@ -1840,10 +1840,10 @@ bool Bot::LoadPet()
uint32 saved_pet_spell_id = 0; uint32 saved_pet_spell_id = 0;
if (!database.botdb.LoadPetSpellID(GetBotID(), saved_pet_spell_id)) { 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)) { 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(); DeletePet();
return false; return false;
} }
@ -1854,7 +1854,7 @@ bool Bot::LoadPet()
uint32 pet_spell_id = 0; uint32 pet_spell_id = 0;
if (!database.botdb.LoadPetStats(GetBotID(), pet_name, pet_mana, pet_hp, pet_spell_id)) { 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; return false;
} }
@ -1869,12 +1869,12 @@ bool Bot::LoadPet()
SpellBuff_Struct pet_buffs[PET_BUFF_COUNT]; SpellBuff_Struct pet_buffs[PET_BUFF_COUNT];
memset(pet_buffs, 0, (sizeof(SpellBuff_Struct) * PET_BUFF_COUNT)); memset(pet_buffs, 0, (sizeof(SpellBuff_Struct) * PET_BUFF_COUNT));
if (!database.botdb.LoadPetBuffs(GetBotID(), pet_buffs)) 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]; uint32 pet_items[EQEmu::invslot::EQUIPMENT_COUNT];
memset(pet_items, 0, (sizeof(uint32) * EQEmu::invslot::EQUIPMENT_COUNT)); memset(pet_items, 0, (sizeof(uint32) * EQEmu::invslot::EQUIPMENT_COUNT));
if (!database.botdb.LoadPetItems(GetBotID(), pet_items)) 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->SetPetState(pet_buffs, pet_items);
pet_inst->CalcBonuses(); pet_inst->CalcBonuses();
@ -1913,14 +1913,14 @@ bool Bot::SavePet()
std::string error_message; std::string error_message;
if (!database.botdb.SavePetStats(GetBotID(), pet_name_str, pet_inst->GetMana(), pet_inst->GetHP(), pet_inst->GetPetSpellID())) { 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; return false;
} }
if (!database.botdb.SavePetBuffs(GetBotID(), pet_buffs)) 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)) 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; return true;
} }
@ -1934,15 +1934,15 @@ bool Bot::DeletePet()
std::string error_message; std::string error_message;
if (!database.botdb.DeletePetItems(GetBotID())) { 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; return false;
} }
if (!database.botdb.DeletePetBuffs(GetBotID())) { 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; return false;
} }
if (!database.botdb.DeletePetStats(GetBotID())) { 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; return false;
} }
@ -2808,7 +2808,7 @@ void Bot::AI_Process() {
int32 flurrychance = (aabonuses.FlurryChance + spellbonuses.FlurryChance + itembonuses.FlurryChance); int32 flurrychance = (aabonuses.FlurryChance + spellbonuses.FlurryChance + itembonuses.FlurryChance);
if (flurrychance) { if (flurrychance) {
if (zone->random.Int(0, 100) < 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); Attack(tar, EQEmu::invslot::slotPrimary, false);
TEST_TARGET(); TEST_TARGET();
@ -3258,7 +3258,7 @@ bool Bot::Spawn(Client* botCharacterOwner) {
if(this->Save()) if(this->Save())
this->GetBotOwner()->CastToClient()->Message(0, "%s saved.", this->GetCleanName()); this->GetBotOwner()->CastToClient()->Message(0, "%s saved.", this->GetCleanName());
else 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 // Spawn the bot at the bow owner's loc
this->m_Position.x = botCharacterOwner->GetX(); this->m_Position.x = botCharacterOwner->GetX();
@ -3331,7 +3331,7 @@ uint32 Bot::GetBotItemBySlot(uint32 slotID)
if (!database.botdb.LoadItemBySlot(GetBotID(), slotID, item_id)) { if (!database.botdb.LoadItemBySlot(GetBotID(), slotID, item_id)) {
if (GetBotOwner() && GetBotOwner()->IsClient()) if (GetBotOwner() && GetBotOwner()->IsClient())
GetBotOwner()->CastToClient()->Message(13, "%s", BotDatabase::fail::LoadItemBySlot()); GetBotOwner()->CastToClient()->Message(Chat::Red, "%s", BotDatabase::fail::LoadItemBySlot());
} }
return item_id; return item_id;
@ -3434,7 +3434,7 @@ void Bot::LoadAndSpawnAllZonedBots(Client* botOwner) {
std::list<uint32> ActiveBots; std::list<uint32> ActiveBots;
// Modified LoadGroupedBotsByGroupID to require a CharacterID // Modified LoadGroupedBotsByGroupID to require a CharacterID
if (!database.botdb.LoadGroupedBotsByGroupID(botOwner->CharacterID(), TempGroupId, ActiveBots)) { if (!database.botdb.LoadGroupedBotsByGroupID(botOwner->CharacterID(), TempGroupId, ActiveBots)) {
botOwner->Message(13, "%s", BotDatabase::fail::LoadGroupedBotsByGroupID()); botOwner->Message(Chat::Red, "%s", BotDatabase::fail::LoadGroupedBotsByGroupID());
return; return;
} }
@ -4165,17 +4165,17 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
// trade messages // trade messages
for (const auto& return_iterator : client_return) { for (const auto& return_iterator : client_return) {
if (return_iterator.failedItemName.size()) 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) { for (const auto& trade_iterator : client_trade) {
if (trade_iterator.acceptedItemName.size()) 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 accepted_count = client_trade.size();
size_t returned_count = client_return.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) if (accepted_count)
CalcBotStats(client->GetBotOptionStatsUpdate()); 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); int healed = GetActSpellHealing(spell_id, damage);
Log(Logs::Detail, Logs::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName()); Log(Logs::Detail, Logs::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName());
HealDamage(healed); 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); 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))) { 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", Log(Logs::Detail, Logs::Combat, "Landed a finishing blow: levelreq at %d, other level %d",
levelreq, defender->GetLevel()); 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; damage = fb_damage;
return true; return true;
} else { } else {
@ -5572,7 +5572,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
if (bIsBehind || bCanFrontalBS) { if (bIsBehind || bCanFrontalBS) {
int chance = (10 + (GetDEX() / 10) + (itembonuses.HeroicDEX / 10)); 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) { 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); RogueAssassinate(other);
} else { } else {
RogueBackstab(other); RogueBackstab(other);
@ -5940,12 +5940,12 @@ void Bot::ProcessGuildInvite(Client* guildOfficer, Bot* botToGuild) {
if(guildOfficer && botToGuild) { if(guildOfficer && botToGuild) {
if(!botToGuild->IsInAGuild()) { if(!botToGuild->IsInAGuild()) {
if (!guild_mgr.CheckPermission(guildOfficer->GuildID(), guildOfficer->GuildRank(), GUILD_INVITE)) { 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; return;
} }
if (!database.botdb.SaveGuildMembership(botToGuild->GetBotID(), guildOfficer->GuildID(), GUILD_MEMBER)) { 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; return;
} }
@ -5958,7 +5958,7 @@ void Bot::ProcessGuildInvite(Client* guildOfficer, Bot* botToGuild) {
safe_delete(pack); safe_delete(pack);
} else { } else {
guildOfficer->Message(13, "Bot is in a guild."); guildOfficer->Message(Chat::Red, "Bot is in a guild.");
return; return;
} }
} }
@ -5974,10 +5974,10 @@ bool Bot::ProcessGuildRemoval(Client* guildOfficer, std::string botName) {
} else { } else {
uint32 ownerId = 0; uint32 ownerId = 0;
if (!database.botdb.LoadOwnerID(botName, ownerId)) 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; uint32 botId = 0;
if (!database.botdb.LoadBotID(ownerId, botName, botId)) 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)) if (botId && database.botdb.SaveGuildMembership(botId, 0, 0))
Result = true; 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) if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5)
value += (GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value) * ratio / 100); 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; return value;
} }
@ -6179,7 +6179,7 @@ int32 Bot::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
value += (value * target->GetHealRate(spell_id, this) / 100); value += (value * target->GetHealRate(spell_id, this) / 100);
if (Critical) 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; return value;
} else { } 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))) { 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() ); 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)) if(IsSilenced() && !IsDiscipline(spell_id))
Message_StringID(13, SILENCED_STRING); Message_StringID(Chat::Red, SILENCED_STRING);
if(IsAmnesiad() && IsDiscipline(spell_id)) if(IsAmnesiad() && IsDiscipline(spell_id))
Message_StringID(13, MELEE_SILENCE); Message_StringID(Chat::Red, MELEE_SILENCE);
if(casting_spell_id) if(casting_spell_id)
AI_Event_SpellCastFinished(false, static_cast<uint16>(casting_spell_slot)); AI_Event_SpellCastFinished(false, static_cast<uint16>(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()){ if(IsDetrimentalSpell(spell_id) && !zone->CanDoCombat()){
Message_StringID(13, SPELL_WOULDNT_HOLD); Message_StringID(Chat::Red, SPELL_WOULDNT_HOLD);
if(casting_spell_id) if(casting_spell_id)
AI_Event_SpellCastFinished(false, static_cast<uint16>(casting_spell_slot)); AI_Event_SpellCastFinished(false, static_cast<uint16>(casting_spell_slot));
@ -8155,13 +8155,13 @@ void Bot::CalcBotStats(bool showtext) {
return; return;
if(showtext) { if(showtext) {
GetBotOwner()->Message(15, "Updating %s...", GetCleanName()); GetBotOwner()->Message(Chat::Yellow, "Updating %s...", GetCleanName());
} }
if(!IsValidRaceClassCombo()) { if(!IsValidRaceClassCombo()) {
GetBotOwner()->Message(15, "A %s - %s bot was detected. Is this Race/Class combination allowed?.", GetRaceIDName(GetRace()), GetClassIDName(GetClass(), GetLevel())); GetBotOwner()->Message(Chat::Yellow, "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(Chat::Yellow, "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, "Unless you are experiencing heavy lag, you should delete and remake this bot.");
} }
if(GetBotOwner()->GetLevel() != GetLevel()) if(GetBotOwner()->GetLevel() != GetLevel())
@ -8170,37 +8170,37 @@ void Bot::CalcBotStats(bool showtext) {
GenerateSpecialAttacks(); GenerateSpecialAttacks();
if(showtext) { if(showtext) {
GetBotOwner()->Message(15, "Base stats:"); GetBotOwner()->Message(Chat::Yellow, "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(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(15, "Resists-- Magic: %i, Poison: %i, Fire: %i, Cold: %i, Disease: %i, Corruption: %i.",MR,PR,FR,CR,DR,Corrup); 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 // Test Code
if(GetClass() == BARD) 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)); GetSkill(EQEmu::skills::SkillBrassInstruments), GetSkill(EQEmu::skills::SkillPercussionInstruments), GetSkill(EQEmu::skills::SkillSinging), GetSkill(EQEmu::skills::SkillStringedInstruments), GetSkill(EQEmu::skills::SkillWindInstruments));
} }
//if(this->Save()) //if(this->Save())
// this->GetBotOwner()->CastToClient()->Message(0, "%s saved.", this->GetCleanName()); // this->GetBotOwner()->CastToClient()->Message(0, "%s saved.", this->GetCleanName());
//else //else
// this->GetBotOwner()->CastToClient()->Message(13, "%s save failed!", this->GetCleanName()); // this->GetBotOwner()->CastToClient()->Message(Chat::Red, "%s save failed!", this->GetCleanName());
CalcBonuses(); CalcBonuses();
AI_AddNPCSpells(this->GetBotSpellID()); AI_AddNPCSpells(this->GetBotSpellID());
if(showtext) { if(showtext) {
GetBotOwner()->Message(15, "%s has been updated.", GetCleanName()); GetBotOwner()->Message(Chat::Yellow, "%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(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(15, "Resists-- Magic: %i, Poison: %i, Fire: %i, Cold: %i, Disease: %i, Corruption: %i.",GetMR(),GetPR(),GetFR(),GetCR(),GetDR(),GetCorrup()); 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 // Test Code
if(GetClass() == BARD) { 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::SkillBrassInstruments) + GetBrassMod(),
GetSkill(EQEmu::skills::SkillPercussionInstruments) + GetPercMod(), GetSkill(EQEmu::skills::SkillPercussionInstruments) + GetPercMod(),
GetSkill(EQEmu::skills::SkillSinging) + GetSingMod(), GetSkill(EQEmu::skills::SkillSinging) + GetSingMod(),
GetSkill(EQEmu::skills::SkillStringedInstruments) + GetStringMod(), GetSkill(EQEmu::skills::SkillStringedInstruments) + GetStringMod(),
GetSkill(EQEmu::skills::SkillWindInstruments) + GetWindMod()); 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 (!database.botdb.SaveEquipmentColor(GetBotID(), save_slot, rgb)) {
if (GetBotOwner() && GetBotOwner()->IsClient()) if (GetBotOwner() && GetBotOwner()->IsClient())
GetBotOwner()->CastToClient()->Message(13, "%s", BotDatabase::fail::SaveEquipmentColor()); GetBotOwner()->CastToClient()->Message(Chat::Red, "%s", BotDatabase::fail::SaveEquipmentColor());
return false; return false;
} }
} }

View File

@ -84,12 +84,12 @@ namespace
{ {
//#define BCSTSPELLDUMP // only needed if you're adding/tailoring bot command spells and need a file dump //#define BCSTSPELLDUMP // only needed if you're adding/tailoring bot command spells and need a file dump
#define m_message CC_WhiteSmoke #define m_message Chat::WhiteSmoke
#define m_action CC_Yellow #define m_action Chat::Yellow
#define m_note CC_Gray #define m_note Chat::Gray
#define m_usage CC_Cyan #define m_usage Chat::Cyan
#define m_fail CC_Red #define m_fail Chat::Red
#define m_unknown CC_Magenta #define m_unknown Chat::Magenta
#define HP_RATIO_DELTA 5.0f #define HP_RATIO_DELTA 5.0f
@ -4833,7 +4833,7 @@ void bot_subcommand_bot_inspect_message(Client *c, const Seperator *sep)
set_flag = true; set_flag = true;
} }
else if (strcasecmp(sep->arg[1], "clear")) { 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; return;
} }
@ -7284,7 +7284,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
int ab_mask = (ActionableBots::ABM_Target | ActionableBots::ABM_ByName); int ab_mask = (ActionableBots::ABM_Target | ActionableBots::ABM_ByName);
if (c->GetTradeskillObject() || (c->trade->state == Trading)) { if (c->GetTradeskillObject() || (c->trade->state == Trading)) {
c->Message_StringID(MT_Tell, MERCHANT_BUSY); c->Message_StringID(Chat::Tell, MERCHANT_BUSY);
return; return;
} }
@ -7310,7 +7310,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
itm = itminst->GetItem(); itm = itminst->GetItem();
if (itminst && itm && c->CheckLoreConflict(itm)) { if (itminst && itm && c->CheckLoreConflict(itm)) {
c->Message_StringID(0, PICK_LORE); c->Message_StringID(Chat::WhiteSmoke, PICK_LORE);
return; return;
} }
@ -7324,7 +7324,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
if (!c->CheckLoreConflict(itma->GetItem())) if (!c->CheckLoreConflict(itma->GetItem()))
continue; continue;
c->Message_StringID(0, PICK_LORE); c->Message_StringID(Chat::WhiteSmoke, PICK_LORE);
return; return;
} }

View File

@ -914,7 +914,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
{ {
case ChatChannel_Guild: { /* Guild Chat */ case ChatChannel_Guild: { /* Guild Chat */
if (!IsInAGuild()) 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)) else if (!guild_mgr.CheckPermission(GuildID(), GuildRank(), GUILD_SPEAK))
Message(0, "Error: You dont have permission to speak to the guild."); 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)) 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)) { if(parse->PlayerHasQuestSub(EVENT_COMMAND)) {
int i = parse->EventPlayer(EVENT_COMMAND, this, message, 0); int i = parse->EventPlayer(EVENT_COMMAND, this, message, 0);
if(i == 0 && !RuleB(Chat, SuppressCommandErrors)) { if(i == 0 && !RuleB(Chat, SuppressCommandErrors)) {
Message(13, "Command '%s' not recognized.", message); Message(Chat::Red, "Command '%s' not recognized.", message);
} }
} else { } else {
if(!RuleB(Chat, SuppressCommandErrors)) if(!RuleB(Chat, SuppressCommandErrors))
Message(13, "Command '%s' not recognized.", message); Message(Chat::Red, "Command '%s' not recognized.", message);
} }
} }
break; break;
@ -1116,12 +1116,12 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
if (parse->PlayerHasQuestSub(EVENT_COMMAND)) { if (parse->PlayerHasQuestSub(EVENT_COMMAND)) {
int i = parse->EventPlayer(EVENT_COMMAND, this, message, 0); int i = parse->EventPlayer(EVENT_COMMAND, this, message, 0);
if (i == 0 && !RuleB(Chat, SuppressCommandErrors)) { if (i == 0 && !RuleB(Chat, SuppressCommandErrors)) {
Message(13, "Bot command '%s' not recognized.", message); Message(Chat::Red, "Bot command '%s' not recognized.", message);
} }
} }
else { else {
if (!RuleB(Chat, SuppressCommandErrors)) if (!RuleB(Chat, SuppressCommandErrors))
Message(13, "Bot command '%s' not recognized.", message); Message(Chat::Red, "Bot command '%s' not recognized.", message);
} }
} }
break; 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, ...) { void Client::Message(uint32 type, const char* message, ...) {
if (GetFilter(FilterSpellDamage) == FilterHide && type == MT_NonMelee) if (GetFilter(FilterSpellDamage) == FilterHide && type == Chat::NonMelee)
return; return;
if (GetFilter(FilterMeleeCrits) == FilterHide && type == MT_CritMelee) //98 is self... if (GetFilter(FilterMeleeCrits) == FilterHide && type == Chat::MeleeCrit) //98 is self...
return; return;
if (GetFilter(FilterSpellCrits) == FilterHide && type == MT_SpellCrits) if (GetFilter(FilterSpellCrits) == FilterHide && type == Chat::SpellCrit)
return; return;
va_list argptr; va_list argptr;
@ -1509,7 +1509,7 @@ void Client::IncreaseLanguageSkill(int skill_id, int value) {
QueuePacket(outapp); QueuePacket(outapp);
safe_delete(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) { 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) { void Client::SetGM(bool toggle) {
m_pp.gm = toggle ? 1 : 0; m_pp.gm = toggle ? 1 : 0;
m_inv.SetGMInventory((bool)m_pp.gm); 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); SendAppearancePacket(AT_GM, m_pp.gm);
Save(); Save();
UpdateWho(); UpdateWho();
@ -2550,7 +2550,7 @@ uint16 Client::GetMaxSkillAfterSpecializationRules(EQEmu::skills::SkillType skil
} }
else 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); "Only %i primary specialization skill is allowed.", MaxSpecializations);
for (int i = EQEmu::skills::SkillSpecializeAbjure; i <= EQEmu::skills::SkillSpecializeEvocation; ++i) 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 (message) {
if(GetPVP()) if(GetPVP())
this->Message_StringID(MT_Shout,PVP_ON); this->Message_StringID(Chat::Shout,PVP_ON);
else 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()); SendAppearancePacket(AT_PVP, GetPVP());
@ -2714,22 +2714,22 @@ void Client::Disarm(Client* disarmer, int chance) {
if (matslot != EQEmu::textures::materialInvalid) if (matslot != EQEmu::textures::materialInvalid)
SendWearChange(matslot); SendWearChange(matslot);
} }
Message_StringID(MT_Skills, DISARMED); Message_StringID(Chat::Skills, DISARMED);
if (disarmer != this) if (disarmer != this)
disarmer->Message_StringID(MT_Skills, DISARM_SUCCESS, this->GetCleanName()); disarmer->Message_StringID(Chat::Skills, DISARM_SUCCESS, this->GetCleanName());
if (chance != 1000) if (chance != 1000)
disarmer->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 4); disarmer->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 4);
CalcBonuses(); CalcBonuses();
// CalcEnduranceWeightFactor(); // CalcEnduranceWeightFactor();
return; return;
} }
disarmer->Message_StringID(MT_Skills, DISARM_FAILED); disarmer->Message_StringID(Chat::Skills, DISARM_FAILED);
if (chance != 1000) if (chance != 1000)
disarmer->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 2); disarmer->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 2);
return; return;
} }
} }
disarmer->Message_StringID(MT_Skills, DISARM_FAILED); disarmer->Message_StringID(Chat::Skills, DISARM_FAILED);
} }
bool Client::BindWound(Mob *bindmob, bool start, bool fail) bool Client::BindWound(Mob *bindmob, bool start, bool fail)
@ -2771,7 +2771,7 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail)
} else { } else {
// send bindmob "stand still" // send bindmob "stand still"
if (!bindmob->IsAIControlled() && bindmob != this) { if (!bindmob->IsAIControlled() && bindmob != this) {
bindmob->CastToClient()->Message_StringID(clientMessageYellow, bindmob->CastToClient()->Message_StringID(Chat::Yellow,
YOU_ARE_BEING_BANDAGED); YOU_ARE_BEING_BANDAGED);
} else if (bindmob->IsAIControlled() && bindmob != this) { } else if (bindmob->IsAIControlled() && bindmob != this) {
; // Tell IPC to stand still? ; // Tell IPC to stand still?
@ -2855,7 +2855,7 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail)
} }
else { else {
// I dont have the real, live // 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); max_percent);
if (bindmob != this && bindmob->IsClient()) if (bindmob != this && bindmob->IsClient())
bindmob->CastToClient()->Message( bindmob->CastToClient()->Message(
@ -2916,9 +2916,9 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail)
bindmob->SendHPUpdate(); bindmob->SendHPUpdate();
} }
else { 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()) 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 // this version is for messages with no parameters
void Client::Message_StringID(uint32 type, uint32 string_id, uint32 distance) 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; return;
if (GetFilter(FilterMeleeCrits) == FilterHide && type == MT_CritMelee) //98 is self... if (GetFilter(FilterMeleeCrits) == FilterHide && type == Chat::MeleeCrit) //98 is self...
return; return;
if (GetFilter(FilterSpellCrits) == FilterHide && type == MT_SpellCrits) if (GetFilter(FilterSpellCrits) == FilterHide && type == Chat::SpellCrit)
return; return;
auto outapp = new EQApplicationPacket(OP_SimpleMessage, 12); auto outapp = new EQApplicationPacket(OP_SimpleMessage, 12);
SimpleMessage_Struct* sms = (SimpleMessage_Struct*)outapp->pBuffer; 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* message5,const char* message6,const char* message7,
const char* message8,const char* message9, uint32 distance) const char* message8,const char* message9, uint32 distance)
{ {
if (GetFilter(FilterSpellDamage) == FilterHide && type == MT_NonMelee) if (GetFilter(FilterSpellDamage) == FilterHide && type == Chat::NonMelee)
return; return;
if (GetFilter(FilterMeleeCrits) == FilterHide && type == MT_CritMelee) //98 is self... if (GetFilter(FilterMeleeCrits) == FilterHide && type == Chat::MeleeCrit) //98 is self...
return; return;
if (GetFilter(FilterSpellCrits) == FilterHide && type == MT_SpellCrits) if (GetFilter(FilterSpellCrits) == FilterHide && type == Chat::SpellCrit)
return; return;
if (GetFilter(FilterDamageShields) == FilterHide && type == MT_DS) if (GetFilter(FilterDamageShields) == FilterHide && type == Chat::DamageShield)
return; return;
int i = 0, argcount = 0, length = 0; int i = 0, argcount = 0, length = 0;
char *bufptr = nullptr; char *bufptr = nullptr;
const char *message_arg[9] = {0}; const char *message_arg[9] = {0};
if(type==MT_Emote) if(type==Chat::Emote)
type=4; type=4;
if(!message1) if(!message1)
@ -3236,7 +3236,7 @@ void Client::FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType fil
char *bufptr = nullptr; char *bufptr = nullptr;
const char *message_arg[9] = {0}; const char *message_arg[9] = {0};
if (type == MT_Emote) if (type == Chat::Emote)
type = 4; type = 4;
if (!message1) { if (!message1) {
@ -3281,7 +3281,7 @@ void Client::Tell_StringID(uint32 string_id, const char *who, const char *messag
char string_id_str[10]; char string_id_str[10];
snprintf(string_id_str, 10, "%d", string_id); 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) { void Client::SetTint(int16 in_slot, uint32 color) {
@ -3344,7 +3344,7 @@ void Client::SetLanguageSkill(int langid, int value)
QueuePacket(outapp); QueuePacket(outapp);
safe_delete(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() void Client::LinkDead()
@ -3432,7 +3432,7 @@ void Client::Escape()
entity_list.RemoveFromTargets(this, true); entity_list.RemoveFromTargets(this, true);
SetInvisible(1); SetInvisible(1);
Message_StringID(MT_Skills, ESCAPE); Message_StringID(Chat::Skills, ESCAPE);
} }
float Client::CalcPriceMod(Mob* other, bool reverse) float Client::CalcPriceMod(Mob* other, bool reverse)
@ -3828,9 +3828,9 @@ void Client::EnteringMessages(Client* client)
uint8 flag = database.GetAgreementFlag(client->AccountID()); uint8 flag = database.GetAgreementFlag(client->AccountID());
if(!flag) if(!flag)
{ {
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(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(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->SendAppearancePacket(AT_Anim, ANIM_FREEZE); client->SendAppearancePacket(AT_Anim, ANIM_FREEZE);
} }
} }
@ -3872,13 +3872,13 @@ void Client::SacrificeConfirm(Client *caster)
} }
if (GetLevel() < RuleI(Spells, SacrificeMinLevel)) { 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); safe_delete(outapp);
return; return;
} }
if (GetLevel() > RuleI(Spells, SacrificeMaxLevel)) { if (GetLevel() > RuleI(Spells, SacrificeMaxLevel)) {
caster->Message_StringID(13, SAC_TOO_HIGH); caster->Message_StringID(Chat::Red, SAC_TOO_HIGH);
safe_delete(outapp); safe_delete(outapp);
return; return;
} }
@ -3947,7 +3947,7 @@ void Client::Sacrifice(Client *caster)
caster->SummonItem(RuleI(Spells, SacrificeItemID)); caster->SummonItem(RuleI(Spells, SacrificeItemID));
} }
} else { } 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; return;
} }
Message(4,"Added to keyring."); Message(Chat::LightBlue,"Added to keyring.");
keyring.push_back(item_id); keyring.push_back(item_id);
} }
@ -4238,11 +4238,11 @@ bool Client::KeyRingCheck(uint32 item_id)
void Client::KeyRingList() void Client::KeyRingList()
{ {
Message(4,"Keys on Keyring:"); Message(Chat::LightBlue,"Keys on Keyring:");
const EQEmu::ItemData *item = nullptr; const EQEmu::ItemData *item = nullptr;
for (auto iter = keyring.begin(); iter != keyring.end(); ++iter) { for (auto iter = keyring.begin(); iter != keyring.end(); ++iter) {
if ((item = database.GetItem(*iter))!=nullptr) { 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) if (group->GetID() == 0)
{ {
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(13, "Unable to get new group id. Cannot create group."); inviter->Message(Chat::Red, "Unable to get new group id. Cannot create group.");
return false; 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", Log(Logs::General, Logs::None, "%s tried to open %s but %s was out of range",
GetName(), target->GetName(), target->GetName()); GetName(), target->GetName(), target->GetName());
Message(13, "Treasure chest out of range."); Message(Chat::Red, "Treasure chest out of range.");
return; return;
} }
@ -4932,7 +4932,7 @@ void Client::HandleLDoNOpen(NPC *target)
{ {
if(target->GetLDoNTrapSpellID() != 0) 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->SpellFinished(target->GetLDoNTrapSpellID(), this, EQEmu::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].ResistDiff);
target->SetLDoNTrapSpellID(0); target->SetLDoNTrapSpellID(0);
target->SetLDoNTrapped(false); target->SetLDoNTrapped(false);
@ -4948,7 +4948,7 @@ void Client::HandleLDoNOpen(NPC *target)
if(target->IsLDoNLocked()) if(target->IsLDoNLocked())
{ {
Message_StringID(MT_Skills, LDON_STILL_LOCKED, target->GetCleanName()); Message_StringID(Chat::Skills, LDON_STILL_LOCKED, target->GetCleanName());
return; return;
} }
else else
@ -4982,13 +4982,13 @@ void Client::HandleLDoNSenseTraps(NPC *target, uint16 skill, uint8 type)
{ {
if((target->GetLDoNTrapType() == LDoNTypeCursed || target->GetLDoNTrapType() == LDoNTypeMagical) && type != target->GetLDoNTrapType()) 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; return;
} }
if(target->IsLDoNTrapDetected()) if(target->IsLDoNTrapDetected())
{ {
Message_StringID(MT_Skills, LDON_CERTAIN_TRAP, target->GetCleanName()); Message_StringID(Chat::Skills, LDON_CERTAIN_TRAP, target->GetCleanName());
} }
else else
{ {
@ -4997,10 +4997,10 @@ void Client::HandleLDoNSenseTraps(NPC *target, uint16 skill, uint8 type)
{ {
case -1: case -1:
case 0: case 0:
Message_StringID(MT_Skills, LDON_DONT_KNOW_TRAPPED, target->GetCleanName()); Message_StringID(Chat::Skills, LDON_DONT_KNOW_TRAPPED, target->GetCleanName());
break; break;
case 1: case 1:
Message_StringID(MT_Skills, LDON_CERTAIN_TRAP, target->GetCleanName()); Message_StringID(Chat::Skills, LDON_CERTAIN_TRAP, target->GetCleanName());
target->SetLDoNTrapDetected(true); target->SetLDoNTrapDetected(true);
break; break;
default: default:
@ -5010,7 +5010,7 @@ void Client::HandleLDoNSenseTraps(NPC *target, uint16 skill, uint8 type)
} }
else 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()) if(!target->IsLDoNTrapped())
{ {
Message_StringID(MT_Skills, LDON_WAS_NOT_TRAPPED, target->GetCleanName()); Message_StringID(Chat::Skills, LDON_WAS_NOT_TRAPPED, target->GetCleanName());
return; return;
} }
if((target->GetLDoNTrapType() == LDoNTypeCursed || target->GetLDoNTrapType() == LDoNTypeMagical) && type != target->GetLDoNTrapType()) 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; return;
} }
@ -5048,13 +5048,13 @@ void Client::HandleLDoNDisarm(NPC *target, uint16 skill, uint8 type)
target->SetLDoNTrapDetected(false); target->SetLDoNTrapDetected(false);
target->SetLDoNTrapped(false); target->SetLDoNTrapped(false);
target->SetLDoNTrapSpellID(0); target->SetLDoNTrapSpellID(0);
Message_StringID(MT_Skills, LDON_HAVE_DISARMED, target->GetCleanName()); Message_StringID(Chat::Skills, LDON_HAVE_DISARMED, target->GetCleanName());
break; break;
case 0: case 0:
Message_StringID(MT_Skills, LDON_HAVE_NOT_DISARMED, target->GetCleanName()); Message_StringID(Chat::Skills, LDON_HAVE_NOT_DISARMED, target->GetCleanName());
break; break;
case -1: 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->SpellFinished(target->GetLDoNTrapSpellID(), this, EQEmu::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].ResistDiff);
target->SetLDoNTrapSpellID(0); target->SetLDoNTrapSpellID(0);
target->SetLDoNTrapped(false); target->SetLDoNTrapped(false);
@ -5073,7 +5073,7 @@ void Client::HandleLDoNPickLock(NPC *target, uint16 skill, uint8 type)
{ {
if(target->IsLDoNTrapped()) 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->SpellFinished(target->GetLDoNTrapSpellID(), this, EQEmu::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].ResistDiff);
target->SetLDoNTrapSpellID(0); target->SetLDoNTrapSpellID(0);
target->SetLDoNTrapped(false); target->SetLDoNTrapped(false);
@ -5082,13 +5082,13 @@ void Client::HandleLDoNPickLock(NPC *target, uint16 skill, uint8 type)
if(!target->IsLDoNLocked()) if(!target->IsLDoNLocked())
{ {
Message_StringID(MT_Skills, LDON_WAS_NOT_LOCKED, target->GetCleanName()); Message_StringID(Chat::Skills, LDON_WAS_NOT_LOCKED, target->GetCleanName());
return; return;
} }
if((target->GetLDoNTrapType() == LDoNTypeCursed || target->GetLDoNTrapType() == LDoNTypeMagical) && type != target->GetLDoNTrapType()) 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; return;
} }
@ -5098,11 +5098,11 @@ void Client::HandleLDoNPickLock(NPC *target, uint16 skill, uint8 type)
{ {
case 0: case 0:
case -1: case -1:
Message_StringID(MT_Skills, LDON_PICKLOCK_FAILURE, target->GetCleanName()); Message_StringID(Chat::Skills, LDON_PICKLOCK_FAILURE, target->GetCleanName());
break; break;
case 1: case 1:
target->SetLDoNLocked(false); target->SetLDoNLocked(false);
Message_StringID(MT_Skills, LDON_PICKLOCK_SUCCESS, target->GetCleanName()); Message_StringID(Chat::Skills, LDON_PICKLOCK_SUCCESS, target->GetCleanName());
break; break;
} }
} }
@ -5161,7 +5161,7 @@ void Client::SummonAndRezzAllCorpses()
int CorpseCount = database.SummonAllCharacterCorpses(CharacterID(), zone->GetZoneID(), zone->GetInstanceID(), GetPosition()); int CorpseCount = database.SummonAllCharacterCorpses(CharacterID(), zone->GetZoneID(), zone->GetInstanceID(), GetPosition());
if(CorpseCount <= 0) if(CorpseCount <= 0)
{ {
Message(clientMessageYellow, "You have no corpses to summnon."); Message(Chat::Yellow, "You have no corpses to summnon.");
return; return;
} }
@ -5170,7 +5170,7 @@ void Client::SummonAndRezzAllCorpses()
if(RezzExp > 0) if(RezzExp > 0)
SetEXP(GetEXP() + RezzExp, GetAAXP(), true); 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) 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 // setting city to zero allows the player to use /setstartcity to set the city themselves
if(zoneid == 0) { if(zoneid == 0) {
m_pp.binds[4].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; return;
} }
@ -5579,7 +5579,7 @@ void Client::SuspendMinion()
if(m_suspendedminion.SpellID > 0) if(m_suspendedminion.SpellID > 0)
{ {
if (m_suspendedminion.SpellID >= SPDAT_RECORDS) { 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)); memset(&m_suspendedminion, 0, sizeof(PetInfo));
return; return;
} }
@ -5591,7 +5591,7 @@ void Client::SuspendMinion()
if(!CurrentPet) if(!CurrentPet)
{ {
Message(13, "Failed to recall suspended minion."); Message(Chat::Red, "Failed to recall suspended minion.");
return; return;
} }
@ -5607,7 +5607,7 @@ void Client::SuspendMinion()
CurrentPet->SetMana(m_suspendedminion.Mana); 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)); memset(&m_suspendedminion, 0, sizeof(struct PetInfo));
// TODO: These pet command states need to be synced ... // TODO: These pet command states need to be synced ...
@ -5637,19 +5637,19 @@ void Client::SuspendMinion()
{ {
if(m_suspendedminion.SpellID > 0) if(m_suspendedminion.SpellID > 0)
{ {
Message_StringID(clientMessageError,ONLY_ONE_PET); Message_StringID(Chat::Red,ONLY_ONE_PET);
return; return;
} }
else if(CurrentPet->IsEngaged()) else if(CurrentPet->IsEngaged())
{ {
Message_StringID(clientMessageError,SUSPEND_MINION_FIGHTING); Message_StringID(Chat::Red,SUSPEND_MINION_FIGHTING);
return; return;
} }
else if(entity_list.Fighting(CurrentPet)) else if(entity_list.Fighting(CurrentPet))
{ {
Message_StringID(clientMessageBlue,SUSPEND_MINION_HAS_AGGRO); Message_StringID(Chat::Blue,SUSPEND_MINION_HAS_AGGRO);
} }
else else
{ {
@ -5666,7 +5666,7 @@ void Client::SuspendMinion()
else else
strn0cpy(m_suspendedminion.Name, CurrentPet->GetName(), 64); // Name stays even at rank 1 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); CurrentPet->Depop(false);
@ -5675,7 +5675,7 @@ void Client::SuspendMinion()
} }
else else
{ {
Message_StringID(clientMessageError, ONLY_SUMMONED_PETS); Message_StringID(Chat::Red, ONLY_SUMMONED_PETS);
return; return;
} }
@ -6149,16 +6149,16 @@ void Client::LocateCorpse()
if(ClosestCorpse) if(ClosestCorpse)
{ {
Message_StringID(MT_Spells, SENSE_CORPSE_DIRECTION); Message_StringID(Chat::Spells, SENSE_CORPSE_DIRECTION);
SetHeading(CalculateHeadingToTarget(ClosestCorpse->GetX(), ClosestCorpse->GetY())); SetHeading(CalculateHeadingToTarget(ClosestCorpse->GetX(), ClosestCorpse->GetY()));
SetTarget(ClosestCorpse); SetTarget(ClosestCorpse);
SendTargetCommand(ClosestCorpse->GetID()); SendTargetCommand(ClosestCorpse->GetID());
SentPositionPacket(0.0f, 0.0f, 0.0f, 0.0f, 0, true); SentPositionPacket(0.0f, 0.0f, 0.0f, 0.0f, 0, true);
} }
else if(!GetTarget()) else if(!GetTarget())
Message_StringID(clientMessageError, SENSE_CORPSE_NONE); Message_StringID(Chat::Red, SENSE_CORPSE_NONE);
else 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) void Client::NPCSpawn(NPC *target_npc, const char *identifier, uint32 extra)
@ -6218,7 +6218,7 @@ void Client::DragCorpses()
if (!corpse || !corpse->IsPlayerCorpse() || if (!corpse || !corpse->IsPlayerCorpse() ||
corpse->CastToCorpse()->IsBeingLooted() || corpse->CastToCorpse()->IsBeingLooted() ||
!corpse->CastToCorpse()->Summon(this, false, false)) { !corpse->CastToCorpse()->Summon(this, false, false)) {
Message_StringID(MT_DefaultText, CORPSEDRAG_STOP); Message_StringID(Chat::DefaultText, CORPSEDRAG_STOP);
It = DraggedCorpses.erase(It); It = DraggedCorpses.erase(It);
if (It == DraggedCorpses.end()) if (It == DraggedCorpses.end())
break; 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)) if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record))
{ {
Log(Logs::General, Logs::Error, "Unknown doppelganger spell id: %d, check pets table", spell_id); 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; return;
} }
@ -6850,11 +6850,11 @@ void Client::SendStatsWindow(Client* client, bool use_window)
goto Extra_Info; goto Extra_Info;
} }
else { 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, " 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, " HP: %i/%i HP Regen: %i/%i",GetHP(), GetMaxHP(), CalcHPRegen(), CalcHPRegenCap());
client->Message(0, " compute_tohit: %i TotalToHit: %i", compute_tohit(skill), GetTotalToHit(skill, 0)); client->Message(0, " compute_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)) if (!(m_ClientVersionBit & EQEmu::versions::maskRoFAndLater))
{ {
Message_StringID(0, PICK_LORE); Message_StringID(Chat::White, PICK_LORE);
return; return;
} }
@ -7632,7 +7632,7 @@ void Client::DuplicateLoreMessage(uint32 ItemID)
if(!item) if(!item)
return; return;
Message_StringID(0, PICK_LORE, item->Name); Message_StringID(Chat::White, PICK_LORE, item->Name);
} }
void Client::GarbleMessage(char *message, uint8 variance) 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], &current_value, temp[i], this_faction_min, this_faction_max); UpdatePersonalFaction(char_id, npc_value[i], faction_id[i], &current_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); 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, &current_value, temp, this_faction_min, this_faction_max); UpdatePersonalFaction(char_id, value, faction_id, &current_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); 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) if (tmpvalue == 0 || temp == 1 || temp == 2)
return; return;
else if (faction_value >= this_faction_max) 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) 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)) 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)) 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)) 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; return;
} }
@ -8428,7 +8428,7 @@ void Client::ExpeditionSay(const char *str, int ExpID) {
return; return;
if(results.RowCount() == 0) { 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; return;
} }
@ -8531,7 +8531,7 @@ void Client::SendHPUpdateMarquee(){
return; return;
std::string health_update_notification = StringFormat("Health: %u%%", health_percentage); 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) { uint32 Client::GetMoney(uint8 type, uint8 subtype) {
@ -9044,7 +9044,7 @@ void Client::SetPrimaryWeaponOrnamentation(uint32 model_id)
SendItemPacket(EQEmu::invslot::slotPrimary, primary_item, ItemPacketTrade); SendItemPacket(EQEmu::invslot::slotPrimary, primary_item, ItemPacketTrade);
WearChange(EQEmu::textures::weaponPrimary, static_cast<uint16>(model_id), 0); WearChange(EQEmu::textures::weaponPrimary, static_cast<uint16>(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); SendItemPacket(EQEmu::invslot::slotSecondary, secondary_item, ItemPacketTrade);
WearChange(EQEmu::textures::weaponSecondary, static_cast<uint16>(model_id), 0); WearChange(EQEmu::textures::weaponSecondary, static_cast<uint16>(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<float>(atof(row[5])); auto heading = static_cast<float>(atof(row[5]));
if (instance_id > 0 && !database.CheckInstanceExists(instance_id)) { 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; return false;
} }

View File

@ -90,23 +90,6 @@ public:
bool ack_req; 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 #define SPELLBAR_UNLOCK 0x2bc
enum { //scribing argument to MemorizeSpell enum { //scribing argument to MemorizeSpell
memSpellUnknown = -1, // this modifies some state data memSpellUnknown = -1, // this modifies some state data

File diff suppressed because it is too large Load Diff

View File

@ -378,10 +378,10 @@ bool Client::Process() {
} }
if (!CombatRange(auto_attack_target)) { 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) { 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) { else if (!los_status || !los_status_facing) {
//you can't see your target //you can't see your target
@ -416,11 +416,11 @@ bool Client::Process() {
// Range check // Range check
if (!CombatRange(auto_attack_target)) { if (!CombatRange(auto_attack_target)) {
// this is a duplicate message don't use it. // 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 // Don't attack yourself
else if (auto_attack_target == this) { 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) 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); sprintf(handy_id, "%i", greet_id);
if (greet_id != MERCHANT_GREETING) 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 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); // safe_delete_array(cpi);
@ -989,7 +989,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I
if(PendingRezzXP < 0) { if(PendingRezzXP < 0) {
// pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer // pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer
Log(Logs::Detail, Logs::Spells, "Unexpected OP_RezzAnswer. Ignoring it."); 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; return;
} }
@ -1043,7 +1043,7 @@ void Client::OPTGB(const EQApplicationPacket *app)
uint32 tgb_flag = *(uint32 *)app->pBuffer; uint32 tgb_flag = *(uint32 *)app->pBuffer;
if(tgb_flag == 2) if(tgb_flag == 2)
Message_StringID(0, TGB() ? TGB_ON : TGB_OFF); Message_StringID(Chat::White, TGB() ? TGB_ON : TGB_OFF);
else else
tgb = tgb_flag; tgb = tgb_flag;
} }
@ -1061,7 +1061,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
if(!IsValidSpell(memspell->spell_id)) 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; return;
} }
@ -1072,8 +1072,8 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
) )
{ {
char val1[20]={0}; 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_StringID(Chat::Red,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(Chat::Red, "Unexpected error: Class cant use this spell at your level!");
return; return;
} }
@ -1087,7 +1087,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
const EQEmu::ItemData* item = inst->GetItem(); const EQEmu::ItemData* item = inst->GetItem();
if (RuleB(Character, RestrictSpellScribing) && !item->IsEquipable(GetRace(), GetClass())) { if (RuleB(Character, RestrictSpellScribing) && !item->IsEquipable(GetRace(), GetClass())) {
Message_StringID(13, CANNOT_USE_ITEM); Message_StringID(Chat::Red, CANNOT_USE_ITEM);
break; break;
} }
@ -1439,7 +1439,7 @@ void Client::OPMoveCoin(const EQApplicationPacket* app)
} }
else{ else{
if (to_bucket == &m_pp.platinum_shared || from_bucket == &m_pp.platinum_shared){ 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; with->trade->state = Trading;
Client* recipient = trader->CastToClient(); Client* recipient = trader->CastToClient();
recipient->Message(15, "%s adds some coins to the trade.", GetName()); recipient->Message(Chat::Yellow, "%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, "The total trade is: %i PP, %i GP, %i SP, %i CP",
trade->pp, trade->gp, trade->pp, trade->gp,
trade->sp, trade->cp trade->sp, trade->cp
); );
@ -1645,7 +1645,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app)
case EQEmu::skills::SkillJewelryMaking: case EQEmu::skills::SkillJewelryMaking:
case EQEmu::skills::SkillPottery: case EQEmu::skills::SkillPottery:
if(skilllevel >= RuleI(Skills, MaxTrainTradeskills)) { 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; return;
} }
break; break;
@ -1655,7 +1655,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app)
case EQEmu::skills::SkillSpecializeDivination: case EQEmu::skills::SkillSpecializeDivination:
case EQEmu::skills::SkillSpecializeEvocation: case EQEmu::skills::SkillSpecializeEvocation:
if(skilllevel >= RuleI(Skills, MaxTrainSpecializations)) { 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; return;
} }
default: default:
@ -1666,7 +1666,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app)
if (skilllevel >= MaxSkillValue) if (skilllevel >= MaxSkillValue)
{ {
// Don't allow training over max skill level // 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; return;
} }
@ -1676,7 +1676,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app)
if (skilllevel >= MaxSpecSkill) if (skilllevel >= MaxSpecSkill)
{ {
// Restrict specialization training to follow the rules // 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; return;
} }
} }
@ -1919,7 +1919,7 @@ void Client::DoTracking()
Mob *m = entity_list.GetMob(TrackingID); Mob *m = entity_list.GetMob(TrackingID);
if (!m || m->IsCorpse()) { if (!m || m->IsCorpse()) {
Message_StringID(MT_Skills, TRACK_LOST_TARGET); Message_StringID(Chat::Skills, TRACK_LOST_TARGET);
TrackingID = 0; TrackingID = 0;
return; return;
} }
@ -1930,23 +1930,23 @@ void Client::DoTracking()
RelativeHeading += 512; RelativeHeading += 512;
if (RelativeHeading > 480) 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) 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) 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) 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) 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) 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) 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) 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) 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) void Client::HandleRespawnFromHover(uint32 Option)

View File

@ -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 if(IsPlayerCorpse() && !corpse_db_id) { // really should try to resave in this case
// SendLootReqErrorPacket(client, 0); // 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; std::cout << "Error: PlayerCorpse::MakeLootRequestPackets: dbid = 0!" << std::endl;
// return; // return;
} }
if(is_locked && client->Admin() < 100) { if(is_locked && client->Admin() < 100) {
SendLootReqErrorPacket(client, LootResponse::SomeoneElse); SendLootReqErrorPacket(client, LootResponse::SomeoneElse);
client->Message(13, "Error: Corpse locked by GM."); client->Message(Chat::Red, "Error: Corpse locked by GM.");
return; return;
} }
@ -960,7 +960,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
loot_coin = (tmp[0] == 1 && tmp[1] == '\0'); loot_coin = (tmp[0] == 1 && tmp[1] == '\0');
if (loot_request_type == LootRequestType::GMPeek || loot_request_type == LootRequestType::GMAllowed) { 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()); GetPlatinum(), GetGold(), GetSilver(), GetCopper());
auto outapp = new EQApplicationPacket(OP_MoneyOnCorpse, sizeof(moneyOnCorpseStruct)); auto outapp = new EQApplicationPacket(OP_MoneyOnCorpse, sizeof(moneyOnCorpseStruct));
@ -1035,7 +1035,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
else { else {
Log(Logs::General, Logs::Inventory, "MakeLootRequestPackets() PlayerKillItem %i not found", pkitemid); 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); 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. */ /* 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()) { 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); client->QueuePacket(app);
SendEndLootErrorPacket(client); SendEndLootErrorPacket(client);
/* Unlock corpse for others */ /* Unlock corpse for others */
@ -1146,7 +1146,7 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app)
if (IsPlayerCorpse() && !CanPlayerLoot(client->CharacterID()) && !become_npc && if (IsPlayerCorpse() && !CanPlayerLoot(client->CharacterID()) && !become_npc &&
(char_id != client->CharacterID() && client->Admin() < 150)) { (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); client->QueuePacket(app);
SendEndLootErrorPacket(client); SendEndLootErrorPacket(client);
return; return;
@ -1155,13 +1155,13 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app)
if (is_locked && client->Admin() < 100) { if (is_locked && client->Admin() < 100) {
client->QueuePacket(app); client->QueuePacket(app);
SendLootReqErrorPacket(client, LootResponse::SomeoneElse); SendLootReqErrorPacket(client, LootResponse::SomeoneElse);
client->Message(13, "Error: Corpse locked by GM."); client->Message(Chat::Red, "Error: Corpse locked by GM.");
return; return;
} }
if (IsPlayerCorpse() && (char_id != client->CharacterID()) && CanPlayerLoot(client->CharacterID()) && if (IsPlayerCorpse() && (char_id != client->CharacterID()) && CanPlayerLoot(client->CharacterID()) &&
GetPlayerKillItem() == 0) { 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); client->QueuePacket(app);
SendEndLootErrorPacket(client); SendEndLootErrorPacket(client);
ResetLooter(); ResetLooter();
@ -1201,7 +1201,7 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app)
if (client && inst) { if (client && inst) {
if (client->CheckLoreConflict(item)) { if (client->CheckLoreConflict(item)) {
client->Message_StringID(0, LOOT_LORE_ERROR); client->Message_StringID(Chat::White, LOOT_LORE_ERROR);
client->QueuePacket(app); client->QueuePacket(app);
SendEndLootErrorPacket(client); SendEndLootErrorPacket(client);
ResetLooter(); ResetLooter();
@ -1214,7 +1214,7 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app)
EQEmu::ItemInstance *itm = inst->GetAugment(i); EQEmu::ItemInstance *itm = inst->GetAugment(i);
if (itm) { if (itm) {
if (client->CheckLoreConflict(itm->GetItem())) { if (client->CheckLoreConflict(itm->GetItem())) {
client->Message_StringID(0, LOOT_LORE_ERROR); client->Message_StringID(Chat::White, LOOT_LORE_ERROR);
client->QueuePacket(app); client->QueuePacket(app);
SendEndLootErrorPacket(client); SendEndLootErrorPacket(client);
ResetLooter(); ResetLooter();
@ -1236,7 +1236,7 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app)
args.push_back(this); args.push_back(this);
if (parse->EventPlayer(EVENT_LOOT, client, buf, 0, &args) != 0) { if (parse->EventPlayer(EVENT_LOOT, client, buf, 0, &args) != 0) {
lootitem->auto_loot = -1; 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); client->QueuePacket(app);
delete inst; delete inst;
return; return;
@ -1312,18 +1312,18 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app)
linker.GenerateLink(); 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()) { if (!IsPlayerCorpse()) {
Group *g = client->GetGroup(); Group *g = client->GetGroup();
if (g != nullptr) { 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()); client->GetName(), linker.Link().c_str());
} }
else { else {
Raid *r = client->GetRaid(); Raid *r = client->GetRaid();
if (r != nullptr) { 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()); client->GetName(), linker.Link().c_str());
} }
} }
@ -1426,7 +1426,7 @@ bool Corpse::Summon(Client* client, bool spell, bool CheckDistance) {
if (!spell) { if (!spell) {
if (this->GetCharID() == client->CharacterID()) { if (this->GetCharID() == client->CharacterID()) {
if (IsLocked() && client->Admin() < 100) { 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; return false;
} }
if (!CheckDistance || (DistanceSquaredNoZ(m_Position, client->GetPosition()) <= dist2)) { if (!CheckDistance || (DistanceSquaredNoZ(m_Position, client->GetPosition()) <= dist2)) {

View File

@ -171,7 +171,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) {
if (RuleI(Adventure, ItemIDToEnablePorts) != 0) { if (RuleI(Adventure, ItemIDToEnablePorts) != 0) {
if (!sender->KeyRingCheck(RuleI(Adventure, ItemIDToEnablePorts))) { if (!sender->KeyRingCheck(RuleI(Adventure, ItemIDToEnablePorts))) {
if (sender->GetInv().HasItem(RuleI(Adventure, ItemIDToEnablePorts)) == INVALID_INDEX) { 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); safe_delete(outapp);
return; return;
} else { } else {
@ -267,7 +267,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) {
strcpy(door_message, "Door is locked by an unknown guild"); strcpy(door_message, "Door is locked by an unknown guild");
} }
sender->Message(4, door_message); sender->Message(Chat::LightBlue, door_message);
safe_delete(outapp); safe_delete(outapp);
return; return;
} }
@ -275,13 +275,13 @@ void Doors::HandleClick(Client* sender, uint8 trigger) {
/** /**
* Key required * Key required
*/ */
sender->Message(4, "This is locked..."); sender->Message(Chat::LightBlue, "This is locked...");
/** /**
* GM can always open locks * GM can always open locks
*/ */
if (sender->GetGM()) { if (sender->GetGM()) {
sender->Message_StringID(4, DOORS_GM); sender->Message_StringID(Chat::LightBlue, DOORS_GM);
if (!IsDoorOpen() || (open_type == 58)) { if (!IsDoorOpen() || (open_type == 58)) {
move_door_packet->action = static_cast<uint8>(invert_state == 0 ? OPEN_DOOR : OPEN_INVDOOR); move_door_packet->action = static_cast<uint8>(invert_state == 0 ? OPEN_DOOR : OPEN_INVDOOR);
@ -306,7 +306,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) {
sender->KeyRingAdd(player_key); sender->KeyRingAdd(player_key);
} }
sender->Message(4, "You got it open!"); sender->Message(Chat::LightBlue, "You got it open!");
if (!IsDoorOpen() || (open_type == 58)) { if (!IsDoorOpen() || (open_type == 58)) {
move_door_packet->action = static_cast<uint8>(invert_state == 0 ? OPEN_DOOR : OPEN_INVDOOR); move_door_packet->action = static_cast<uint8>(invert_state == 0 ? OPEN_DOOR : OPEN_INVDOOR);
@ -333,19 +333,19 @@ void Doors::HandleClick(Client* sender, uint8 trigger) {
} else { } else {
move_door_packet->action = static_cast<uint8>(invert_state == 0 ? CLOSE_DOOR : CLOSE_INVDOOR); move_door_packet->action = static_cast<uint8>(invert_state == 0 ? CLOSE_DOOR : CLOSE_INVDOOR);
} }
sender->Message_StringID(4, DOORS_SUCCESSFUL_PICK); sender->Message_StringID(Chat::LightBlue, DOORS_SUCCESSFUL_PICK);
} else { } else {
sender->Message_StringID(4, DOORS_INSUFFICIENT_SKILL); sender->Message_StringID(Chat::LightBlue, DOORS_INSUFFICIENT_SKILL);
safe_delete(outapp); safe_delete(outapp);
return; return;
} }
} else { } else {
sender->Message_StringID(4, DOORS_NO_PICK); sender->Message_StringID(Chat::LightBlue, DOORS_NO_PICK);
safe_delete(outapp); safe_delete(outapp);
return; return;
} }
} else { } else {
sender->Message_StringID(4, DOORS_CANT_PICK); sender->Message_StringID(Chat::LightBlue, DOORS_CANT_PICK);
safe_delete(outapp); safe_delete(outapp);
return; return;
} }
@ -361,14 +361,14 @@ void Doors::HandleClick(Client* sender, uint8 trigger) {
*/ */
if (sender->KeyRingCheck(required_key_item)) { if (sender->KeyRingCheck(required_key_item)) {
player_key = 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)) { if (!IsDoorOpen() || (open_type == 58)) {
move_door_packet->action = static_cast<uint8>(invert_state == 0 ? OPEN_DOOR : OPEN_INVDOOR); move_door_packet->action = static_cast<uint8>(invert_state == 0 ? OPEN_DOOR : OPEN_INVDOOR);
} else { } else {
move_door_packet->action = static_cast<uint8>(invert_state == 0 ? CLOSE_DOOR : CLOSE_INVDOOR); move_door_packet->action = static_cast<uint8>(invert_state == 0 ? CLOSE_DOOR : CLOSE_INVDOOR);
} }
} else { } else {
sender->Message_StringID(4, DOORS_LOCKED); sender->Message_StringID(Chat::LightBlue, DOORS_LOCKED);
safe_delete(outapp); safe_delete(outapp);
return; return;
} }

View File

@ -122,11 +122,11 @@ int32 Mob::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
else if (IsNPC() && CastToNPC()->GetSpellScale()) else if (IsNPC() && CastToNPC()->GetSpellScale())
value = int(static_cast<float>(value) * CastToNPC()->GetSpellScale() / 100.0f); value = int(static_cast<float>(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)); OTHER_CRIT_BLAST, GetName(), itoa(-value));
if (IsClient()) if (IsClient())
Message_StringID(MT_SpellCrits, YOU_CRIT_BLAST, itoa(-value)); Message_StringID(Chat::SpellCrit, YOU_CRIT_BLAST, itoa(-value));
return value; return value;
} }
@ -306,11 +306,11 @@ int32 Mob::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
value = int(static_cast<float>(value) * CastToNPC()->GetHealScale() / 100.0f); value = int(static_cast<float>(value) * CastToNPC()->GetHealScale() / 100.0f);
if (Critical) { 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)); OTHER_CRIT_HEAL, GetName(), itoa(value));
if (IsClient()) if (IsClient())
Message_StringID(MT_SpellCrits, YOU_CRIT_HEAL, itoa(value)); Message_StringID(Chat::SpellCrit, YOU_CRIT_HEAL, itoa(value));
} }
return value; return value;
@ -432,13 +432,13 @@ bool Client::TrainDiscipline(uint32 itemid) {
//get the item info //get the item info
const EQEmu::ItemData *item = database.GetItem(itemid); const EQEmu::ItemData *item = database.GetItem(itemid);
if(item == nullptr) { 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); Log(Logs::General, Logs::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid);
return(false); return(false);
} }
if (!item->IsClassCommon() || item->ItemType != EQEmu::item::ItemTypeSpell) { 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... //summon them the item back...
SummonItem(itemid); SummonItem(itemid);
return(false); return(false);
@ -462,7 +462,7 @@ bool Client::TrainDiscipline(uint32 itemid) {
item->Name[5] == ':' && item->Name[5] == ':' &&
item->Name[6] == ' ' 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... //summon them the item back...
SummonItem(itemid); SummonItem(itemid);
return(false); return(false);
@ -470,7 +470,7 @@ bool Client::TrainDiscipline(uint32 itemid) {
int myclass = GetClass(); int myclass = GetClass();
if(myclass == WIZARD || myclass == ENCHANTER || myclass == MAGICIAN || myclass == NECROMANCER) { 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... //summon them the item back...
SummonItem(itemid); SummonItem(itemid);
return(false); return(false);
@ -480,7 +480,7 @@ bool Client::TrainDiscipline(uint32 itemid) {
//can we use the item? //can we use the item?
uint32 cbit = 1 << (myclass-1); uint32 cbit = 1 << (myclass-1);
if(!(item->Classes & cbit)) { 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... //summon them the item back...
SummonItem(itemid); SummonItem(itemid);
return(false); return(false);
@ -488,7 +488,7 @@ bool Client::TrainDiscipline(uint32 itemid) {
uint32 spell_id = item->Scroll.Effect; uint32 spell_id = item->Scroll.Effect;
if(!IsValidSpell(spell_id)) { if(!IsValidSpell(spell_id)) {
Message(13, "This tome contains invalid knowledge."); Message(Chat::Red, "This tome contains invalid knowledge.");
return(false); return(false);
} }
@ -496,14 +496,14 @@ bool Client::TrainDiscipline(uint32 itemid) {
const SPDat_Spell_Struct &spell = spells[spell_id]; const SPDat_Spell_Struct &spell = spells[spell_id];
uint8 level_to_use = spell.classes[myclass - 1]; uint8 level_to_use = spell.classes[myclass - 1];
if(level_to_use == 255) { 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... //summon them the item back...
SummonItem(itemid); SummonItem(itemid);
return(false); return(false);
} }
if(level_to_use > GetLevel()) { 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... //summon them the item back...
SummonItem(itemid); SummonItem(itemid);
return(false); return(false);
@ -513,7 +513,7 @@ bool Client::TrainDiscipline(uint32 itemid) {
int r; int r;
for(r = 0; r < MAX_PP_DISCIPLINES; r++) { for(r = 0; r < MAX_PP_DISCIPLINES; r++) {
if(m_pp.disciplines.values[r] == spell_id) { 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... //summon them the item back...
SummonItem(itemid); SummonItem(itemid);
return(false); return(false);
@ -525,7 +525,7 @@ bool Client::TrainDiscipline(uint32 itemid) {
return(true); 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); return(false);
} }
@ -537,7 +537,7 @@ void Client::TrainDiscBySpellID(int32 spell_id)
m_pp.disciplines.values[i] = spell_id; m_pp.disciplines.values[i] = spell_id;
database.SaveCharacterDisc(this->CharacterID(), i, spell_id); database.SaveCharacterDisc(this->CharacterID(), i, spell_id);
SendDisciplineUpdate(); SendDisciplineUpdate();
Message(15, "You have learned a new combat ability!"); Message(Chat::Yellow, "You have learned a new combat ability!");
return; return;
} }
} }
@ -581,7 +581,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
//make sure we can use it.. //make sure we can use it..
if(!IsValidSpell(spell_id)) { if(!IsValidSpell(spell_id)) {
Message(13, "This tome contains invalid knowledge."); Message(Chat::Red, "This tome contains invalid knowledge.");
return(false); return(false);
} }
@ -589,13 +589,13 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
const SPDat_Spell_Struct &spell = spells[spell_id]; const SPDat_Spell_Struct &spell = spells[spell_id];
uint8 level_to_use = spell.classes[GetClass() - 1]; uint8 level_to_use = spell.classes[GetClass() - 1];
if(level_to_use == 255) { 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... //should summon them a new one...
return(false); return(false);
} }
if(level_to_use > GetLevel()) { 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... //should summon them a new one...
return(false); 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 // sneak attack discs require you to be hidden for 4 seconds before use
if (spell.sneak && (!hidden || (hidden && (Timer::GetCurrentTime() - tmHidden) < 4000))) { if (spell.sneak && (!hidden || (hidden && (Timer::GetCurrentTime() - tmHidden) < 4000))) {
Message_StringID(MT_SpellFailure, SNEAK_RESTRICT); Message_StringID(Chat::SpellFailure, SNEAK_RESTRICT);
return false; return false;
} }
@ -621,7 +621,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
/*char val1[20]={0};*/ //unused /*char val1[20]={0};*/ //unused
/*char val2[20]={0};*/ //unused /*char val2[20]={0};*/ //unused
uint32 remain = p_timers.GetRemainingTime(DiscTimer); 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)); Message(0, "You can use this discipline in %d minutes %d seconds.", ((remain)/60), (remain%60));
return(false); return(false);
} }

View File

@ -160,7 +160,7 @@ XS(XS__say) {
opts.speak_mode = Journal::SpeakMode::Say; opts.speak_mode = Journal::SpeakMode::Say;
opts.journal_mode = Journal::Mode::Log2; opts.journal_mode = Journal::Mode::Log2;
opts.language = 0; opts.language = 0;
opts.message_type = MT_NPCQuestSay; opts.message_type = Chat::NPCQuestSay;
if (items == 0 || items > 5) { 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])"); Perl_croak(aTHX_ "Usage: quest::say(string message, [int language_id], [int message_type], [int speak_mode], [int journal_mode])");
} else if (items == 2) { } else if (items == 2) {

View File

@ -1671,9 +1671,9 @@ void EntityList::DuelMessage(Mob *winner, Mob *loser, bool flee)
//might want some sort of distance check in here? //might want some sort of distance check in here?
if (cur != winner && cur != loser) { if (cur != winner && cur != loser) {
if (flee) 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 else
cur->Message_StringID(15, DUEL_FINISHED, winner->GetName(),loser->GetName()); cur->Message_StringID(Chat::Yellow, DUEL_FINISHED, winner->GetName(),loser->GetName());
} }
++it; ++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, void EntityList::FilteredMessageClose_StringID(Mob *sender, bool skipsender,
float dist, uint32 type, eqFilterType filter, uint32 string_id, float dist, uint32 type, eqFilterType filter, uint32 string_id,
const char *message1, const char *message2, const char *message3, const char *message1, const char *message2, const char *message3,
@ -2774,7 +2791,7 @@ void EntityList::CorpseFix(Client* c)
Corpse* corpse = it->second; Corpse* corpse = it->second;
if (corpse->IsNPCCorpse()) { if (corpse->IsNPCCorpse()) {
if (DistanceNoZ(c->GetPosition(), corpse->GetPosition()) < 100) { 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); 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(); auto it = client_list.begin();
while (it != client_list.end()) { 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->second->QueuePacket(outapp);
++it; ++it;
} }

View File

@ -333,18 +333,18 @@ void Client::CalculateLeadershipExp(uint32 &add_exp, uint8 conlevel)
uint32 mentor_exp = exp * (GetGroup()->GetMentorPercent() / 100.0f); uint32 mentor_exp = exp * (GetGroup()->GetMentorPercent() / 100.0f);
exp -= mentor_exp; exp -= mentor_exp;
mentoree->AddLeadershipEXP(mentor_exp, 0); // ends up rounded down 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) if (exp > 0)
{ {
// possible if you mentor 100% to the other client // 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 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 else
{ {
Message_StringID(MT_Leadership, MAX_GROUP_LEADERSHIP_POINTS); Message_StringID(Chat::LeaderShip, MAX_GROUP_LEADERSHIP_POINTS);
} }
} }
else else
@ -357,11 +357,11 @@ void Client::CalculateLeadershipExp(uint32 &add_exp, uint8 conlevel)
&& RuleI(Character, KillsPerRaidLeadershipAA) > 0) && RuleI(Character, KillsPerRaidLeadershipAA) > 0)
{ {
AddLeadershipEXP(0, RAID_EXP_PER_POINT / RuleI(Character, KillsPerRaidLeadershipAA)); 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 else
{ {
Message_StringID(MT_Leadership, MAX_RAID_LEADERSHIP_POINTS); Message_StringID(Chat::LeaderShip, MAX_RAID_LEADERSHIP_POINTS);
} }
} }
else else
@ -378,17 +378,17 @@ void Client::CalculateLeadershipExp(uint32 &add_exp, uint8 conlevel)
uint32 mentor_exp = exp * (raid->GetMentorPercent(group_id) / 100.0f); uint32 mentor_exp = exp * (raid->GetMentorPercent(group_id) / 100.0f);
exp -= mentor_exp; exp -= mentor_exp;
mentoree->AddLeadershipEXP(mentor_exp, 0); 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) if (exp > 0)
{ {
AddLeadershipEXP(exp, 0); AddLeadershipEXP(exp, 0);
Message_StringID(MT_Leadership, GAIN_GROUP_LEADERSHIP_EXP); Message_StringID(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_EXP);
} }
} }
else 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. // AA Sanity Checking for players who set aa exp and deleveled below allowed aa level.
if (GetLevel() <= 50 && m_epp.perAA > 0) { 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; aaexp = 0;
m_epp.perAA = 0; m_epp.perAA = 0;
} }
@ -528,7 +528,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
auto max_AAXP = GetRequiredAAExperience(); auto max_AAXP = GetRequiredAAExperience();
if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) { 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 return; // Must be invalid class/race
} }
uint32 i = 0; uint32 i = 0;
@ -564,23 +564,23 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
if (isrezzexp) { if (isrezzexp) {
if (RuleI(Character, ShowExpValues) > 0) 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()); Message(Chat::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); else Message_StringID(Chat::Experience, REZ_REGAIN);
} else { } else {
if (membercount > 1) { if (membercount > 1) {
if (RuleI(Character, ShowExpValues) > 0) 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()); Message(Chat::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); else Message_StringID(Chat::Experience, GAIN_GROUPXP);
} }
else if (IsRaidGrouped()) { else if (IsRaidGrouped()) {
if (RuleI(Character, ShowExpValues) > 0) 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()); Message(Chat::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); else Message_StringID(Chat::Experience, GAIN_RAIDEXP);
} }
else { else {
if (RuleI(Character, ShowExpValues) > 0) if (RuleI(Character, ShowExpValues) > 0)
Message(MT_Experience, "You have gained %s experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str()); Message(Chat::Experience, "You have gained %s experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str());
else Message_StringID(MT_Experience, GAIN_XP); 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; uint32 exp_lost = m_pp.exp - set_exp;
float exp_percent = (float)((float)exp_lost / (float)(GetEXPForLevel(GetLevel() + 1) - GetEXPForLevel(GetLevel())))*(float)100; 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); 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(15, "You have lost %i experience. (%.3f%%)", exp_lost, exp_percent); else if (RuleI(Character, ShowExpValues) == 2 && exp_lost > 0) Message(Chat::Yellow, "You have lost %i experience. (%.3f%%)", exp_lost, exp_percent);
else Message(15, "You have lost experience."); else Message(Chat::Yellow, "You have lost experience.");
} }
//check_level represents the level we should be when we have //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 //figure out how many points were actually gained
/*uint32 gained = m_pp.aapoints - last_unspentAA;*/ //unused /*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}; 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 */ /* QS: PlayerLogAARate */
if (RuleB(QueryServ, 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()); 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; 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_increase)
{ {
if (level_count == 1) 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 else
Message(15, "Welcome to level %i!", check_level); Message(Chat::Yellow, "Welcome to level %i!", check_level);
if (check_level == RuleI(Character, DeathItemLossLevel)) 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)) if (check_level == RuleI(Character, DeathExpLossLevel))
Message_StringID(15, CORPSE_EXP_LOST); Message_StringID(Chat::Yellow, CORPSE_EXP_LOST);
} }
else else
Message_StringID(MT_Experience, LOSE_LEVEL, ConvertArray(check_level, val1)); Message_StringID(Chat::Experience, LOSE_LEVEL, ConvertArray(check_level, val1));
#ifdef BOTS #ifdef BOTS
uint8 myoldlevel = GetLevel(); uint8 myoldlevel = GetLevel();
@ -758,7 +758,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
char val1[20]={0}; char val1[20]={0};
char val2[20]={0}; char val2[20]={0};
char val3[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; m_pp.level = set_level;
if (command){ if (command){
m_pp.exp = GetEXPForLevel(set_level); 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; lu->exp = 0;
} }
else { else {
@ -1077,12 +1077,12 @@ void Client::SetLeadershipEXP(uint32 group_exp, uint32 raid_exp) {
while(group_exp >= GROUP_EXP_PER_POINT) { while(group_exp >= GROUP_EXP_PER_POINT) {
group_exp -= GROUP_EXP_PER_POINT; group_exp -= GROUP_EXP_PER_POINT;
m_pp.group_leadership_points++; 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) { while(raid_exp >= RAID_EXP_PER_POINT) {
raid_exp -= RAID_EXP_PER_POINT; raid_exp -= RAID_EXP_PER_POINT;
m_pp.raid_leadership_points++; 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; m_pp.group_leadership_exp = group_exp;

View File

@ -161,14 +161,14 @@ bool Client::CanFish() {
if (!Pole || !Pole->IsClassCommon() || Pole->GetItem()->ItemType != EQEmu::item::ItemTypeFishingPole) { 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 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 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; return false;
} }
if (!Bait || !Bait->IsClassCommon() || Bait->GetItem()->ItemType != EQEmu::item::ItemTypeFishingBait) { 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; return false;
} }
@ -190,7 +190,7 @@ bool Client::CanFish() {
float bestz = zone->zonemap->FindBestZ(rodPosition, nullptr); float bestz = zone->zonemap->FindBestZ(rodPosition, nullptr);
float len = m_Position.z - bestz; float len = m_Position.z - bestz;
if(len > LineLength || len < 0.0f) { if(len > LineLength || len < 0.0f) {
Message_StringID(MT_Skills, FISHING_LAND); Message_StringID(Chat::Skills, FISHING_LAND);
return false; return false;
} }
@ -203,7 +203,7 @@ bool Client::CanFish() {
bool in_water = zone->watermap->InWater(dest) || zone->watermap->InVWater(dest); bool in_water = zone->watermap->InWater(dest) || zone->watermap->InVWater(dest);
if (in_lava) { 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; return false;
} }
@ -212,7 +212,7 @@ bool Client::CanFish() {
} }
} }
Message_StringID(MT_Skills, FISHING_LAND); Message_StringID(Chat::Skills, FISHING_LAND);
return false; return false;
} }
return true; return true;
@ -223,7 +223,7 @@ void Client::GoFish()
//TODO: generate a message if we're already fishing //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' /*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; return;
}*/ }*/
@ -293,12 +293,12 @@ void Client::GoFish()
entity_list.AddNPC(npc); entity_list.AddNPC(npc);
Message(MT_Emote, Message(Chat::Emote,
"You fish up a little more than you bargained for..."); "You fish up a little more than you bargained for...");
} }
} }
else { 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); const EQEmu::ItemData* food_item = database.GetItem(food_id);
if (food_item->ItemType != EQEmu::item::ItemTypeFood) { if (food_item->ItemType != EQEmu::item::ItemTypeFood) {
Message_StringID(MT_Skills, FISHING_SUCCESS); Message_StringID(Chat::Skills, FISHING_SUCCESS);
} }
else { 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); EQEmu::ItemInstance* inst = database.CreateItem(food_item, 1);
if(inst != nullptr) { if(inst != nullptr) {
if(CheckLoreConflict(inst->GetItem())) if(CheckLoreConflict(inst->GetItem()))
{ {
Message_StringID(0, DUP_LORE); Message_StringID(Chat::White, DUP_LORE);
safe_delete(inst); safe_delete(inst);
} }
else else
@ -351,13 +351,13 @@ void Client::GoFish()
//chance to use bait when you dont catch anything... //chance to use bait when you dont catch anything...
if (zone->random.Int(0, 4) == 1) { if (zone->random.Int(0, 4) == 1) {
DeleteItemInInventory(bslot, 1, true); //do we need client update? 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 { } 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 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 //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 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); parse->EventPlayer(EVENT_FISH_FAILURE, this, "", 0);
@ -367,7 +367,7 @@ void Client::GoFish()
//this is potentially exploitable in that they can fish //this is potentially exploitable in that they can fish
//and then swap out items in primary slot... too lazy to fix right now //and then swap out items in primary slot... too lazy to fix right now
if (zone->random.Int(0, 49) == 1) { 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); DeleteItemInInventory(EQEmu::invslot::slotPrimary, 0, true);
} }
@ -434,13 +434,13 @@ void Client::ForageItem(bool guarantee) {
break; break;
} }
Message_StringID(MT_Skills, stringid); Message_StringID(Chat::Skills, stringid);
EQEmu::ItemInstance* inst = database.CreateItem(food_item, 1); EQEmu::ItemInstance* inst = database.CreateItem(food_item, 1);
if(inst != nullptr) { if(inst != nullptr) {
// check to make sure it isn't a foraged lore item // check to make sure it isn't a foraged lore item
if(CheckLoreConflict(inst->GetItem())) if(CheckLoreConflict(inst->GetItem()))
{ {
Message_StringID(0, DUP_LORE); Message_StringID(Chat::White, DUP_LORE);
safe_delete(inst); safe_delete(inst);
} }
else { else {
@ -462,12 +462,12 @@ void Client::ForageItem(bool guarantee) {
int ChanceSecondForage = aabonuses.ForageAdditionalItems + itembonuses.ForageAdditionalItems + spellbonuses.ForageAdditionalItems; int ChanceSecondForage = aabonuses.ForageAdditionalItems + itembonuses.ForageAdditionalItems + spellbonuses.ForageAdditionalItems;
if(!guarantee && zone->random.Roll(ChanceSecondForage)) { if(!guarantee && zone->random.Roll(ChanceSecondForage)) {
Message_StringID(MT_Skills, FORAGE_MASTERY); Message_StringID(Chat::Skills, FORAGE_MASTERY);
ForageItem(true); ForageItem(true);
} }
} else { } else {
Message_StringID(MT_Skills, FORAGE_FAILED); Message_StringID(Chat::Skills, FORAGE_FAILED);
parse->EventPlayer(EVENT_FORAGE_FAILURE, this, "", 0); parse->EventPlayer(EVENT_FORAGE_FAILURE, this, "", 0);
} }

View File

@ -1391,7 +1391,7 @@ bool GuildApproval::ProcessApproval()
{ {
if(owner && owner->GuildID() != 0) 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; return false;
} }
if(deletion_timer->Check() || !owner) if(deletion_timer->Check() || !owner)

View File

@ -118,7 +118,7 @@ const NPCType *Horse::BuildHorseType(uint16 spell_id) {
void Client::SummonHorse(uint16 spell_id) { void Client::SummonHorse(uint16 spell_id) {
if (GetHorseId() != 0) { 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; return;
} }
if(!Horse::IsHorseSpell(spell_id)) { if(!Horse::IsHorseSpell(spell_id)) {

View File

@ -185,7 +185,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
// make sure the item exists // make sure the item exists
if(item == nullptr) { 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", 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); 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 // check that there is not a lore conflict between base item and existing inventory
else if(CheckLoreConflict(item)) { else if(CheckLoreConflict(item)) {
// DuplicateLoreMessage(item_id); // 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; return false;
} }
// check to make sure we are augmenting an augmentable item // check to make sure we are augmenting an augmentable item
else if (((!item->IsClassCommon()) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5 | aug6)) { 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", 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); 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 // 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)))) { 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", 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); 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(augtest == nullptr) {
if(augments[iter]) { 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", 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); 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 // check that there is not a lore conflict between augment and existing inventory
if(CheckLoreConflict(augtest)) { if(CheckLoreConflict(augtest)) {
// DuplicateLoreMessage(augtest->ID); // 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; return false;
} }
// check that augment is an actual augment // check that augment is an actual augment
else if(augtest->AugType == 0) { 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", 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); 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 // 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)))) { 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", 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); 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 // check for augment type allowance
if(enforcewear) { if(enforcewear) {
if ((item->AugSlotType[iter] == EQEmu::item::AugTypeNone) || !(((uint32)1 << (item->AugSlotType[iter] - 1)) & augtest->AugType)) { 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", 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); 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) { 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", 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); 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) { 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", 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); 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) { if(enforceusable) {
// check for class usability // check for class usability
if(item->Classes && !(classes &= augtest->Classes)) { 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", 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); 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 // check for race usability
if(item->Races && !(races &= augtest->Races)) { 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", 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); 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 // check for slot usability
if(item->Slots && !(slots &= augtest->Slots)) { 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", 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); 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); EQEmu::ItemInstance* inst = database.CreateItem(item, charges);
if(inst == nullptr) { 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 // 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", 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); GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
@ -652,7 +652,7 @@ void Client::DropItem(int16 slot_id, bool recurse)
} else { } else {
// Item doesn't exist in inventory! // Item doesn't exist in inventory!
Log(Logs::General, Logs::Inventory, "DropItem() - No item found in slot %i", slot_id); 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; return;
} }
@ -752,14 +752,14 @@ void Client::DropInst(const EQEmu::ItemInstance* inst)
{ {
if (!inst) { if (!inst) {
// Item doesn't exist in inventory! // Item doesn't exist in inventory!
Message(13, "Error: Item not found"); Message(Chat::Red, "Error: Item not found");
return; return;
} }
if (inst->GetItem()->NoDrop == 0) if (inst->GetItem()->NoDrop == 0)
{ {
Message(13, "This item is NODROP. Deleting."); Message(Chat::Red, "This item is NODROP. Deleting.");
return; return;
} }
@ -853,7 +853,7 @@ void Client::SendCursorBuffer()
if (!lore_pass) { if (!lore_pass) {
Log(Logs::General, Logs::Inventory, "(%s) Duplicate lore items are not allowed - destroying item %s(id:%u) on cursor", 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); 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); parse->EventItem(EVENT_DESTROY_ITEM, this, test_inst, nullptr, "", 0);
DeleteItemInInventory(EQEmu::invslot::slotCursor); DeleteItemInInventory(EQEmu::invslot::slotCursor);
SendCursorBuffer(); SendCursorBuffer();
@ -1520,7 +1520,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
if(!IsValidSlot(src_slot_check)){ if(!IsValidSlot(src_slot_check)){
// SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason. // SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason.
if(src_slot_check < 2147483647) 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); 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; return false;
} }
@ -1528,7 +1528,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
if(!IsValidSlot(dst_slot_check)) { if(!IsValidSlot(dst_slot_check)) {
// SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason. // SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason.
if(src_slot_check < 2147483647) 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); 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; return false;
} }
@ -1555,7 +1555,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
if (!lore_pass) { if (!lore_pass) {
Log(Logs::General, Logs::Inventory, "(%s) Duplicate lore items are not allowed - destroying item %s(id:%u) on cursor", 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); 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); parse->EventItem(EVENT_DESTROY_ITEM, this, test_inst, nullptr, "", 0);
DeleteItemInInventory(EQEmu::invslot::slotCursor, 0, true); DeleteItemInInventory(EQEmu::invslot::slotCursor, 0, true);
} }
@ -1624,7 +1624,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
//SetTint(dst_slot_id,src_inst->GetColor()); //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)) 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; return false;
} }
} }
@ -1650,7 +1650,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
} }
if (srcitemid==17899 || srcbagid==17899 || dstitemid==17899 || dstbagid==17899){ if (srcitemid==17899 || srcbagid==17899 || dstitemid==17899 || dstbagid==17899){
this->Trader_EndTrader(); 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()); 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 // Fill Trade list with items from cursor
if (!m_inv[EQEmu::invslot::slotCursor]) { 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; return false;
} }
@ -1939,7 +1939,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
fail_message = "You are not sufficient level to use this item."; fail_message = "You are not sufficient level to use this item.";
if (fail_message) if (fail_message)
Message(CC_Red, "%s", fail_message); Message(Chat::Red, "%s", fail_message);
return false; return false;
} }
@ -2008,7 +2008,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
// resync the 'from' and 'to' slots on an as-needed basis // resync the 'from' and 'to' slots on an as-needed basis
// Not as effective as the full process, but less intrusive to gameplay // 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); 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) { 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); 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(outapp);
} }
safe_delete(token_inst); 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 { else {
int16 resync_slot = (EQEmu::InventoryProfile::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : EQEmu::InventoryProfile::CalcSlotId(move_slots->from_slot); 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); SendItemPacket(resync_slot, m_inv[resync_slot], ItemPacketTrade);
safe_delete(token_inst); 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) { 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(outapp);
} }
safe_delete(token_inst); 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 { else {
int16 resync_slot = (EQEmu::InventoryProfile::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : EQEmu::InventoryProfile::CalcSlotId(move_slots->to_slot); 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); SendItemPacket(resync_slot, m_inv[resync_slot], ItemPacketTrade);
safe_delete(token_inst); 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); SendWearChange(i);
} }
else{ else{
Message(13,"Could not locate A Vial of Prismatic Dye."); Message(Chat::Red,"Could not locate A Vial of Prismatic Dye.");
return; return;
} }
} }
@ -3406,9 +3406,9 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
} }
if (error) { if (error) {
Message(13, "An error has been discovered in your inventory!"); Message(Chat::Red, "An error has been discovered in your inventory!");
Message(13, "Do not log out, zone or re-arrange items until this"); Message(Chat::Red, "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, "issue has been resolved or item loss may occur!");
if (allowtrip) if (allowtrip)
TripInterrogateInvState(); 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()); head, depth, i.c_str(), p.c_str(), e.c_str());
} }
if (!silent) { 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()); head, depth, i.c_str(), p.c_str(), e.c_str());
} }

View File

@ -2234,92 +2234,92 @@ luabind::scope lua_register_message_types() {
return luabind::class_<MessageTypes>("MT") return luabind::class_<MessageTypes>("MT")
.enum_("constants") .enum_("constants")
[ [
luabind::value("NPCQuestSay", MT_NPCQuestSay), luabind::value("NPCQuestSay", Chat::NPCQuestSay),
luabind::value("Say", MT_Say), luabind::value("Say", Chat::Say),
luabind::value("Tell", MT_Tell), luabind::value("Tell", Chat::Tell),
luabind::value("Group", MT_Group), luabind::value("Group", Chat::Group),
luabind::value("Guild", MT_Guild), luabind::value("Guild", Chat::Guild),
luabind::value("OOC", MT_OOC), luabind::value("OOC", Chat::OOC),
luabind::value("Auction", MT_Auction), luabind::value("Auction", Chat::Auction),
luabind::value("Shout", MT_Shout), luabind::value("Shout", Chat::Shout),
luabind::value("Emote", MT_Emote), luabind::value("Emote", Chat::Emote),
luabind::value("Spells", MT_Spells), luabind::value("Spells", Chat::Spells),
luabind::value("YouHitOther", MT_YouHitOther), luabind::value("YouHitOther", Chat::YouHitOther),
luabind::value("OtherHitsYou", MT_OtherHitsYou), luabind::value("OtherHitsYou", Chat::OtherHitYou),
luabind::value("YouMissOther", MT_YouMissOther), luabind::value("YouMissOther", Chat::YouMissOther),
luabind::value("OtherMissesYou", MT_OtherMissesYou), luabind::value("OtherMissesYou", Chat::OtherMissYou),
luabind::value("Broadcasts", MT_Broadcasts), luabind::value("Broadcasts", Chat::Broadcasts),
luabind::value("Skills", MT_Skills), luabind::value("Skills", Chat::Skills),
luabind::value("Disciplines", MT_Disciplines), luabind::value("Disciplines", Chat::Disciplines),
luabind::value("Unused1", MT_Unused1), luabind::value("Unused1", Chat::Unused1),
luabind::value("DefaultText", MT_DefaultText), luabind::value("DefaultText", Chat::DefaultText),
luabind::value("Unused2", MT_Unused2), luabind::value("Unused2", Chat::Unused2),
luabind::value("MerchantOffer", MT_MerchantOffer), luabind::value("MerchantOffer", Chat::MerchantOffer),
luabind::value("MerchantBuySell", MT_MerchantBuySell), luabind::value("MerchantBuySell", Chat::MerchantExchange),
luabind::value("YourDeath", MT_YourDeath), luabind::value("YourDeath", Chat::YourDeath),
luabind::value("OtherDeath", MT_OtherDeath), luabind::value("OtherDeath", Chat::OtherDeath),
luabind::value("OtherHits", MT_OtherHits), luabind::value("OtherHits", Chat::OtherHitOther),
luabind::value("OtherMisses", MT_OtherMisses), luabind::value("OtherMisses", Chat::OtherMissOther),
luabind::value("Who", MT_Who), luabind::value("Who", Chat::Who),
luabind::value("YellForHelp", MT_YellForHelp), luabind::value("YellForHelp", Chat::YellForHelp),
luabind::value("NonMelee", MT_NonMelee), luabind::value("NonMelee", Chat::NonMelee),
luabind::value("WornOff", MT_WornOff), luabind::value("WornOff", Chat::SpellWornOff),
luabind::value("MoneySplit", MT_MoneySplit), luabind::value("MoneySplit", Chat::MoneySplit),
luabind::value("LootMessages", MT_LootMessages), luabind::value("LootMessages", Chat::Loot),
luabind::value("DiceRoll", MT_DiceRoll), luabind::value("DiceRoll", Chat::DiceRoll),
luabind::value("OtherSpells", MT_OtherSpells), luabind::value("OtherSpells", Chat::OtherSpells),
luabind::value("SpellFailure", MT_SpellFailure), luabind::value("SpellFailure", Chat::SpellFailure),
luabind::value("Chat", MT_Chat), luabind::value("Chat", Chat::ChatChannel),
luabind::value("Channel1", MT_Channel1), luabind::value("Channel1", Chat::Chat1),
luabind::value("Channel2", MT_Channel2), luabind::value("Channel2", Chat::Chat2),
luabind::value("Channel3", MT_Channel3), luabind::value("Channel3", Chat::Chat3),
luabind::value("Channel4", MT_Channel4), luabind::value("Channel4", Chat::Chat4),
luabind::value("Channel5", MT_Channel5), luabind::value("Channel5", Chat::Chat5),
luabind::value("Channel6", MT_Channel6), luabind::value("Channel6", Chat::Chat6),
luabind::value("Channel7", MT_Channel7), luabind::value("Channel7", Chat::Chat7),
luabind::value("Channel8", MT_Channel8), luabind::value("Channel8", Chat::Chat8),
luabind::value("Channel9", MT_Channel9), luabind::value("Channel9", Chat::Chat9),
luabind::value("Channel10", MT_Channel10), luabind::value("Channel10", Chat::Chat10),
luabind::value("CritMelee", MT_CritMelee), luabind::value("CritMelee", Chat::MeleeCrit),
luabind::value("SpellCrits", MT_SpellCrits), luabind::value("SpellCrits", Chat::SpellCrit),
luabind::value("TooFarAway", MT_TooFarAway), luabind::value("TooFarAway", Chat::TooFarAway),
luabind::value("NPCRampage", MT_NPCRampage), luabind::value("NPCRampage", Chat::NPCRampage),
luabind::value("NPCFlurry", MT_NPCFlurry), luabind::value("NPCFlurry", Chat::NPCFlurry),
luabind::value("NPCEnrage", MT_NPCEnrage), luabind::value("NPCEnrage", Chat::NPCEnrage),
luabind::value("SayEcho", MT_SayEcho), luabind::value("SayEcho", Chat::EchoSay),
luabind::value("TellEcho", MT_TellEcho), luabind::value("TellEcho", Chat::EchoTell),
luabind::value("GroupEcho", MT_GroupEcho), luabind::value("GroupEcho", Chat::EchoGroup),
luabind::value("GuildEcho", MT_GuildEcho), luabind::value("GuildEcho", Chat::EchoGuild),
luabind::value("OOCEcho", MT_OOCEcho), luabind::value("OOCEcho", Chat::EchoOOC),
luabind::value("AuctionEcho", MT_AuctionEcho), luabind::value("AuctionEcho", Chat::EchoAuction),
luabind::value("ShoutECho", MT_ShoutECho), luabind::value("ShoutECho", Chat::EchoShout),
luabind::value("EmoteEcho", MT_EmoteEcho), luabind::value("EmoteEcho", Chat::EchoEmote),
luabind::value("Chat1Echo", MT_Chat1Echo), luabind::value("Chat1Echo", Chat::EchoChat1),
luabind::value("Chat2Echo", MT_Chat2Echo), luabind::value("Chat2Echo", Chat::EchoChat2),
luabind::value("Chat3Echo", MT_Chat3Echo), luabind::value("Chat3Echo", Chat::EchoChat3),
luabind::value("Chat4Echo", MT_Chat4Echo), luabind::value("Chat4Echo", Chat::EchoChat4),
luabind::value("Chat5Echo", MT_Chat5Echo), luabind::value("Chat5Echo", Chat::EchoChat5),
luabind::value("Chat6Echo", MT_Chat6Echo), luabind::value("Chat6Echo", Chat::EchoChat6),
luabind::value("Chat7Echo", MT_Chat7Echo), luabind::value("Chat7Echo", Chat::EchoChat7),
luabind::value("Chat8Echo", MT_Chat8Echo), luabind::value("Chat8Echo", Chat::EchoChat8),
luabind::value("Chat9Echo", MT_Chat9Echo), luabind::value("Chat9Echo", Chat::EchoChat9),
luabind::value("Chat10Echo", MT_Chat10Echo), luabind::value("Chat10Echo", Chat::EchoChat10),
luabind::value("DoTDamage", MT_DoTDamage), luabind::value("DoTDamage", Chat::DotDamage),
luabind::value("ItemLink", MT_ItemLink), luabind::value("ItemLink", Chat::ItemLink),
luabind::value("RaidSay", MT_RaidSay), luabind::value("RaidSay", Chat::RaidSay),
luabind::value("MyPet", MT_MyPet), luabind::value("MyPet", Chat::MyPet),
luabind::value("DS", MT_DS), luabind::value("DS", Chat::DamageShield),
luabind::value("Leadership", MT_Leadership), luabind::value("Leadership", Chat::LeaderShip),
luabind::value("PetFlurry", MT_PetFlurry), luabind::value("PetFlurry", Chat::PetFlurry),
luabind::value("PetCrit", MT_PetCrit), luabind::value("PetCrit", Chat::PetCritical),
luabind::value("FocusEffect", MT_FocusEffect), luabind::value("FocusEffect", Chat::FocusEffect),
luabind::value("Experience", MT_Experience), luabind::value("Experience", Chat::Experience),
luabind::value("System", MT_System), luabind::value("System", Chat::System),
luabind::value("PetSpell", MT_PetSpell), luabind::value("PetSpell", Chat::PetSpell),
luabind::value("PetResponse", MT_PetResponse), luabind::value("PetResponse", Chat::PetResponse),
luabind::value("ItemSpeech", MT_ItemSpeech), luabind::value("ItemSpeech", Chat::ItemSpeech),
luabind::value("StrikeThrough", MT_StrikeThrough), luabind::value("StrikeThrough", Chat::StrikeThrough),
luabind::value("Stun", MT_Stun) luabind::value("Stun", Chat::Stun)
]; ];
} }

View File

@ -764,7 +764,7 @@ void Lua_Mob::QuestSay(Lua_Client client, const char *message) {
journal_opts.speak_mode = Journal::SpeakMode::Say; journal_opts.speak_mode = Journal::SpeakMode::Say;
journal_opts.journal_mode = RuleB(NPC, EnableNPCQuestJournal) ? Journal::Mode::Log2 : Journal::Mode::None; journal_opts.journal_mode = RuleB(NPC, EnableNPCQuestJournal) ? Journal::Mode::Log2 : Journal::Mode::None;
journal_opts.language = 0; journal_opts.language = 0;
journal_opts.message_type = MT_NPCQuestSay; journal_opts.message_type = Chat::NPCQuestSay;
journal_opts.target_spawn_id = 0; journal_opts.target_spawn_id = 0;
self->QuestJournalledSay(client, message, journal_opts); 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.speak_mode = Journal::SpeakMode::Say;
journal_opts.journal_mode = Journal::Mode::Log2; journal_opts.journal_mode = Journal::Mode::Log2;
journal_opts.language = 0; journal_opts.language = 0;
journal_opts.message_type = MT_NPCQuestSay; journal_opts.message_type = Chat::NPCQuestSay;
journal_opts.target_spawn_id = 0; journal_opts.target_spawn_id = 0;
if (luabind::type(opts) == LUA_TTABLE) { if (luabind::type(opts) == LUA_TTABLE) {

View File

@ -1618,7 +1618,7 @@ void Merc::AI_Process() {
{ {
if(zone->random.Roll(flurrychance)) 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);
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); realTotal = CalcFocusEffect(type, UsedFocusID, spell_id);
if (realTotal != 0 && UsedItem) 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. //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()); Log(Logs::General, Logs::Mercenaries, "UpdateMercTimer Complete for %s.", GetName());
// Normal upkeep charge message // 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 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));
} }
} }
} }

View File

@ -2709,7 +2709,7 @@ bool Mob::HateSummon() {
if(target) if(target)
{ {
if(summon_level == 1) { 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()) if (target->IsClient())
target->CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), m_Position.x, m_Position.y, m_Position.z, target->GetHeading(), 0, SummonPC); 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; return true;
} else if(summon_level == 2) { } 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()); 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); 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) 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); vsnprintf(buf, 1000, format, ap);
va_end(ap); va_end(ap);
entity_list.Message_StringID(this, false, MT_Shout, entity_list.Message_StringID(this, false, Chat::Shout,
GENERIC_SHOUT, GetCleanName(), buf); GENERIC_SHOUT, GetCleanName(), buf);
} }
@ -3569,7 +3569,7 @@ void Mob::TryTwincast(Mob *caster, Mob *target, uint32 spell_id)
{ {
if(zone->random.Roll(focus)) 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); 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() && caster && caster->IsClient())
{ {
if ((GetSlowMitigation() > 0) && (GetSlowMitigation() < 26)) 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)) 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)) 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) else if (GetSlowMitigation() > 100)
caster->Message_StringID(MT_SpellFailure, SPELL_OPPOSITE_EFFECT); caster->Message_StringID(Chat::SpellFailure, SPELL_OPPOSITE_EFFECT);
} }
} }

View File

@ -578,7 +578,7 @@ void NPC::AI_Stop() {
void Client::AI_Stop() { void Client::AI_Stop() {
Mob::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)); auto app = new EQApplicationPacket(OP_Charm, sizeof(Charm_Struct));
Charm_Struct *ps = (Charm_Struct*)app->pBuffer; Charm_Struct *ps = (Charm_Struct*)app->pBuffer;
@ -1667,9 +1667,9 @@ void NPC::AI_DoMovement() {
pause_timer_complete = true; pause_timer_complete = true;
AI_walking_timer->Disable(); AI_walking_timer->Disable();
} }
int32 gridno = CastToNPC()->GetGrid(); int32 gridno = CastToNPC()->GetGrid();
if (gridno > 0 || cur_wp == EQEmu::WaypointStatus::QuestControlNoGrid) { if (gridno > 0 || cur_wp == EQEmu::WaypointStatus::QuestControlNoGrid) {
if (pause_timer_complete == true) { // time to pause at wp is over if (pause_timer_complete == true) { // time to pause at wp is over
AI_SetupNextWaypoint(); AI_SetupNextWaypoint();
@ -1685,7 +1685,7 @@ void NPC::AI_DoMovement() {
GetY(), GetY(),
GetZ(), GetZ(),
GetGrid()); GetGrid());
SetWaypointPause(); SetWaypointPause();
SetAppearance(eaStanding, false); SetAppearance(eaStanding, false);
if (cur_wp_pause > 0) { 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 :-/ // start the timer. need to call IsEnraged frequently since we dont have callback timers :-/
bEnraged = true; 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(){ void Mob::ProcessEnrage(){
if(IsEnraged()){ if(IsEnraged()){
Timer *timer = GetSpecialAbilityTimer(SPECATK_ENRAGE); Timer *timer = GetSpecialAbilityTimer(SPECATK_ENRAGE);
if(timer && timer->Check()){ 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); int enraged_cooldown = GetSpecialAbilityParam(SPECATK_ENRAGE, 2);
enraged_cooldown = enraged_cooldown > 0 ? enraged_cooldown : EnragedTimer; enraged_cooldown = enraged_cooldown > 0 ? enraged_cooldown : EnragedTimer;
@ -2057,9 +2057,9 @@ bool Mob::Flurry(ExtraAttackOptions *opts)
Mob *target = GetTarget(); Mob *target = GetTarget();
if (target) { if (target) {
if (!IsPet()) { 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 { } 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); int num_attacks = GetSpecialAbilityParam(SPECATK_FLURRY, 1);
@ -2096,9 +2096,9 @@ bool Mob::Rampage(ExtraAttackOptions *opts)
{ {
int index_hit = 0; int index_hit = 0;
if (!IsPet()) 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 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); int rampage_targets = GetSpecialAbilityParam(SPECATK_RAMPAGE, 1);
if (rampage_targets == 0) // if set to 0 or not set in the DB 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; int index_hit = 0;
if (!IsPet()) { // do not know every pet AA so thought it safer to add this 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 { } 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); int rampage_targets = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 1);

View File

@ -835,27 +835,27 @@ void MobMovementManager::DumpStats(Client *client)
auto current_time = static_cast<double>(Timer::GetCurrentTime()) / 1000.0; auto current_time = static_cast<double>(Timer::GetCurrentTime()) / 1000.0;
auto total_time = current_time - _impl->Stats.LastResetTime; auto total_time = current_time - _impl->Stats.LastResetTime;
client->Message(MT_System, "Dumping Movement Stats:"); client->Message(Chat::System, "Dumping Movement Stats:");
client->Message( client->Message(
MT_System, Chat::System,
"Total Sent: %u (%.2f / sec)", "Total Sent: %u (%.2f / sec)",
_impl->Stats.TotalSent, _impl->Stats.TotalSent,
static_cast<double>(_impl->Stats.TotalSent) / total_time static_cast<double>(_impl->Stats.TotalSent) / total_time
); );
client->Message( client->Message(
MT_System, Chat::System,
"Total Heading: %u (%.2f / sec)", "Total Heading: %u (%.2f / sec)",
_impl->Stats.TotalSentHeading, _impl->Stats.TotalSentHeading,
static_cast<double>(_impl->Stats.TotalSentHeading) / total_time static_cast<double>(_impl->Stats.TotalSentHeading) / total_time
); );
client->Message( client->Message(
MT_System, Chat::System,
"Total Movement: %u (%.2f / sec)", "Total Movement: %u (%.2f / sec)",
_impl->Stats.TotalSentMovement, _impl->Stats.TotalSentMovement,
static_cast<double>(_impl->Stats.TotalSentMovement) / total_time static_cast<double>(_impl->Stats.TotalSentMovement) / total_time
); );
client->Message( client->Message(
MT_System, Chat::System,
"Total Position: %u (%.2f / sec)", "Total Position: %u (%.2f / sec)",
_impl->Stats.TotalSentPosition, _impl->Stats.TotalSentPosition,
static_cast<double>(_impl->Stats.TotalSentPosition) / total_time static_cast<double>(_impl->Stats.TotalSentPosition) / total_time

View File

@ -1577,7 +1577,7 @@ void NPC::PickPocket(Client* thief)
//make sure were allowed to target them: //make sure were allowed to target them:
int over_level = GetLevel(); int over_level = GetLevel();
if(over_level > (thief->GetLevel() + THIEF_PICKPOCKET_OVER)) { 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); thief->SendPickPocketResponse(this, 0, PickPocketFailed);
//should we check aggro //should we check aggro
return; return;
@ -1587,7 +1587,7 @@ void NPC::PickPocket(Client* thief)
if (zone->CanDoCombat()) if (zone->CanDoCombat())
AddToHateList(thief, 50); AddToHateList(thief, 50);
Say("Stop thief!"); 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); thief->SendPickPocketResponse(this, 0, PickPocketFailed);
return; return;
} }
@ -1744,17 +1744,17 @@ void NPC::Disarm(Client* client, int chance) {
SendWearChange(matslot); SendWearChange(matslot);
if ((CastToMob()->GetBodyType() == BT_Humanoid || CastToMob()->GetBodyType() == BT_Summoned) && eslot == EQEmu::invslot::slotPrimary) if ((CastToMob()->GetBodyType() == BT_Humanoid || CastToMob()->GetBodyType() == BT_Summoned) && eslot == EQEmu::invslot::slotPrimary)
Say("Ahh! My weapon!"); 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) if (chance != 1000)
client->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 4); client->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 4);
return; return;
} }
client->Message_StringID(MT_Skills, DISARM_FAILED); client->Message_StringID(Chat::Skills, DISARM_FAILED);
if (chance != 1000) if (chance != 1000)
client->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 2); client->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 2);
return; 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) { void Mob::NPCSpecialAttacks(const char* parse, int permtag, bool reset, bool remove) {

View File

@ -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 val1[20]={0};
char val2[20]={0}; char val2[20]={0};
uint32 remain = p_timers.GetRemainingTime(pTimerDisciplineReuse); 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); //Message(0,"You can use a new discipline in %i minutes %i seconds.", (disc_timer.GetRemainingTime()/1000)/60, disc_timer.GetRemainingTime()/1000%60);
return; return;
} }

View File

@ -50,7 +50,7 @@ void Client::SendPathPacket(const std::vector<FindPerson_Point> &points) {
auto points = EQEmu::any_cast<std::vector<FindPerson_Point>>(result); auto points = EQEmu::any_cast<std::vector<FindPerson_Point>>(result);
if (points.size() < 2) { if (points.size() < 2) {
if (Admin() > 10) { if (Admin() > 10) {
Message(MT_System, "Too few points"); Message(Chat::System, "Too few points");
} }
EQApplicationPacket outapp(OP_FindPersonReply, 0); EQApplicationPacket outapp(OP_FindPersonReply, 0);
@ -60,7 +60,7 @@ void Client::SendPathPacket(const std::vector<FindPerson_Point> &points) {
if (points.size() > 36) { if (points.size() > 36) {
if (Admin() > 10) { 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); EQApplicationPacket outapp(OP_FindPersonReply, 0);
@ -69,7 +69,7 @@ void Client::SendPathPacket(const std::vector<FindPerson_Point> &points) {
} }
if (Admin() > 10) { 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); int len = sizeof(FindPersonResult_Struct) + (points.size() + 1) * sizeof(FindPerson_Point);

View File

@ -212,7 +212,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
//lookup our pets table record for this type //lookup our pets table record for this type
PetRecord record; PetRecord record;
if(!database.GetPoweredPetEntry(pettype, act_power, &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); Log(Logs::General, Logs::Error, "Unable to find data for pet %s, check pets table.", pettype);
return; 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 //find the NPC data for the specified NPC type
const NPCType *base = database.LoadNPCTypesData(record.npc_type); const NPCType *base = database.LoadNPCTypesData(record.npc_type);
if(base == nullptr) { 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); 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; return;
} }

View File

@ -807,13 +807,13 @@ void QuestManager::changedeity(int diety_id) {
if(initiator->IsClient()) if(initiator->IsClient())
{ {
initiator->SetDeity(diety_id); 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->Save(1);
initiator->Kick("Deity change by QuestManager"); initiator->Kick("Deity change by QuestManager");
} }
else 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()) if(initiator->IsClient())
{ {
initiator->ChangeLastName(name); 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 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; break;
} }
if (spell_id < 0 || spell_id >= SPDAT_RECORDS) { 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; return count;
} }
if (book_slot < 0 || book_slot >= EQEmu::spells::SPELLBOOK_SIZE) { 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; return count;
} }
@ -1008,7 +1008,7 @@ uint16 QuestManager::scribespells(uint8 max_level, uint8 min_level) {
uint16 spell_id_ = (uint16)spell_id; uint16 spell_id_ = (uint16)spell_id;
if ((spell_id_ != spell_id) || (spell_id != 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; return count;
} }
@ -1059,7 +1059,7 @@ uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) {
for( ; spell_id < SPDAT_RECORDS; ++spell_id) { for( ; spell_id < SPDAT_RECORDS; ++spell_id) {
if (spell_id < 0 || spell_id >= SPDAT_RECORDS) { 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; return count;
} }
@ -1077,7 +1077,7 @@ uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) {
uint16 spell_id_ = (uint16)spell_id; uint16 spell_id_ = (uint16)spell_id;
if ((spell_id_ != spell_id) || (spell_id != 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; return count;
} }
@ -1086,7 +1086,7 @@ uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) {
for (uint32 r = 0; r < MAX_PP_DISCIPLINES; r++) { for (uint32 r = 0; r < MAX_PP_DISCIPLINES; r++) {
if (initiator->GetPP().disciplines.values[r] == spell_id_) { 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 break; // continue the 1st loop
} }
else if (initiator->GetPP().disciplines.values[r] == 0) { 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."; tmp += " pieces.";
if (initiator) 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) 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; return false;
} }
@ -2657,13 +2657,13 @@ uint16 QuestManager::CreateInstance(const char *zone, int16 version, uint32 dura
uint16 id = 0; uint16 id = 0;
if(!database.GetUnusedInstanceID(id)) 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; return 0;
} }
if(!database.CreateInstance(id, zone_id, version, duration)) 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 0;
} }
return id; return id;
@ -2776,9 +2776,9 @@ void QuestManager::RemoveFromInstance(uint16 instance_id)
if (initiator) if (initiator)
{ {
if (database.RemoveClientFromInstance(instance_id, initiator->CharacterID())) if (database.RemoveClientFromInstance(instance_id, initiator->CharacterID()))
initiator->Message(MT_Say, "Removed client from instance."); initiator->Message(Chat::Say, "Removed client from instance.");
else 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<uint32> charid_list; std::list<uint32> charid_list;
if (database.RemoveClientsFromInstance(instance_id)) if (database.RemoveClientsFromInstance(instance_id))
initiator->Message(MT_Say, "Removed all players from instance."); initiator->Message(Chat::Say, "Removed all players from instance.");
else else
{ {
database.GetCharactersInInstance(instance_id, charid_list); 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
} }
} }
} }

View File

@ -177,7 +177,7 @@ void Mob::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32
auto fbash = GetFuriousBash(itm->Focus.Effect); auto fbash = GetFuriousBash(itm->Focus.Effect);
hate = hate * (100 + fbash) / 100; hate = hate * (100 + fbash) / 100;
if (fbash) 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; return;
if (!p_timers.Expired(&database, timer, false)) { 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; return;
} }
@ -530,7 +530,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
if(IsClient()) { if(IsClient()) {
const EQEmu::ItemInstance *wpn = CastToClient()->GetInv().GetItem(EQEmu::invslot::slotPrimary); const EQEmu::ItemInstance *wpn = CastToClient()->GetInv().GetItem(EQEmu::invslot::slotPrimary);
if (!wpn || (wpn->GetItem()->ItemType != EQEmu::item::ItemType1HPiercing)){ if (!wpn || (wpn->GetItem()->ItemType != EQEmu::item::ItemType1HPiercing)){
Message_StringID(13, BACKSTAB_WEAPON); Message_StringID(Chat::Red, BACKSTAB_WEAPON);
return; return;
} }
} }
@ -720,11 +720,11 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
float dist = DistanceSquared(m_Position, other->GetPosition()); float dist = DistanceSquared(m_Position, other->GetPosition());
if(dist > range) { if(dist > range) {
Log(Logs::Detail, Logs::Combat, "Ranged attack out of range... client should catch this. (%f > %f).\n", 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; return;
} }
else if(dist < (RuleI(Combat, MinRangedAttackDist)*RuleI(Combat, MinRangedAttackDist))){ 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; return;
} }
@ -1273,11 +1273,11 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
float dist = DistanceSquared(m_Position, other->GetPosition()); float dist = DistanceSquared(m_Position, other->GetPosition());
if(dist > range) { if(dist > range) {
Log(Logs::Detail, Logs::Combat, "Throwing attack out of range... client should catch this. (%f > %f).\n", 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; return;
} }
else if(dist < (RuleI(Combat, MinRangedAttackDist)*RuleI(Combat, MinRangedAttackDist))){ 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; return;
} }
@ -1566,7 +1566,7 @@ void NPC::DoClassAttacks(Mob *target) {
//general stuff, for all classes.... //general stuff, for all classes....
//only gets used when their primary ability get used too //only gets used when their primary ability get used too
if (taunting && HasOwner() && target->IsNPC() && target->GetBodyType() != BT_Undead && taunt_time) { 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); 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. // Support for how taunt worked pre 2000 on LIVE - Can not taunt NPC over your level.
if ((RuleB(Combat, TauntOverLevel) == false) && (level_difference < 0) || if ((RuleB(Combat, TauntOverLevel) == false) && (level_difference < 0) ||
who->GetSpecialAbility(IMMUNE_TAUNT)) { who->GetSpecialAbility(IMMUNE_TAUNT)) {
Message_StringID(MT_SpellFailure, FAILED_TAUNT); Message_StringID(Chat::SpellFailure, FAILED_TAUNT);
return; return;
} }
@ -1955,10 +1955,10 @@ void Mob::Taunt(NPC *who, bool always_succeed, int chance_bonus, bool FromSpell,
if (who->CanTalk()) if (who->CanTalk())
who->Say_StringID(SUCCESSFUL_TAUNT, GetCleanName()); who->Say_StringID(SUCCESSFUL_TAUNT, GetCleanName());
} else { } else {
Message_StringID(MT_SpellFailure, FAILED_TAUNT); Message_StringID(Chat::SpellFailure, FAILED_TAUNT);
} }
} else { } else {
Message_StringID(MT_SpellFailure, FAILED_TAUNT); Message_StringID(Chat::SpellFailure, FAILED_TAUNT);
} }
if (HasSkillProcs()) if (HasSkillProcs())
@ -2003,10 +2003,10 @@ void Mob::InstillDoubt(Mob *who) {
SpellOnTarget(229, who, false, true, -2000); SpellOnTarget(229, who, false, true, -2000);
//is there a success message? //is there a success message?
} else { } else {
Message_StringID(4,NOT_SCARING); Message_StringID(Chat::LightBlue,NOT_SCARING);
//Idea from WR: //Idea from WR:
/* if (target->IsNPC() && zone->random.Int(0,99) < 10 ) { /* 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 //should we actually do this? and the range is completely made up, unconfirmed
entity_list.AEAttack(target, 50); entity_list.AEAttack(target, 50);
}*/ }*/
@ -2033,7 +2033,7 @@ int Mob::TryHeadShot(Mob *defender, EQEmu::skills::SkillType skillInUse)
chance = chance * norm / 100; chance = chance * norm / 100;
chance += aabonuses.HeadShot[0] + spellbonuses.HeadShot[0] + itembonuses.HeadShot[0]; chance += aabonuses.HeadShot[0] + spellbonuses.HeadShot[0] + itembonuses.HeadShot[0];
if (zone->random.Int(1, 1000) <= chance) { 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()); GetName());
return HeadShot_Dmg; 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 (Assassinate_Dmg && Assassinate_Level && (defender->GetLevel() <= Assassinate_Level)) {
if (zone->random.Int(1, 1000) <= chance) { 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()); GetName());
return Assassinate_Dmg; return Assassinate_Dmg;
} }

View File

@ -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(zone->random.Roll(RuleI(Spells, SuccorFailChance))) { //2% Fail chance by default
if(IsClient()) { if(IsClient()) {
CastToClient()->Message_StringID(MT_SpellFailure,SUCCOR_FAIL); CastToClient()->Message_StringID(Chat::SpellFailure,SUCCOR_FAIL);
} }
break; break;
} }
@ -638,11 +638,11 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
CastToClient()->SummonItem(13073, fcharges); CastToClient()->SummonItem(13073, fcharges);
} }
else{ else{
Message(13, "You can only transmute flesh to bone."); Message(Chat::Red, "You can only transmute flesh to bone.");
} }
} }
else{ else{
Message(13, "You can only transmute flesh to bone."); Message(Chat::Red, "You can only transmute flesh to bone.");
} }
} }
break; break;
@ -703,7 +703,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
(caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity)))))) (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity))))))
{ {
if (caster) if (caster)
caster->Message_StringID(MT_SpellFailure, IMMUNE_STUN); caster->Message_StringID(Chat::SpellFailure, IMMUNE_STUN);
} else { } else {
int stun_resist = itembonuses.StunResist+spellbonuses.StunResist; int stun_resist = itembonuses.StunResist+spellbonuses.StunResist;
if (IsClient()) if (IsClient())
@ -718,7 +718,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
Stun(effect_value); Stun(effect_value);
} else { } else {
if (IsClient()) 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); 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) if(ClosestMob)
{ {
Message_StringID(MT_Spells, MessageID); Message_StringID(Chat::Spells, MessageID);
SetHeading(CalculateHeadingToTarget(ClosestMob->GetX(), ClosestMob->GetY())); SetHeading(CalculateHeadingToTarget(ClosestMob->GetX(), ClosestMob->GetY()));
SetTarget(ClosestMob); SetTarget(ClosestMob);
CastToClient()->SendTargetCommand(ClosestMob->GetID()); CastToClient()->SendTargetCommand(ClosestMob->GetID());
SentPositionPacket(0.0f, 0.0f, 0.0f, 0.0f, 0, true); SentPositionPacket(0.0f, 0.0f, 0.0f, 0.0f, 0, true);
} }
else else
Message_StringID(clientMessageError, SENSE_NOTHING); Message_StringID(Chat::Red, SENSE_NOTHING);
} }
} }
break; break;
@ -939,14 +939,14 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
{ {
if(!zone->CanBind()) if(!zone->CanBind())
{ {
Message_StringID(MT_SpellFailure, CANNOT_BIND); Message_StringID(Chat::SpellFailure, CANNOT_BIND);
break; break;
} }
if(!zone->IsCity()) if(!zone->IsCity())
{ {
if(caster != this) if(caster != this)
{ {
Message_StringID(MT_SpellFailure, CANNOT_BIND); Message_StringID(Chat::SpellFailure, CANNOT_BIND);
break; break;
} }
else else
@ -1039,7 +1039,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
if(zone->random.Roll(effect_value)) if(zone->random.Roll(effect_value))
Gate(spells[spell_id].base2[i] - 1); Gate(spells[spell_id].base2[i] - 1);
else if (caster) else if (caster)
caster->Message_StringID(MT_SpellFailure,GATE_FAIL); caster->Message_StringID(Chat::SpellFailure,GATE_FAIL);
} }
break; break;
} }
@ -1051,7 +1051,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
#endif #endif
if(GetSpecialAbility(UNDISPELLABLE)){ if(GetSpecialAbility(UNDISPELLABLE)){
if (caster) 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; break;
} }
@ -1077,7 +1077,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
#endif #endif
if(GetSpecialAbility(UNDISPELLABLE)){ if(GetSpecialAbility(UNDISPELLABLE)){
if (caster) 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; break;
} }
@ -1103,7 +1103,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
#endif #endif
if(GetSpecialAbility(UNDISPELLABLE)){ if(GetSpecialAbility(UNDISPELLABLE)){
if (caster) 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; 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]); snprintf(effect_desc, _EDLEN, "Summon Item: %s (id %d)", itemname, spell.base[i]);
#endif #endif
if (!item) { 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()) { } else if (IsClient()) {
Client *c = CastToClient(); Client *c = CastToClient();
if (c->CheckLoreConflict(item)) { 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 (!SummonedItem || !SummonedItem->IsClassBag()) {
if (caster) 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) { } else if ((slot = SummonedItem->FirstOpenSlot()) == 0xff) {
if (caster) 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()) { } else if (IsClient()) {
if (CastToClient()->CheckLoreConflict(item)) { if (CastToClient()->CheckLoreConflict(item)) {
CastToClient()->DuplicateLoreMessage(spell.base[i]); CastToClient()->DuplicateLoreMessage(spell.base[i]);
@ -1235,7 +1235,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
#endif #endif
if(GetPet()) if(GetPet())
{ {
Message_StringID(MT_Shout, ONLY_ONE_PET); Message_StringID(Chat::Shout, ONLY_ONE_PET);
} }
else else
{ {
@ -1516,7 +1516,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
{ {
WipeHateList(); 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; 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))))) && caster && (!caster->IsNPC() || (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity)))))
{ {
if (caster) if (caster)
caster->Message_StringID(MT_Shout, IMMUNE_STUN); caster->Message_StringID(Chat::Shout, IMMUNE_STUN);
} }
else else
{ {
@ -1644,12 +1644,12 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
{ {
if(caster == this) if(caster == this)
{ {
Message_StringID(MT_Spells, Message_StringID(Chat::Spells,
SENTINEL_TRIG_YOU); SENTINEL_TRIG_YOU);
} }
else else
{ {
caster->Message_StringID(MT_Spells, caster->Message_StringID(Chat::Spells,
SENTINEL_TRIG_OTHER, GetCleanName()); 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); Group* group = entity_list.GetGroupByClient(TargetClient);
if(group) { if(group) {
if(!group->IsGroupMember(TargetClient)) { 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; break;
} }
} }
@ -1770,13 +1770,13 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
if(gid < 11) if(gid < 11)
{ {
if(r->GetGroup(TargetClient->GetName()) != gid) { 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; break;
} }
} }
} else { } else {
if(TargetClient != this->CastToClient()) { 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; break;
} }
} }
@ -1790,26 +1790,26 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
Corpse *corpse = entity_list.GetCorpseByOwner(TargetClient); Corpse *corpse = entity_list.GetCorpseByOwner(TargetClient);
if(corpse) { if(corpse) {
if(TargetClient == this->CastToClient()) if(TargetClient == this->CastToClient())
Message_StringID(4, SUMMONING_CORPSE, TargetClient->CastToMob()->GetCleanName()); Message_StringID(Chat::LightBlue, SUMMONING_CORPSE, TargetClient->CastToMob()->GetCleanName());
else 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); corpse->Summon(CastToClient(), true, true);
} }
else { else {
// No corpse found in the zone // No corpse found in the zone
Message_StringID(4, CORPSE_CANT_SENSE); Message_StringID(Chat::LightBlue, CORPSE_CANT_SENSE);
} }
} }
else if (caster) { else if (caster) {
char level[4]; char level[4];
ConvertArray(effect_value, level); ConvertArray(effect_value, level);
caster->Message_StringID(MT_SpellFailure, caster->Message_StringID(Chat::SpellFailure,
SPELL_LEVEL_REQ, level); SPELL_LEVEL_REQ, level);
} }
} }
else { 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); 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; continue;
if (effect_value >= static_cast<int>(buffs[j].counters)) { if (effect_value >= static_cast<int>(buffs[j].counters)) {
if (caster) { 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); caster->CastOnCurer(buffs[j].spellid);
CastOnCure(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<int>(buffs[j].counters)) if (effect_value >= static_cast<int>(buffs[j].counters))
{ {
if (caster) { 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); caster->CastOnCurer(buffs[j].spellid);
CastOnCure(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<int>(buffs[j].counters)) if (effect_value >= static_cast<int>(buffs[j].counters))
{ {
if (caster) { 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); caster->CastOnCurer(buffs[j].spellid);
CastOnCure(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; continue;
if (effect_value >= static_cast<int>(buffs[j].counters)) { if (effect_value >= static_cast<int>(buffs[j].counters)) {
if (caster) { 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); caster->CastOnCurer(buffs[j].spellid);
CastOnCure(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) if(GetLevel() <= 52)
CastToNPC()->Depop(true); CastToNPC()->Depop(true);
else 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; 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(), CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), caster->GetX(),
caster->GetY(), caster->GetZ(), caster->GetHeading(), 2, caster->GetY(), caster->GetZ(), caster->GetHeading(), 2,
SummonPC); SummonPC);
Message(15, "You have been summoned!"); Message(Chat::Yellow, "You have been summoned!");
entity_list.ClearAggro(this); entity_list.ClearAggro(this);
} else } 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; break;
} }
@ -2725,13 +2725,13 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
case SE_MassGroupBuff:{ case SE_MassGroupBuff:{
SetMGB(true); SetMGB(true);
Message_StringID(MT_Disciplines, MGB_STRING); Message_StringID(Chat::Disciplines, MGB_STRING);
break; break;
} }
case SE_IllusionOther: { case SE_IllusionOther: {
SetProjectIllusion(true); 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; break;
} }
@ -3572,7 +3572,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
if (IsAIControlled()) { if (IsAIControlled()) {
WipeHateList(); 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..."); "clear a moment ago...");
} }
break; break;
@ -3643,7 +3643,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
case SE_Invisibility2: case SE_Invisibility2:
case SE_InvisVsUndead2: { case SE_InvisVsUndead2: {
if (buff.ticsremaining <= 3 && buff.ticsremaining > 1) { if (buff.ticsremaining <= 3 && buff.ticsremaining > 1) {
Message_StringID(MT_Spells, INVIS_BEGIN_BREAK); Message_StringID(Chat::Spells, INVIS_BEGIN_BREAK);
} }
break; break;
} }
@ -4047,7 +4047,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
if(p->IsPet()) if(p->IsPet())
notify = p->GetOwner(); notify = p->GetOwner();
if(p) { 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()); spells[buffs[slot].spellid].name, GetCleanName());
} }
} }
@ -5406,7 +5406,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id)
default: default:
break; 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); Message(263, "The gods have healed you for %i points of damage.", HealAmt);
if(spellbonuses.DeathSave[0] == 2) 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 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(); SendHPUpdate();
BuffFadeBySlot(buffSlot); BuffFadeBySlot(buffSlot);
@ -5847,9 +5847,9 @@ bool Mob::TryDeathSave() {
Message(263, "The gods have healed you for %i points of damage.", HealAmt); Message(263, "The gods have healed you for %i points of damage.", HealAmt);
if(spellbonuses.DeathSave[0] == 2) 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 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(); SendHPUpdate();
BuffFadeBySlot(buffSlot); BuffFadeBySlot(buffSlot);
@ -6802,11 +6802,11 @@ void Client::BreakFeignDeathWhenCastOn(bool IsResisted)
chance *= 2; chance *= 2;
if(chance && (zone->random.Roll(chance))){ 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; return;
} }
SetFeigned(false); SetFeigned(false);
Message_StringID(MT_SpellFailure,FD_CAST_ON); Message_StringID(Chat::SpellFailure,FD_CAST_ON);
} }
} }

View File

@ -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", 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() ); IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced(), IsAmnesiad() );
if(IsSilenced() && !IsDiscipline(spell_id)) if(IsSilenced() && !IsDiscipline(spell_id))
Message_StringID(13, SILENCED_STRING); Message_StringID(Chat::Red, SILENCED_STRING);
if(IsAmnesiad() && IsDiscipline(spell_id)) if(IsAmnesiad() && IsDiscipline(spell_id))
Message_StringID(13, MELEE_SILENCE); Message_StringID(Chat::Red, MELEE_SILENCE);
if(IsClient()) if(IsClient())
CastToClient()->SendSpellBarEnable(spell_id); CastToClient()->SendSpellBarEnable(spell_id);
if(casting_spell_id && IsNPC()) 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 int chance = CastToClient()->GetFocusEffect(focusFcMute, spell_id);//Client only
if (zone->random.Roll(chance)) { if (zone->random.Roll(chance)) {
Message_StringID(13, SILENCED_STRING); Message_StringID(Chat::Red, SILENCED_STRING);
if(IsClient()) if(IsClient())
CastToClient()->SendSpellBarEnable(spell_id); CastToClient()->SendSpellBarEnable(spell_id);
return(false); return(false);
@ -205,7 +205,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
} }
if(IsDetrimentalSpell(spell_id) && !zone->CanDoCombat()){ if(IsDetrimentalSpell(spell_id) && !zone->CanDoCombat()){
Message_StringID(13, SPELL_WOULDNT_HOLD); Message_StringID(Chat::Red, SPELL_WOULDNT_HOLD);
if(IsClient()) if(IsClient())
CastToClient()->SendSpellBarEnable(spell_id); CastToClient()->SendSpellBarEnable(spell_id);
if(casting_spell_id && IsNPC()) 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"); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item with an invalid class");
} }
else { else {
Message_StringID(13, MUST_EQUIP_ITEM); Message_StringID(Chat::Red, MUST_EQUIP_ITEM);
} }
return(false); return(false);
} }
@ -272,11 +272,11 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
if (CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::RoF) if (CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{ {
// Line 181 in eqstr_us.txt was changed in 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 else
{ {
Message_StringID(13, CANNOT_USE_ITEM); Message_StringID(Chat::Red, CANNOT_USE_ITEM);
} }
} }
return(false); 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"); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item without equiping it");
} }
else { else {
Message_StringID(13, MUST_EQUIP_ITEM); Message_StringID(Chat::Red, MUST_EQUIP_ITEM);
} }
return(false); 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 Mob::SetMana(GetMana() - use_mana); // We send StopCasting which will update mana
StopCasting(); StopCasting();
Message_StringID(MT_SpellFailure, fizzle_msg); Message_StringID(Chat::SpellFailure, fizzle_msg);
/* Song Failure Messages */ /**
* Song Failure message
*/
entity_list.FilteredMessageClose_StringID( entity_list.FilteredMessageClose_StringID(
this, /* Sender */ this,
true, /* Skip Sender */ true,
RuleI(Range, SpellMessages), RuleI(Range, SpellMessages),
MT_SpellFailure, /* Type: 289 */ Chat::SpellFailure,
(IsClient() ? FilterPCSpells : FilterNPCSpells), /* FilterType: 8 or 9 depending on client/npc */ (IsClient() ? FilterPCSpells : FilterNPCSpells),
(fizzle_msg == MISS_NOTE ? MISSED_NOTE_OTHER : SPELL_FIZZLE_OTHER), (fizzle_msg == MISS_NOTE ? MISSED_NOTE_OTHER : SPELL_FIZZLE_OTHER),
/* /*
MessageFormat: You miss a note, bringing your song to a close! (if missed note) MessageFormat: 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: A missed note brings %1's song to a close!
MessageFormat: %1's spell fizzles! MessageFormat: %1's spell fizzles!
*/ */
GetName() /* Message1 */ GetName()
); );
TryTriggerOnValueAmount(false, true); 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); Log(Logs::Detail, Logs::Spells, "Spell Error: no target. spell=%d", spell_id);
if(IsClient()) { if(IsClient()) {
//clients produce messages... npcs should not for this case //clients produce messages... npcs should not for this case
Message_StringID(13, SPELL_NEED_TAR); Message_StringID(Chat::Red, SPELL_NEED_TAR);
InterruptSpell(); InterruptSpell();
} else { } else {
InterruptSpell(0, 0, 0); //the 0 args should cause no messages 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); 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()) { if(IsClient()) {
//clients produce messages... npcs should not for this case //clients produce messages... npcs should not for this case
Message_StringID(13, INSUFFICIENT_MANA); Message_StringID(Chat::Red, INSUFFICIENT_MANA);
InterruptSpell(); InterruptSpell();
} else { } else {
InterruptSpell(0, 0, 0); //the 0 args should cause no messages 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) { if (IsClient() && slot == CastingSlot::Item && item_slot != 0xFFFFFFFF) {
auto item = CastToClient()->GetInv().GetItem(item_slot); auto item = CastToClient()->GetInv().GetItem(item_slot);
if (item && item->GetItem()) 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()) { if (!DoCastingChecks()) {
@ -573,28 +575,28 @@ bool Mob::DoCastingChecks()
if (spell_target && spells[spell_id].targettype != ST_Self && !spell_target->CheckSpellLevelRestriction(spell_id)) { 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); Log(Logs::Detail, Logs::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id);
if (!IsBardSong(spell_id)) if (!IsBardSong(spell_id))
Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL); Message_StringID(Chat::SpellFailure, SPELL_TOO_POWERFUL);
return false; return false;
} }
} }
if (spells[spell_id].zonetype == 1 && !zone->CanCastOutdoor()) { if (spells[spell_id].zonetype == 1 && !zone->CanCastOutdoor()) {
Message_StringID(13, CAST_OUTDOORS); Message_StringID(Chat::Red, CAST_OUTDOORS);
return false; return false;
} }
if (IsEffectInSpell(spell_id, SE_Levitate) && !zone->CanLevitate()) { 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; return false;
} }
if(zone->IsSpellBlocked(spell_id, glm::vec3(GetPosition()))) { if(zone->IsSpellBlocked(spell_id, glm::vec3(GetPosition()))) {
const char *msg = zone->GetSpellBlockedMessage(spell_id, glm::vec3(GetPosition())); const char *msg = zone->GetSpellBlockedMessage(spell_id, glm::vec3(GetPosition()));
if (msg) { if (msg) {
Message(13, msg); Message(Chat::Red, msg);
return false; return false;
} else { } else {
Message(13, "You can't cast this spell here."); Message(Chat::Red, "You can't cast this spell here.");
return false; 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 if (GetRawSkill(EQEmu::skills::SkillPercussionInstruments) > 0) // no skill increases if not trained in the instrument
CheckIncreaseSkill(EQEmu::skills::SkillPercussionInstruments, nullptr, -15); CheckIncreaseSkill(EQEmu::skills::SkillPercussionInstruments, nullptr, -15);
else 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 else
CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15); CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15);
@ -688,7 +690,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){
if (GetRawSkill(EQEmu::skills::SkillStringedInstruments) > 0) if (GetRawSkill(EQEmu::skills::SkillStringedInstruments) > 0)
CheckIncreaseSkill(EQEmu::skills::SkillStringedInstruments, nullptr, -15); CheckIncreaseSkill(EQEmu::skills::SkillStringedInstruments, nullptr, -15);
else else
Message_StringID(13,NO_INSTRUMENT_SKILL); Message_StringID(Chat::Red,NO_INSTRUMENT_SKILL);
} }
else else
CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15); CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15);
@ -698,7 +700,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){
if (GetRawSkill(EQEmu::skills::SkillWindInstruments) > 0) if (GetRawSkill(EQEmu::skills::SkillWindInstruments) > 0)
CheckIncreaseSkill(EQEmu::skills::SkillWindInstruments, nullptr, -15); CheckIncreaseSkill(EQEmu::skills::SkillWindInstruments, nullptr, -15);
else else
Message_StringID(13,NO_INSTRUMENT_SKILL); Message_StringID(Chat::Red,NO_INSTRUMENT_SKILL);
} }
else else
CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15); CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15);
@ -708,7 +710,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){
if (GetRawSkill(EQEmu::skills::SkillBrassInstruments) > 0) if (GetRawSkill(EQEmu::skills::SkillBrassInstruments) > 0)
CheckIncreaseSkill(EQEmu::skills::SkillBrassInstruments, nullptr, -15); CheckIncreaseSkill(EQEmu::skills::SkillBrassInstruments, nullptr, -15);
else else
Message_StringID(13,NO_INSTRUMENT_SKILL); Message_StringID(Chat::Red,NO_INSTRUMENT_SKILL);
} }
else else
CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15); 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 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); CastToClient()->ResetAlternateAdvancementTimer(casting_spell_aa_id);
} }
@ -938,7 +940,7 @@ void Mob::StopCasting()
if (IsClient()) { if (IsClient()) {
auto c = CastToClient(); auto c = CastToClient();
if (casting_spell_aa_id) { //Rest AA Timer on failed cast 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); 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(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)) { if(!CastToClient()->GetPTimers().Expired(&database, pTimerSpellStart + spell_id, false)) {
//should we issue a message or send them a spell gem packet? //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); Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: spell reuse timer not expired", spell_id);
StopCasting(); StopCasting();
return; return;
@ -981,7 +983,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
if(itm && itm->GetItem()->RecastDelay > 0) if(itm && itm->GetItem()->RecastDelay > 0)
{ {
if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + itm->GetItem()->RecastType), false)) { 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); Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id);
StopCasting(); StopCasting();
return; return;
@ -1003,7 +1005,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
if(delaytimer) if(delaytimer)
{ {
Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: recast too quickly", spell_id); 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(); InterruptSpell();
return; return;
} }
@ -1013,7 +1015,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
if (casting_spell_id != spell_id) if (casting_spell_id != spell_id)
{ {
Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: already casting", 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(); InterruptSpell();
return; return;
} }
@ -1131,8 +1133,8 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
} }
// if we got here, we regained concentration // if we got here, we regained concentration
regain_conc = true; regain_conc = true;
Message_StringID(MT_Spells,REGAIN_AND_CONTINUE); Message_StringID(Chat::Spells, REGAIN_AND_CONTINUE);
entity_list.MessageClose_StringID(this, true, RuleI(Range, SpellMessages), MT_Spells, OTHER_REGAIN_CAST, this->GetCleanName()); 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: case 13000:
if(itembonuses.percussionMod == 0) { // check for the appropriate instrument type if(itembonuses.percussionMod == 0) { // check for the appropriate instrument type
HasInstrument = false; 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; break;
@ -1176,7 +1178,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
case 13001: case 13001:
if(itembonuses.windMod == 0) { if(itembonuses.windMod == 0) {
HasInstrument = false; HasInstrument = false;
c->Message_StringID(13, SONG_NEEDS_WIND); c->Message_StringID(Chat::Red, SONG_NEEDS_WIND);
} }
break; break;
@ -1184,7 +1186,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
case 13011: case 13011:
if(itembonuses.stringedMod == 0) { if(itembonuses.stringedMod == 0) {
HasInstrument = false; HasInstrument = false;
c->Message_StringID(13, SONG_NEEDS_STRINGS); c->Message_StringID(Chat::Red, SONG_NEEDS_STRINGS);
} }
break; break;
@ -1192,7 +1194,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
case 13012: case 13012:
if(itembonuses.brassMod == 0) { if(itembonuses.brassMod == 0) {
HasInstrument = false; HasInstrument = false;
c->Message_StringID(13, SONG_NEEDS_BRASS); c->Message_StringID(Chat::Red, SONG_NEEDS_BRASS);
} }
break; break;
@ -1220,13 +1222,13 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
{ {
if (!missingreags) if (!missingreags)
{ {
c->Message_StringID(13, MISSING_SPELL_COMP); c->Message_StringID(Chat::Red, MISSING_SPELL_COMP);
missingreags=true; missingreags=true;
} }
const EQEmu::ItemData *item = database.GetItem(component); const EQEmu::ItemData *item = database.GetItem(component);
if(item) { 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); Log(Logs::Detail, Logs::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component);
} }
else { else {
@ -1270,7 +1272,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
} }
else else
{ // some kind of error in the code if this happens { // 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(IsClient() && fromaug && recastdelay > 0)
{ {
if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + recasttype), false)) { 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); Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id);
StopCasting(); StopCasting();
return; return;
@ -1353,7 +1355,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
else else
{ {
Log(Logs::Detail, Logs::Spells, "Item used to cast spell %d was missing from inventory slot %d after casting!", spell_id, inventory_slot); 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(); InterruptSpell();
return; return;
} }
@ -1500,7 +1502,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
targetType = ST_Target; targetType = ST_Target;
if (spell_target && !spell_target->PassCastRestriction(true, spells[spell_id].CastRestriction)){ 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; return false;
} }
@ -1510,7 +1512,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
if (spell_target && if (spell_target &&
((spell_target->IsNPC() && spell_target->IsEngaged()) || ((spell_target->IsNPC() && spell_target->IsEngaged()) ||
(spell_target->IsClient() && spell_target->CastToClient()->GetAggroCount()))) { (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; return false;
} }
} }
@ -1518,9 +1520,9 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
else if (IsBeneficialSpell(spell_id)) { else if (IsBeneficialSpell(spell_id)) {
if ((IsNPC() && IsEngaged()) || (IsClient() && CastToClient()->GetAggroCount())) { if ((IsNPC() && IsEngaged()) || (IsClient() && CastToClient()->GetAggroCount())) {
if (IsDiscipline(spell_id)) if (IsDiscipline(spell_id))
Message_StringID(13, NO_ABILITY_IN_COMBAT); Message_StringID(Chat::Red, NO_ABILITY_IN_COMBAT);
else else
Message_StringID(13, NO_CAST_IN_COMBAT); Message_StringID(Chat::Red, NO_CAST_IN_COMBAT);
return false; return false;
} }
@ -1533,7 +1535,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
if (spell_target && if (spell_target &&
((spell_target->IsNPC() && !spell_target->IsEngaged()) || ((spell_target->IsNPC() && !spell_target->IsEngaged()) ||
(spell_target->IsClient() && !spell_target->CastToClient()->GetAggroCount()))) { (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; return false;
} }
} }
@ -1541,9 +1543,9 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
else if (IsBeneficialSpell(spell_id)) { else if (IsBeneficialSpell(spell_id)) {
if ((IsNPC() && !IsEngaged()) || (IsClient() && !CastToClient()->GetAggroCount())) { if ((IsNPC() && !IsEngaged()) || (IsClient() && !CastToClient()->GetAggroCount())) {
if (IsDiscipline(spell_id)) if (IsDiscipline(spell_id))
Message_StringID(13, NO_ABILITY_OUT_OF_COMBAT); Message_StringID(Chat::Red, NO_ABILITY_OUT_OF_COMBAT);
else else
Message_StringID(13, NO_CAST_OUT_OF_COMBAT); Message_StringID(Chat::Red, NO_CAST_OUT_OF_COMBAT);
return false; return false;
} }
@ -1580,9 +1582,9 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
//invalid target //invalid target
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, mob_body); Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, mob_body);
if(!spell_target) if(!spell_target)
Message_StringID(13,SPELL_NEED_TAR); Message_StringID(Chat::Red,SPELL_NEED_TAR);
else else
Message_StringID(13,CANNOT_AFFECT_NPC); Message_StringID(Chat::Red,CANNOT_AFFECT_NPC);
return false; return false;
} }
CastAction = SingleTarget; CastAction = SingleTarget;
@ -1594,7 +1596,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
{ {
//invalid target //invalid target
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, mob_body); 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; return false;
} }
CastAction = SingleTarget; 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)", Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (summoned pet)",
spell_id, mob_body); spell_id, mob_body);
Message_StringID(13, SPELL_NEED_TAR); Message_StringID(Chat::Red, SPELL_NEED_TAR);
return false; return false;
} }
@ -1633,9 +1635,9 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
//invalid target //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); 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) if(!spell_target)
Message_StringID(13,SPELL_NEED_TAR); Message_StringID(Chat::Red,SPELL_NEED_TAR);
else else
Message_StringID(13,CANNOT_AFFECT_NPC); Message_StringID(Chat::Red,CANNOT_AFFECT_NPC);
return false; return false;
} }
CastAction = SingleTarget; CastAction = SingleTarget;
@ -1650,7 +1652,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
if(!spell_target) if(!spell_target)
{ {
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (ldon object)", spell_id); 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; return false;
} }
else else
@ -1658,14 +1660,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
if(!spell_target->IsNPC()) if(!spell_target->IsNPC())
{ {
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (normal)", spell_id); 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; return false;
} }
if(spell_target->GetClass() != LDON_TREASURE) if(spell_target->GetClass() != LDON_TREASURE)
{ {
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (normal)", spell_id); 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; return false;
} }
} }
@ -1674,7 +1676,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
if(!spell_target) if(!spell_target)
{ {
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (normal)", spell_id); 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 return false; // can't cast these unless we have a target
} }
CastAction = SingleTarget; 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; if(!spell_target) message = SPELL_NEED_TAR;
else if(!spell_target->IsCorpse()) message = ONLY_ON_CORPSES; else if(!spell_target->IsCorpse()) message = ONLY_ON_CORPSES;
else if(!spell_target->IsPlayerCorpse()) message = CORPSE_NOT_VALID; else if(!spell_target->IsPlayerCorpse()) message = CORPSE_NOT_VALID;
Message_StringID(13, message); Message_StringID(Chat::Red, message);
return false; return false;
} }
CastAction = SingleTarget; CastAction = SingleTarget;
@ -1702,7 +1704,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
if(!spell_target) if(!spell_target)
{ {
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (no pet)", spell_id); 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 return false; // can't cast these unless we have a target
} }
CastAction = SingleTarget; CastAction = SingleTarget;
@ -1773,7 +1775,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
if(!spell_target) if(!spell_target)
{ {
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (AOE)", spell_id); 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; return false;
} }
ae_center = spell_target; 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){ 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; return false;
} }
@ -1810,7 +1812,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
if(!spell_target) if(!spell_target)
{ {
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (Group Required: Single Target)", spell_id); 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; 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) 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); 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; return false;
} }
if(group_id_caster != group_id_target) 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); 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; 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( spells[spell_id].zonetype == 1 && !zone->CanCastOutdoor()){
if(IsClient()){ if(IsClient()){
if(!CastToClient()->GetGM()){ if(!CastToClient()->GetGM()){
Message_StringID(13, CAST_OUTDOORS); Message_StringID(Chat::Red, CAST_OUTDOORS);
return false; 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(IsEffectInSpell(spell_id, SE_Levitate) && !zone->CanLevitate()){
if(IsClient()){ if(IsClient()){
if(!CastToClient()->GetGM()){ if(!CastToClient()->GetGM()){
Message(13, "You can't levitate in this zone."); Message(Chat::Red, "You can't levitate in this zone.");
return false; 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()))){ if(zone->IsSpellBlocked(spell_id, glm::vec3(GetPosition()))){
const char *msg = zone->GetSpellBlockedMessage(spell_id, glm::vec3(GetPosition())); const char *msg = zone->GetSpellBlockedMessage(spell_id, glm::vec3(GetPosition()));
if(msg){ if(msg){
Message(13, msg); Message(Chat::Red, msg);
return false; return false;
} }
else{ else{
Message(13, "You can't cast this spell here."); Message(Chat::Red, "You can't cast this spell here.");
return false; 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) 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()); 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; return false;
} }
// check to see if target is a caster mob before performing a mana tap // check to see if target is a caster mob before performing a mana tap
if(spell_target && IsManaTapSpell(spell_id)) { if(spell_target && IsManaTapSpell(spell_id)) {
if(spell_target->GetCasterClass() == 'N') { if(spell_target->GetCasterClass() == 'N') {
Message_StringID(13, TARGET_NO_MANA); Message_StringID(Chat::Red, TARGET_NO_MANA);
return false; return false;
} }
} }
@ -2141,13 +2143,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
if(dist2 > range2) { if(dist2 > range2) {
//target is out of range. //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); 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); return(false);
} }
else if (dist2 < min_range2){ else if (dist2 < min_range2){
//target is too close range. //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); 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); return(false);
} }
@ -2162,13 +2164,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
if(dist2 > range2) { if(dist2 > range2) {
//target is out of range. //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); 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); return(false);
} }
else if (dist2 < min_range2){ else if (dist2 < min_range2){
//target is too close range. //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); 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); 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)) 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()); 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); return(false);
} }
@ -2533,7 +2535,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, CastingSlot slo
if(dist2 > range2) { if(dist2 > range2) {
//target is out of range. //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); 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); return(false);
} }
} }
@ -2892,7 +2894,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2,
if (spellbonuses.Screech == 1) { if (spellbonuses.Screech == 1) {
if (effect2 == SE_Screech && sp2.base[i] == -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; 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", 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); spell_id, curbuf.spellid, buffslot, curbuf.casterlevel);
if (caster && caster->IsClient() && RuleB(Client, UseLiveBlockedMessage)) { 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; return -1;
} }
@ -3414,7 +3416,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
if(!spelltar) if(!spelltar)
{ {
Log(Logs::Detail, Logs::Spells, "Unable to apply spell %d without a target", spell_id); 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; 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(IsDetrimentalSpell(spell_id) && !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id)) {
if(!IsClient() || !CastToClient()->GetGM()) { if(!IsClient() || !CastToClient()->GetGM()) {
Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); Message_StringID(Chat::SpellFailure, SPELL_NO_HOLD);
return false; return false;
} }
} }
@ -3588,7 +3590,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
{ {
if(spelltar->invisible) if(spelltar->invisible)
{ {
spelltar->Message_StringID(MT_SpellFailure, ALREADY_INVIS, GetCleanName()); spelltar->Message_StringID(Chat::SpellFailure, ALREADY_INVIS, GetCleanName());
safe_delete(action_packet); safe_delete(action_packet);
return false; return false;
} }
@ -3598,7 +3600,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
{ {
if(spelltar->invisible_undead) if(spelltar->invisible_undead)
{ {
spelltar->Message_StringID(MT_SpellFailure, ALREADY_INVIS, GetCleanName()); spelltar->Message_StringID(Chat::SpellFailure, ALREADY_INVIS, GetCleanName());
safe_delete(action_packet); safe_delete(action_packet);
return false; return false;
} }
@ -3608,7 +3610,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
{ {
if(spelltar->invisible_animals) if(spelltar->invisible_animals)
{ {
spelltar->Message_StringID(MT_SpellFailure, ALREADY_INVIS, GetCleanName()); spelltar->Message_StringID(Chat::SpellFailure, ALREADY_INVIS, GetCleanName());
safe_delete(action_packet); safe_delete(action_packet);
return false; 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)); 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 { } else {
Log(Logs::Detail, Logs::Spells, "Beneficial spell %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); 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); safe_delete(action_packet);
return false; 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 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()); 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); safe_delete(action_packet);
return false; 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); focus = CalcFocusEffect(focusBlockNextSpell, buffs[b].spellid, spell_id);
if(focus) { if(focus) {
CheckNumHitsRemaining(NumHit::MatchingSpells, b); CheckNumHitsRemaining(NumHit::MatchingSpells, b);
Message_StringID(MT_SpellFailure, SPELL_WOULDNT_HOLD); Message_StringID(Chat::SpellFailure, SPELL_WOULDNT_HOLD);
safe_delete(action_packet); safe_delete(action_packet);
return false; return false;
} }
@ -3788,14 +3790,14 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
this, /* Sender */ this, /* Sender */
false, /* Skip Sender */ false, /* Skip Sender */
RuleI(Range, SpellMessages), /* Range */ RuleI(Range, SpellMessages), /* Range */
MT_Spells, /* Type */ Chat::Spells, /* Type */
SPELL_REFLECT, /* String ID */ SPELL_REFLECT, /* String ID */
GetCleanName(), /* Message 1 */ GetCleanName(), /* Message 1 */
spelltar->GetCleanName() /* Message 2 */ spelltar->GetCleanName() /* Message 2 */
); );
} }
else { else {
Message_StringID(MT_Spells, SPELL_REFLECT, GetCleanName(), spelltar->GetCleanName()); Message_StringID(Chat::Spells, SPELL_REFLECT, GetCleanName(), spelltar->GetCleanName());
} }
CheckNumHitsRemaining(NumHit::ReflectSpell); 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()); Log(Logs::Detail, Logs::Spells, "Spell %d was completely resisted by %s", spell_id, spelltar->GetName());
if (spells[spell_id].resisttype == RESIST_PHYSICAL){ if (spells[spell_id].resisttype == RESIST_PHYSICAL){
Message_StringID(MT_SpellFailure, PHYSICAL_RESIST_FAIL,spells[spell_id].name); Message_StringID(Chat::SpellFailure, PHYSICAL_RESIST_FAIL,spells[spell_id].name);
spelltar->Message_StringID(MT_SpellFailure, YOU_RESIST, spells[spell_id].name); spelltar->Message_StringID(Chat::SpellFailure, YOU_RESIST, spells[spell_id].name);
} }
else { else {
Message_StringID(MT_SpellFailure, TARGET_RESISTED, spells[spell_id].name); Message_StringID(Chat::SpellFailure, TARGET_RESISTED, spells[spell_id].name);
spelltar->Message_StringID(MT_SpellFailure, YOU_RESIST, spells[spell_id].name); spelltar->Message_StringID(Chat::SpellFailure, YOU_RESIST, spells[spell_id].name);
} }
if (spelltar->IsAIControlled()) { 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); Log(Logs::Detail, Logs::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id);
if(!IsBardSong(spell_id)) if(!IsBardSong(spell_id))
Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL); Message_StringID(Chat::SpellFailure, SPELL_TOO_POWERFUL);
safe_delete(action_packet); safe_delete(action_packet);
return false; 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. // 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()); 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) if(casting_spell_aa_id)
Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); Message_StringID(Chat::SpellFailure, SPELL_NO_HOLD);
safe_delete(action_packet); safe_delete(action_packet);
return false; return false;
} }
@ -3989,14 +3991,14 @@ void Corpse::CastRezz(uint16 spellid, Mob* Caster)
if(IsRezzed()){ if(IsRezzed()){
if(Caster && Caster->IsClient()) if(Caster && Caster->IsClient())
Caster->Message(13,"This character has already been resurrected."); Caster->Message(Chat::Red,"This character has already been resurrected.");
return; return;
} }
/* /*
if(!can_rez) { if(!can_rez) {
if(Caster && Caster->IsClient()) if(Caster && Caster->IsClient())
Caster->Message_StringID(0, CORPSE_TOO_OLD); Caster->Message_StringID(Chat::WhiteSmoke, CORPSE_TOO_OLD);
return; return;
} }
*/ */
@ -4224,7 +4226,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
{ {
if(GetSpecialAbility(UNMEZABLE)) { if(GetSpecialAbility(UNMEZABLE)) {
Log(Logs::Detail, Logs::Spells, "We are immune to Mez spells."); 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); int32 aggro = caster->CheckAggroAmount(spell_id, this);
if(aggro > 0) { if(aggro > 0) {
AddToHateList(caster, aggro); AddToHateList(caster, aggro);
@ -4242,7 +4244,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
(!caster->IsNPC() || (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity)))) (!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]); 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); AddToHateList(caster, 1,0,true,false,false,spell_id);
return true; return true;
} }
@ -4252,7 +4254,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if(GetSpecialAbility(UNSLOWABLE) && IsEffectInSpell(spell_id, SE_AttackSpeed)) if(GetSpecialAbility(UNSLOWABLE) && IsEffectInSpell(spell_id, SE_AttackSpeed))
{ {
Log(Logs::Detail, Logs::Spells, "We are immune to Slow spells."); 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); int32 aggro = caster->CheckAggroAmount(spell_id, this);
if(aggro > 0) { if(aggro > 0) {
AddToHateList(caster, aggro); AddToHateList(caster, aggro);
@ -4268,7 +4270,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
effect_index = GetSpellEffectIndex(spell_id, SE_Fear); effect_index = GetSpellEffectIndex(spell_id, SE_Fear);
if(GetSpecialAbility(UNFEARABLE)) { if(GetSpecialAbility(UNFEARABLE)) {
Log(Logs::Detail, Logs::Spells, "We are immune to Fear spells."); 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); int32 aggro = caster->CheckAggroAmount(spell_id, this);
if(aggro > 0) { if(aggro > 0) {
AddToHateList(caster, aggro); AddToHateList(caster, aggro);
@ -4279,13 +4281,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
} else if(IsClient() && caster->IsClient() && (caster->CastToClient()->GetGM() == false)) } else if(IsClient() && caster->IsClient() && (caster->CastToClient()->GetGM() == false))
{ {
Log(Logs::Detail, Logs::Spells, "Clients cannot fear eachother!"); 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; return true;
} }
else if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) 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()); 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); int32 aggro = caster->CheckAggroAmount(spell_id, this);
if (aggro > 0) { if (aggro > 0) {
AddToHateList(caster, aggro); AddToHateList(caster, aggro);
@ -4296,9 +4298,9 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
} }
else if (CheckAATimer(aaTimerWarcry)) 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!"); 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; return true;
} }
} }
@ -4308,7 +4310,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if(GetSpecialAbility(UNCHARMABLE)) if(GetSpecialAbility(UNCHARMABLE))
{ {
Log(Logs::Detail, Logs::Spells, "We are immune to Charm spells."); 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); int32 aggro = caster->CheckAggroAmount(spell_id, this);
if(aggro > 0) { if(aggro > 0) {
AddToHateList(caster, aggro); AddToHateList(caster, aggro);
@ -4321,7 +4323,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if(this == caster) if(this == caster)
{ {
Log(Logs::Detail, Logs::Spells, "You are immune to your own charms."); 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; 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) 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]); 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<Paste> caster->Message_StringID(Chat::Red, CANNOT_CHARM_YET); // need to verify message type, not in MQ2Cast for easy look up<Paste>
AddToHateList(caster, 1,0,true,false,false,spell_id); AddToHateList(caster, 1,0,true,false,false,spell_id);
return true; return true;
} }
@ -4349,7 +4351,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
{ {
if(GetSpecialAbility(UNSNAREABLE)) { if(GetSpecialAbility(UNSNAREABLE)) {
Log(Logs::Detail, Logs::Spells, "We are immune to Snare spells."); 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); int32 aggro = caster->CheckAggroAmount(spell_id, this);
if(aggro > 0) { if(aggro > 0) {
AddToHateList(caster, aggro); AddToHateList(caster, aggro);
@ -4365,7 +4367,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if(this == caster) if(this == caster)
{ {
Log(Logs::Detail, Logs::Spells, "You cannot lifetap yourself."); 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; return true;
} }
} }
@ -4375,7 +4377,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if(this == caster) if(this == caster)
{ {
Log(Logs::Detail, Logs::Spells, "You cannot sacrifice yourself."); 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; 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; const char *fadetext = spells[spell_id].spell_fades;
outapp = new EQApplicationPacket(OP_ColoredText, sizeof(ColoredText_Struct) + strlen(fadetext)); outapp = new EQApplicationPacket(OP_ColoredText, sizeof(ColoredText_Struct) + strlen(fadetext));
ColoredText_Struct *bfm = (ColoredText_Struct *) outapp->pBuffer; ColoredText_Struct *bfm = (ColoredText_Struct *) outapp->pBuffer;
bfm->color = MT_Spells; bfm->color = Chat::Spells;
memcpy(bfm->msg, fadetext, strlen(fadetext)); memcpy(bfm->msg, fadetext, strlen(fadetext));
QueuePacket(outapp); QueuePacket(outapp);
safe_delete(outapp); safe_delete(outapp);

View File

@ -678,7 +678,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state)
if (taskID == TASKSLOTEMPTY) if (taskID == TASKSLOTEMPTY)
continue; continue;
if (!Tasks[taskID]) { if (!Tasks[taskID]) {
c->Message(13, c->Message(Chat::Red,
"Active Task Slot %i, references a task (%i), that does not exist. " "Active Task Slot %i, references a task (%i), that does not exist. "
"Removing from memory. Contact a GM to resolve this.", "Removing from memory. Contact a GM to resolve this.",
i, taskID); i, taskID);
@ -691,7 +691,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state)
for (int j = 0; j < Tasks[taskID]->ActivityCount; j++) { for (int j = 0; j < Tasks[taskID]->ActivityCount; j++) {
if (state->ActiveTasks[i].Activity[j].ActivityID != 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." "Active Task %i, %s. Activity count does not match expected value."
"Removing from memory. Contact a GM to resolve this.", "Removing from memory. Contact a GM to resolve this.",
taskID, Tasks[taskID]->Title.c_str()); taskID, Tasks[taskID]->Title.c_str());
@ -1001,7 +1001,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i
return; return;
if (TaskSets[TaskSetID].empty()) { 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; return;
} }
@ -1033,7 +1033,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i
if (TaskListIndex > 0) { if (TaskListIndex > 0) {
SendTaskSelector(c, mob, TaskListIndex, TaskList); SendTaskSelector(c, mob, TaskListIndex, TaskList);
} else { } 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; return;
@ -1065,7 +1065,7 @@ void TaskManager::TaskQuestSetSelector(Client *c, ClientTaskState *state, Mob *m
if (TaskListIndex > 0) { if (TaskListIndex > 0) {
SendTaskSelector(c, mob, TaskListIndex, TaskList); SendTaskSelector(c, mob, TaskListIndex, TaskList);
} else { } 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; return;
@ -2001,7 +2001,7 @@ void ClientTaskState::RewardTask(Client *c, TaskInformation *Task) {
c->SummonItem(Task->RewardID); c->SummonItem(Task->RewardID);
Item = database.GetItem(Task->RewardID); Item = database.GetItem(Task->RewardID);
if(Item) 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; break;
} }
@ -2012,7 +2012,7 @@ void ClientTaskState::RewardTask(Client *c, TaskInformation *Task) {
c->SummonItem(RewardList[i]); c->SummonItem(RewardList[i]);
Item = database.GetItem(RewardList[i]); Item = database.GetItem(RewardList[i]);
if(Item) 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; break;
} }
@ -2024,7 +2024,7 @@ void ClientTaskState::RewardTask(Client *c, TaskInformation *Task) {
} }
if (!Task->completion_emote.empty()) 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 // just use normal NPC faction ID stuff
if (Task->faction_reward) if (Task->faction_reward)
@ -2081,7 +2081,7 @@ void ClientTaskState::RewardTask(Client *c, TaskInformation *Task) {
CashMessage += " copper"; CashMessage += " copper";
} }
CashMessage += " pieces."; CashMessage += " pieces.";
c->Message(15,CashMessage.c_str()); c->Message(Chat::Yellow,CashMessage.c_str());
} }
int32 EXPReward = Task->XPReward; int32 EXPReward = Task->XPReward;
if(EXPReward > 0) { 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) void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID, bool enforce_level_requirement)
{ {
if (!taskmanager || TaskID < 0 || TaskID >= MAXTASKS) { 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; return;
} }
auto task = taskmanager->Tasks[TaskID]; auto task = taskmanager->Tasks[TaskID];
if (task == nullptr) { if (task == nullptr) {
c->Message(13, "Invalid TaskID %i", TaskID); c->Message(Chat::Red, "Invalid TaskID %i", TaskID);
return; return;
} }
@ -3235,7 +3235,7 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID, bool enfor
} }
if (max_tasks) { 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; return;
} }
@ -3243,14 +3243,14 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID, bool enfor
if (task->type == TaskType::Quest) { if (task->type == TaskType::Quest) {
for (int i = 0; i < MAXACTIVEQUESTS; i++) { for (int i = 0; i < MAXACTIVEQUESTS; i++) {
if (ActiveQuests[i].TaskID == TaskID) { 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; return;
} }
} }
} }
if (enforce_level_requirement && !taskmanager->AppropriateLevel(TaskID, c->GetLevel())) { 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; 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 // This shouldn't happen unless there is a bug in the handling of ActiveTaskCount somewhere
if (active_slot == nullptr) { 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; return;
} }
@ -3315,8 +3315,8 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID, bool enfor
NPC *npc = entity_list.GetID(NPCID)->CastToNPC(); NPC *npc = entity_list.GetID(NPCID)->CastToNPC();
if(!npc) { if(!npc) {
c->Message(clientMessageYellow, "Task Giver ID is %i", NPCID); c->Message(Chat::Yellow, "Task Giver ID is %i", NPCID);
c->Message(clientMessageError, "Unable to find NPC to send EVENT_TASKACCEPTED to. Report this bug."); c->Message(Chat::Red, "Unable to find NPC to send EVENT_TASKACCEPTED to. Report this bug.");
return; return;
} }

View File

@ -80,7 +80,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
if (itemsFound != 2) 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; return;
} }
} }
@ -90,7 +90,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
if(!container) if(!container)
{ {
Log(Logs::General, Logs::Error, "Player tried to augment an item without a container set."); 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; return;
} }
@ -115,7 +115,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
{ {
// Either 2 augmentable items found or none found // Either 2 augmentable items found or none found
// This should never occur due to client restrictions, but prevent in case of a hack // 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; 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 // This happens if the augment button is clicked more than once quickly while augmenting
if (!container->GetItem(0)) 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)) 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; return;
} }
@ -160,7 +160,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
} }
else else
{ {
user->Message(13, "Error: No available slot for augment"); user->Message(Chat::Red, "Error: No available slot for augment");
} }
} }
else else
@ -170,7 +170,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
if (!isSolvent && auged_with->GetItem()->ItemType != EQEmu::item::ItemTypeAugmentationDistiller) 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."); 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; return;
} }
@ -180,7 +180,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
if (!isSolvent && auged_with->GetItem()->ID != aug->GetItem()->AugDistiller) 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); 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; return;
} }
std::vector<EQEmu::Any> args; std::vector<EQEmu::Any> 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 (in_combine->container_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
if(!worldo) { 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; return;
} }
c_type = worldo->m_type; 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)) { 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; 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); user->DeleteItemInInventory(EQEmu::InventoryProfile::CalcSlotId(in_combine->container_slot, 0), 0, true);
container->Clear(); 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->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)) if (RuleB(Inventory, DeleteTransformationMold))
user->DeleteItemInInventory(in_combine->container_slot, 0, true); user->DeleteItemInInventory(in_combine->container_slot, 0, true);
} }
else if (inst) { 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); auto outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0);
user->QueuePacket(outapp); 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); user->DeleteItemInInventory(EQEmu::InventoryProfile::CalcSlotId(in_combine->container_slot, 0), 0, true);
container->Clear(); 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->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) { 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); auto outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0);
user->QueuePacket(outapp); user->QueuePacket(outapp);
@ -337,7 +337,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
DBTradeskillRecipe_Struct spec; DBTradeskillRecipe_Struct spec;
if (!database.GetTradeRecipe(container, c_type, some_id, user->CharacterID(), &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); auto outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0);
user->QueuePacket(outapp); user->QueuePacket(outapp);
safe_delete(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 // bit 6 (0x20): unlisted recipe flag
if ((spec.must_learn&0xF) == 1 && !spec.has_learnt) { if ((spec.must_learn&0xF) == 1 && !spec.has_learnt) {
// Made up message for the client. Just giving a DNC is the other option. // 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); auto outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0);
user->QueuePacket(outapp); user->QueuePacket(outapp);
safe_delete(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. // Character does not have the required skill.
if(spec.skill_needed > 0 && user->GetSkill(spec.tradeskill) < spec.skill_needed ) { if(spec.skill_needed > 0 && user->GetSkill(spec.tradeskill) < spec.skill_needed ) {
// Notify client. // 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); auto outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0);
user->QueuePacket(outapp); user->QueuePacket(outapp);
safe_delete(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 //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 (spec.tradeskill == EQEmu::skills::SkillAlchemy) {
if (user_pp.class_ != SHAMAN) { 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; return;
} }
else if (user_pp.level < MIN_LEVEL_ALCHEMY) { 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; return;
} }
} }
else if (spec.tradeskill == EQEmu::skills::SkillTinkering) { else if (spec.tradeskill == EQEmu::skills::SkillTinkering) {
if (user_pp.race != GNOME) { if (user_pp.race != GNOME) {
user->Message(13, "Only gnomes can tinker."); user->Message(Chat::Red, "Only gnomes can tinker.");
return; return;
} }
} }
else if (spec.tradeskill == EQEmu::skills::SkillMakePoison) { else if (spec.tradeskill == EQEmu::skills::SkillMakePoison) {
if (user_pp.class_ != ROGUE) { if (user_pp.class_ != ROGUE) {
user->Message(13, "Only rogues can mix poisons."); user->Message(Chat::Red, "Only rogues can mix poisons.");
return; return;
} }
} }
@ -422,7 +422,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
// Update Made count // Update Made count
if (success) { if (success) {
if (!spec.has_learnt && ((spec.must_learn&0x10) != 0x10)) { 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); 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. // This shouldn't happen.
if ((spec.must_learn&0xf) && !spec.has_learnt) { if ((spec.must_learn&0xf) && !spec.has_learnt) {
// Made up message for the client. Just giving a DNC is the other option. // 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); user->QueuePacket(outapp);
safe_delete(outapp); safe_delete(outapp);
return; return;
@ -540,13 +540,13 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac
safe_delete(outapp); 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) { for (auto it = MissingItems.begin(); it != MissingItems.end(); ++it) {
const EQEmu::ItemData* item = database.GetItem(*it); const EQEmu::ItemData* item = database.GetItem(*it);
if(item) if(item)
user->Message_StringID(MT_Skills, TRADESKILL_MISSING_ITEM, item->Name); user->Message_StringID(Chat::Skills, TRADESKILL_MISSING_ITEM, item->Name);
} }
return; return;
@ -593,7 +593,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac
if (success) { if (success) {
if (!spec.has_learnt && ((spec.must_learn & 0x10) != 0x10)) { 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); database.UpdateRecipeMadecount(spec.recipe_id, user->CharacterID(), spec.madecount+1);
} }
@ -951,7 +951,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
// above critical still stands. // above critical still stands.
// Mastery modifier is: 10%/25%/50% for rank one/two/three // Mastery modifier is: 10%/25%/50% for rank one/two/three
chance = 95.0f + (float(user_skill - spec->trivial) / 40.0f); 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) { } else if(chance < 5) {
// Minimum chance is always 5 // Minimum chance is always 5
chance = 5; chance = 5;
@ -978,7 +978,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
if(over_trivial < 0) if(over_trivial < 0)
CheckIncreaseTradeskill(bonusstat, stat_modifier, skillup_modifier, success_modifier, spec->tradeskill); 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"); Log(Logs::Detail, Logs::Tradeskills, "Tradeskill success");
@ -988,7 +988,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
SummonItem(itr->first, itr->second); SummonItem(itr->first, itr->second);
item = database.GetItem(itr->first); item = database.GetItem(itr->first);
if (this->GetGroup()) { 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 */ /* QS: Player_Log_Trade_Skill_Events */
@ -1010,12 +1010,12 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
if(over_trivial < 0) if(over_trivial < 0)
CheckIncreaseTradeskill(bonusstat, stat_modifier, skillup_modifier, success_modifier, spec->tradeskill); 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"); Log(Logs::Detail, Logs::Tradeskills, "Tradeskill failed");
if (this->GetGroup()) 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) if (row[1] != nullptr)
return; return;
Message_StringID(4, TRADESKILL_LEARN_RECIPE, row[0]); Message_StringID(Chat::LightBlue, TRADESKILL_LEARN_RECIPE, row[0]);
// Actually learn the recipe now // Actually learn the recipe now
query = StringFormat("INSERT INTO char_recipe_list " query = StringFormat("INSERT INTO char_recipe_list "
"SET recipe_id = %u, char_id = %u, madecount = 0 " "SET recipe_id = %u, char_id = %u, madecount = 0 "

View File

@ -102,7 +102,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) {
EQEmu::ItemInstance* inst = client->GetInv().GetItem(EQEmu::invslot::slotCursor); EQEmu::ItemInstance* inst = client->GetInv().GetItem(EQEmu::invslot::slotCursor);
if (!inst) { 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; return;
} }
@ -1110,7 +1110,7 @@ void Client::Trader_EndTrader() {
tdis->Unknown000 = 0; tdis->Unknown000 = 0;
tdis->TraderID = Customer->GetID(); tdis->TraderID = Customer->GetID();
tdis->Unknown012 = 0; 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++) { for(int i = 0; i < 80; i++) {
if(gis->Items[i] != 0) { 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); Log(Logs::Detail, Logs::Trading, "Actual quantity that will be traded is %i", outtbs->Quantity);
if((tbs->Price * outtbs->Quantity) <= 0) { if((tbs->Price * outtbs->Quantity) <= 0) {
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(13, "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." Log(Logs::General, Logs::Error, "Bazaar: Zero price transaction between %s and %s aborted."
"Item: %s, Charges: %i, TBS: Qty %i, Price: %i", "Item: %s, Charges: %i, TBS: Qty %i, Price: %i",
GetName(), Trader->GetName(), GetName(), Trader->GetName(),
@ -1642,7 +1642,7 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs, Client* Trader, const EQApplic
uint64 TotalTransactionValue = static_cast<uint64>(tbs->Price) * static_cast<uint64>(outtbs->Quantity); uint64 TotalTransactionValue = static_cast<uint64>(tbs->Price) * static_cast<uint64>(outtbs->Quantity);
if(TotalTransactionValue > MAX_TRANSACTION_VALUE) { 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); TradeRequestFailed(app);
safe_delete(outapp); safe_delete(outapp);
return; return;
@ -1754,7 +1754,7 @@ void Client::SendBazaarWelcome()
return; return;
auto row = results.begin(); 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])); "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; uint32 ID = 0;
if (results.RowCount() == static_cast<unsigned long>(RuleI(Bazaar, MaxSearchResults))) if (results.RowCount() == static_cast<unsigned long>(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)); RuleI(Bazaar, MaxSearchResults));
if(results.RowCount() == 0) { if(results.RowCount() == 0) {
@ -2057,7 +2057,7 @@ static void UpdateTraderCustomerItemsAdded(uint32 CustomerID, TraderCharges_Stru
if(!inst) return; 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++) { for(int i = 0; i < 80; i++) {
@ -2105,7 +2105,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St
tdis->Unknown000 = 0; tdis->Unknown000 = 0;
tdis->TraderID = Customer->GetID(); tdis->TraderID = Customer->GetID();
tdis->Unknown012 = 0; 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++) { for(int i = 0; i < 80; i++) {
@ -2147,7 +2147,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St
inst->SetMerchantCount(Charges); inst->SetMerchantCount(Charges);
// Let the customer know the price in the window has suddenly just changed on them. // 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++) { for(int i = 0; i < 80; i++) {
if((gis->ItemID[i] != ItemID) || if((gis->ItemID[i] != ItemID) ||
@ -2286,7 +2286,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) {
} }
if(SameItemWithDifferingCharges) 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); "at the same price.", item->Name);
} }
@ -2333,8 +2333,8 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) {
tpus->SubAction = BazaarPriceChange_Fail; tpus->SubAction = BazaarPriceChange_Fail;
QueuePacket(app); QueuePacket(app);
Trader_EndTrader(); Trader_EndTrader();
Message(13, "You must remove the item from sale before you can increase the price while a customer is browsing."); Message(Chat::Red, "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, "Click 'Begin Trader' to restart Trader mode with the increased price for this item.");
safe_delete(gis); safe_delete(gis);
return; return;
} }
@ -2387,11 +2387,11 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) {
int numberOfRows = results.RowCount(); int numberOfRows = results.RowCount();
if(numberOfRows == RuleI(Bazaar, MaxBarterSearchResults)) 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) else if(strlen(searchString) == 0)
Message(10, "There are %i Buy Lines.", numberOfRows); Message(Chat::NPCQuestSay, "There are %i Buy Lines.", numberOfRows);
else 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) if(numberOfRows == 0)
return; return;
@ -2466,7 +2466,7 @@ void Client::ShowBuyLines(const EQApplicationPacket *app) {
if(!Buyer) { if(!Buyer) {
bir->Approval = 0; // Tell the client that the Buyer is unavailable bir->Approval = 0; // Tell the client that the Buyer is unavailable
QueuePacket(app); QueuePacket(app);
Message(13, "The Buyer has gone away."); Message(Chat::Red, "The Buyer has gone away.");
return; return;
} }
@ -2475,14 +2475,14 @@ void Client::ShowBuyLines(const EQApplicationPacket *app) {
QueuePacket(app); QueuePacket(app);
if(bir->Approval == 0) { if(bir->Approval == 0) {
Message_StringID(clientMessageYellow, TRADER_BUSY); Message_StringID(Chat::Yellow, TRADER_BUSY);
return; return;
} }
const char *WelcomeMessagePointer = Buyer->GetBuyerWelcomeMessage(); const char *WelcomeMessagePointer = Buyer->GetBuyerWelcomeMessage();
if(strlen(WelcomeMessagePointer) > 0) 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)); 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(!item || !Quantity || !Price || !QtyBuyerWants) return;
if (m_inv.HasItem(ItemID, Quantity, invWhereWorn | invWherePersonal | invWhereCursor) == INVALID_INDEX) { 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; return;
} }
@ -2571,37 +2571,37 @@ void Client::SellToBuyer(const EQApplicationPacket *app) {
Client *Buyer = entity_list.GetClientByID(BuyerID); Client *Buyer = entity_list.GetClientByID(BuyerID);
if(!Buyer || !Buyer->IsBuyer()) { if(!Buyer || !Buyer->IsBuyer()) {
Message(13, "The Buyer has gone away."); Message(Chat::Red, "The Buyer has gone away.");
return; return;
} }
// For Stackable items, HasSpaceForItem will try check if there is space to stack with existing stacks in // For Stackable items, HasSpaceForItem will try check if there is space to stack with existing stacks in
// the buyer inventory. // the buyer inventory.
if(!(Buyer->GetInv().HasSpaceForItem(item, Quantity))) { 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; return;
} }
if((static_cast<uint64>(Quantity) * static_cast<uint64>(Price)) > MAX_TRANSACTION_VALUE) { if((static_cast<uint64>(Quantity) * static_cast<uint64>(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; return;
} }
if(!Buyer->HasMoney(Quantity * Price)) { if(!Buyer->HasMoney(Quantity * Price)) {
Message(13, "The Buyer does not have sufficient money to purchase that quantity of %s.", item->Name); Message(Chat::Red, "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); Buyer->Message(Chat::Red, "%s tried to sell you %i %s, but you have insufficient funds.", GetName(), Quantity, item->Name);
return; return;
} }
if(Buyer->CheckLoreConflict(item)) { if(Buyer->CheckLoreConflict(item)) {
Message(13, "That item is LORE and the Buyer already has one."); Message(Chat::Red, "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.", Buyer->Message(Chat::Red, "%s tried to sell you %s but this item is LORE and you already have one.",
GetName(), item->Name); GetName(), item->Name);
return; return;
} }
if(item->NoDrop == 0) { if(item->NoDrop == 0) {
Message(13, "That item is NODROP."); Message(Chat::Red, "That item is NODROP.");
return; return;
} }
@ -2620,7 +2620,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) {
break; break;
} }
Log(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); 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; return;
} }
@ -2628,7 +2628,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) {
if(!ItemToTransfer || !Buyer->MoveItemToInventory(ItemToTransfer, true)) { if(!ItemToTransfer || !Buyer->MoveItemToInventory(ItemToTransfer, true)) {
Log(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); 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) if(ItemToTransfer)
safe_delete(ItemToTransfer); safe_delete(ItemToTransfer);
@ -2666,7 +2666,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) {
if (SellerSlot == INVALID_INDEX) { if (SellerSlot == INVALID_INDEX) {
Log(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); 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; return;
} }
@ -2674,7 +2674,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) {
if(!ItemToTransfer) { if(!ItemToTransfer) {
Log(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); 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; return;
} }
@ -2686,7 +2686,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) {
if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) { if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) {
Log(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); 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); safe_delete(ItemToTransfer);
return; return;
} }
@ -2721,7 +2721,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) {
if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) { if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) {
Log(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); 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); safe_delete(ItemToTransfer);
return; return;
} }
@ -2965,19 +2965,19 @@ void Client::UpdateBuyLine(const EQApplicationPacket *app) {
} }
else { else {
if(ItemCount > 0) 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) 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) 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) 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) 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 else
database.RemoveBuyLine(CharacterID(), BuySlot); database.RemoveBuyLine(CharacterID(), BuySlot);
@ -3047,7 +3047,7 @@ void Client::BuyerItemSearch(const EQApplicationPacket *app) {
break; break;
} }
if (Count == MAX_BUYER_ITEMSEARCH_RESULTS) 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); MAX_BUYER_ITEMSEARCH_RESULTS, MAX_BUYER_ITEMSEARCH_RESULTS);
bisr->Action = Barter_BuyerSearch; bisr->Action = Barter_BuyerSearch;

View File

@ -373,13 +373,13 @@ void EntityList::GetTrapInfo(Client* client)
if (cur->IsTrap()) if (cur->IsTrap())
{ {
bool isset = (cur->chkarea_timer.Enabled() && !cur->reset_timer.Enabled()); 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; ++count;
} }
++it; ++it;
} }
client->Message(CC_Default, "%d traps found.", count); client->Message(Chat::Default, "%d traps found.", count);
} }
void EntityList::ClearTrapPointers() void EntityList::ClearTrapPointers()

View File

@ -93,7 +93,7 @@ void Client::ToggleTribute(bool enabled) {
} }
if(cost > m_pp.tribute_points) { 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); ToggleTribute(false);
return; return;
} }
@ -250,7 +250,7 @@ int32 Client::TributeItem(uint32 slot, uint32 quantity) {
pts = mod_tribute_item_value(pts, m_inv[slot]); pts = mod_tribute_item_value(pts, m_inv[slot]);
if(pts < 1) { if(pts < 1) {
Message(13, "This item is worthless for favor."); Message(Chat::Red, "This item is worthless for favor.");
return(0); return(0);
} }
@ -277,7 +277,7 @@ int32 Client::TributeItem(uint32 slot, uint32 quantity) {
//returns the number of points received from the tribute //returns the number of points received from the tribute
int32 Client::TributeMoney(uint32 platinum) { int32 Client::TributeMoney(uint32 platinum) {
if(!TakeMoneyFromPP(platinum * 1000)) { 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); return(0);
} }

View File

@ -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); Message(0, "#Tune - [WARNING] Mitigation can not be further decreased due to minium hit value (%i).",minhit);
if (defender->IsNPC()){ 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()); Message(0, "#SET: [NPC Attack STAT] = [%i]",add_ac + defender->CastToNPC()->GetRawAC());
} }
if (defender->IsClient()){ 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); 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); tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::invslot::slotPrimary, 0, false, 0, avoid_override, add_acc);
if (Msg >= 3) 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){ if (interval > 0 && tmp_hit_chance >= hit_chance){
end = true; end = true;
@ -727,8 +727,8 @@ void Mob::Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_ch
add_acc = add_acc + interval; 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(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(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 - 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) void Mob::Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_chance, int interval, int max_loop, int acc_override, int Msg)

View File

@ -211,7 +211,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
else if (scm->queued == 2) // tell queue was full else if (scm->queued == 2) // tell queue was full
client->Tell_StringID(QUEUE_TELL_FULL, scm->to, scm->message); client->Tell_StringID(QUEUE_TELL_FULL, scm->to, scm->message);
else if (scm->queued == 3) // person was offline 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'" 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 // 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); 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) switch (ztz->response)
{ {
case -2: { 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; break;
} }
case -1: { 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; break;
} }
case 0: { 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; break;
} }
} }
@ -414,7 +414,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
Client* client = entity_list.GetClientByID(wars->id); Client* client = entity_list.GetClientByID(wars->id);
if (client) { if (client) {
if (pack->size == 64)//no results if (pack->size == 64)//no results
client->Message_StringID(0, WHOALL_NO_RESULTS); client->Message_StringID(Chat::White, WHOALL_NO_RESULTS);
else { else {
auto outapp = new EQApplicationPacket(OP_WhoAllResponse, pack->size); auto outapp = new EQApplicationPacket(OP_WhoAllResponse, pack->size);
memcpy(outapp->pBuffer, pack->pBuffer, 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); Client* c = entity_list.GetClientByName(Rezzer);
if (c) if (c)
c->Message_StringID(MT_WornOff, REZZ_ALREADY_PENDING); c->Message_StringID(Chat::SpellWornOff, REZZ_ALREADY_PENDING);
break; break;
} }
@ -910,7 +910,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
entity_list.AddGroup(group); entity_list.AddGroup(group);
if (group->GetID() == 0) { 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; break;
} }
@ -1485,7 +1485,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
ServerOP_Consent_Struct* s = (ServerOP_Consent_Struct*)pack->pBuffer; ServerOP_Consent_Struct* s = (ServerOP_Consent_Struct*)pack->pBuffer;
Client* client = entity_list.GetClientByName(s->ownername); Client* client = entity_list.GetClientByName(s->ownername);
if (client) { if (client) {
client->Message_StringID(0, s->message_string_id); client->Message_StringID(Chat::White, s->message_string_id);
} }
break; break;
} }
@ -1729,7 +1729,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
if (c) if (c)
{ {
c->ClearPendingAdventureDoorClick(); c->ClearPendingAdventureDoorClick();
c->Message_StringID(13, 5141); c->Message_StringID(Chat::Red, 5141);
} }
break; break;
} }
@ -1751,7 +1751,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
if (c) if (c)
{ {
c->ClearPendingAdventureLeave(); 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; break;
} }

View File

@ -3061,10 +3061,10 @@ bool ZoneDatabase::SaveMerc(Merc *merc) {
auto results = database.QueryDatabase(query); auto results = database.QueryDatabase(query);
if(!results.Success()) { if(!results.Success()) {
owner->Message(13, results.ErrorMessage().c_str()); owner->Message(Chat::Red, results.ErrorMessage().c_str());
return false; return false;
} else if (results.RowsAffected() != 1) { } 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; return false;
} }
@ -3095,10 +3095,10 @@ bool ZoneDatabase::SaveMerc(Merc *merc) {
auto results = database.QueryDatabase(query); auto results = database.QueryDatabase(query);
if (!results.Success()) { if (!results.Success()) {
owner->Message(13, results.ErrorMessage().c_str()); owner->Message(Chat::Red, results.ErrorMessage().c_str());
return false; return false;
} else if (results.RowsAffected() != 1) { } 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; return false;
} }

View File

@ -96,7 +96,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
//that can be a valid un-zolicited zone request? //that can be a valid un-zolicited zone request?
//Todo cheat detection //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); Log(Logs::General, Logs::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id);
SendZoneCancel(zc); SendZoneCancel(zc);
return; return;
@ -142,14 +142,14 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
//make sure we are in it and it's unexpired. //make sure we are in it and it's unexpired.
if(!database.VerifyInstanceAlive(target_instance_id, CharacterID())) 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); SendZoneCancel(zc);
return; return;
} }
if(!database.VerifyZoneInstance(target_zone_id, target_instance_id)) 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); SendZoneCancel(zc);
return; return;
} }
@ -159,7 +159,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
const char *target_zone_name = database.GetZoneName(target_zone_id); const char *target_zone_name = database.GetZoneName(target_zone_id);
if(target_zone_name == nullptr) { if(target_zone_name == nullptr) {
//invalid zone... //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); Log(Logs::General, Logs::Error, "Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id);
SendZoneCancel(zc); SendZoneCancel(zc);
return; return;
@ -172,7 +172,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
char flag_needed[128]; 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)) { if(!database.GetSafePoints(target_zone_name, database.GetInstanceVersion(target_instance_id), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) {
//invalid zone... //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); Log(Logs::General, Logs::Error, "Zoning %s: Unable to get safe coordinates for zone '%s'.", GetName(), target_zone_name);
SendZoneCancel(zc); SendZoneCancel(zc);
return; 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. //the flag needed string is not empty, meaning a flag is required.
if(Admin() < minStatusToIgnoreZoneFlags && !HasZoneFlag(target_zone_id)) 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; 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); ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm);
break; break;
case GMSummon: 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); ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm);
break; break;
case ZoneToBindPoint: 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); ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm);
break; break;
case SummonPC: 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); ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm);
break; break;
case Rewind: 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); ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm);
break; break;
default: default:
@ -486,7 +486,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
database.GetZoneLongName(pShortZoneName, &pZoneName); database.GetZoneLongName(pShortZoneName, &pZoneName);
if(!pZoneName) { if(!pZoneName) {
Message(13, "Invalid zone number specified"); Message(Chat::Red, "Invalid zone number specified");
safe_delete_array(pZoneName); safe_delete_array(pZoneName);
return; 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); Entity* entity = entity_list.GetID(entity_id_being_looted);
if (entity == 0) 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) if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
Corpse::SendEndLootErrorPacket(this); Corpse::SendEndLootErrorPacket(this);
else else
@ -568,7 +568,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
} }
else if (!entity->IsCorpse()) 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); Corpse::SendLootReqErrorPacket(this);
} }
else else
@ -723,7 +723,7 @@ void Client::Gate(uint8 bindnum) {
} }
void NPC::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); Mob::Gate(bindnum);
} }