Merge branch 'master' into light-wield

This commit is contained in:
Paul Coene 2019-08-16 10:30:54 -04:00 committed by GitHub
commit 5a0fcdfefd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
94 changed files with 5624 additions and 4288 deletions

3
SECURITY.md Normal file
View File

@ -0,0 +1,3 @@
# Security Policy - Reporting Vulnerabilities
When reporting active hacks, exploits and other vulnerabilities, please describe how to reproduce said report and if you can provide context into a possible solution

View File

@ -1,5 +1,23 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50) EQEMu Changelog (Started on Sept 24, 2003 15:50)
------------------------------------------------------- -------------------------------------------------------
== 8/16/2019 ==
Akkadius: Simplified the use of roamboxes and improved the AI for roambox pathing https://i.imgur.com/z33u7y9.gif
Akkadius: Implemented command #roambox set <box_size> [move_delay]
Akkadius: Implemented command #roambox remove
Akkadius: Implemented LUA NPC:SetSimpleRoamBox(box_size, [move_distance], [move_delay]);
Akkadius: Implemented Perl $npc->SetSimpleRoamBox(box_size, [move_distance], [move_delay]);
Akkadius: Spawngroup data now hot reloads on #repop
Akkadius: Command #npceditmass now lists column options when one isn't properly specified
Akkadius: Implemented command #spawneditmass <search> <option> <value> with options [respawn_time] currently implemented
== 8/11/2019 ==
Akkadius: Added bulk edit command #npceditmass <column-to-search> <column-search-value> <change-column> <change-value>
Akkadius: Modified #findzone to include clickable saylinks to both regular zone (if able) and private gmzone instances
Akkadius: Added #findzone expansion <expansion-number> to show zones via expansion
== 8/6/2019 ==
Akkadius: Optimizations to movement updates to eliminate ghosting possibilities in larger zones
== 7/22/2019 == == 7/22/2019 ==
Uleat: Added script 'vcxproj_dependencies.py' - a script to help determine conflicting project dependencies (alpha-stage) Uleat: Added script 'vcxproj_dependencies.py' - a script to help determine conflicting project dependencies (alpha-stage)

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

@ -77,6 +77,10 @@ namespace EQEmu
} // namespace invtype } // namespace invtype
namespace DevTools {
const int32 GM_ACCOUNT_STATUS_LEVEL = 150;
}
namespace popupresponse { namespace popupresponse {
const int32 SERVER_INTERNAL_USE_BASE = 2000000000; const int32 SERVER_INTERNAL_USE_BASE = 2000000000;
const int32 MOB_INFO_DISMISS = 2000000001; const int32 MOB_INFO_DISMISS = 2000000001;

View File

@ -71,7 +71,7 @@
//#define AT_Trader 300 // Bazaar Trader Mode (not present in SoF or RoF2) //#define AT_Trader 300 // Bazaar Trader Mode (not present in SoF or RoF2)
// animations for AT_Anim // animations for AT_Anim
#define ANIM_FREEZE 102 #define ANIM_FREEZE 102
#define ANIM_STAND 0x64 #define ANIM_STAND 0x64
#define ANIM_SIT 0x6e #define ANIM_SIT 0x6e
#define ANIM_CROUCH 0x6f #define ANIM_CROUCH 0x6f
@ -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

@ -257,7 +257,7 @@ namespace EQ
resend_delay_min = 150; resend_delay_min = 150;
resend_delay_max = 5000; resend_delay_max = 5000;
connect_delay_ms = 500; connect_delay_ms = 500;
stale_connection_ms = 30000; stale_connection_ms = 60000;
connect_stale_ms = 5000; connect_stale_ms = 5000;
crc_length = 2; crc_length = 2;
max_packet_size = 512; max_packet_size = 512;

View File

@ -27,6 +27,8 @@
#else #else
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <iostream>
#endif #endif
#ifndef va_copy #ifndef va_copy
@ -119,10 +121,29 @@ std::vector<std::string> SplitString(const std::string &str, char delim) {
while(std::getline(ss, item, delim)) { while(std::getline(ss, item, delim)) {
ret.push_back(item); ret.push_back(item);
} }
return ret; return ret;
} }
std::string implode(std::string glue, std::vector<std::string> src)
{
if (src.empty()) {
return {};
}
std::ostringstream output;
std::vector<std::string>::iterator src_iter;
for (src_iter = src.begin(); src_iter != src.end(); src_iter++) {
output << *src_iter << glue;
}
std::string final_output = output.str();
final_output.resize (output.str().size () - glue.size());
return final_output;
}
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);
std::string implode(std::string glue, 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

@ -379,6 +379,7 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3
} }
// this function does not delete the ServerPacket, so it must be handled at call site
void Database::GeneralQueryReceive(ServerPacket *pack) { void Database::GeneralQueryReceive(ServerPacket *pack) {
/* /*
These are general queries passed from anywhere in zone instead of packing structures and breaking them down again and again These are general queries passed from anywhere in zone instead of packing structures and breaking them down again and again
@ -393,7 +394,6 @@ void Database::GeneralQueryReceive(ServerPacket *pack) {
Log(Logs::Detail, Logs::QS_Server, "%s", query.c_str()); Log(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
} }
safe_delete(pack);
safe_delete_array(queryBuffer); safe_delete_array(queryBuffer);
} }

View File

@ -471,7 +471,7 @@ static void ProcessCommandIgnore(Client *c, std::string Ignoree) {
Clientlist::Clientlist(int ChatPort) { Clientlist::Clientlist(int ChatPort) {
EQStreamManagerInterfaceOptions chat_opts(ChatPort, false, false); EQStreamManagerInterfaceOptions chat_opts(ChatPort, false, false);
chat_opts.opcode_size = 1; chat_opts.opcode_size = 1;
chat_opts.daybreak_options.stale_connection_ms = 300000; chat_opts.daybreak_options.stale_connection_ms = 600000;
chat_opts.daybreak_options.resend_delay_ms = RuleI(Network, ResendDelayBaseMS); chat_opts.daybreak_options.resend_delay_ms = RuleI(Network, ResendDelayBaseMS);
chat_opts.daybreak_options.resend_delay_factor = RuleR(Network, ResendDelayFactor); chat_opts.daybreak_options.resend_delay_factor = RuleR(Network, ResendDelayFactor);
chat_opts.daybreak_options.resend_delay_min = RuleI(Network, ResendDelayMinMS); chat_opts.daybreak_options.resend_delay_min = RuleI(Network, ResendDelayMinMS);

View File

@ -130,7 +130,7 @@
int32 GetFollowID(); int32 GetFollowID();
virtual void Message(int32 type, const char* message, ...); virtual void Message(int32 type, const char* message, ...);
virtual void Message_StringID(int32 type, int32 string_id, int32 distance = 0); virtual void MessageString(int32 type, int32 string_id, int32 distance = 0);
void Say(const char *format, ...); void Say(const char *format, ...);
void Shout(const char *format, ...); void Shout(const char *format, ...);
void Emote(const char *format, ...); void Emote(const char *format, ...);

View File

@ -454,6 +454,7 @@ sub do_installer_routines {
fetch_latest_windows_appveyor(); fetch_latest_windows_appveyor();
get_remote_file($install_repository_request_url . "lua51.dll", "lua51.dll", 1); get_remote_file($install_repository_request_url . "lua51.dll", "lua51.dll", 1);
get_remote_file($install_repository_request_url . "zlib1.dll", "zlib1.dll", 1); get_remote_file($install_repository_request_url . "zlib1.dll", "zlib1.dll", 1);
get_remote_file($install_repository_request_url . "zlib1.pdb", "zlib1.pdb", 1);
get_remote_file($install_repository_request_url . "libmysql.dll", "libmysql.dll", 1); get_remote_file($install_repository_request_url . "libmysql.dll", "libmysql.dll", 1);
} }
@ -1587,22 +1588,24 @@ sub add_login_server_firewall_rules {
print "If firewall rules don't add you must run this script (eqemu_server.pl) as administrator\n"; print "If firewall rules don't add you must run this script (eqemu_server.pl) as administrator\n";
print "\n"; print "\n";
print "[Install] Instructions \n"; print "[Install] Instructions \n";
print "[Install] In order to connect your server to the loginserver you must point your eqemu_config.xml to your local server similar to the following:\n"; print "[Install] In order to connect your server to the loginserver you must point your eqemu_config.json to your local server similar to the following:\n";
print " print "
<loginserver1> \"loginserver1\" : {
<host>login.eqemulator.net</host> \"account\" : \"\",
<port>5998</port> \"host\" : \"login.eqemulator.net\",
<account></account> \"password\" : \"\",
<password></password> \"port\" : \"5998\",
</loginserver1> \"legacy\": \"1\"
<loginserver2> },
<host>127.0.0.1</host> \"loginserver2\" : {
<port>5998</port> \"account\" : \"\",
<account></account> \"host\" : \"192.168.197.129\",
<password></password> \"password\" : \"\",
</loginserver2> \"port\" : \"5998\"
},
\"localaddress\" : \"192.168.197.129\",
"; ";
print "[Install] When done, make sure your EverQuest client points to your loginserver's IP (In this case it would be 127.0.0.1) in the eqhosts.txt file\n"; print "[Install] When done, make sure your EverQuest client points to your loginserver's IP (In this case it would be 192.168.197.129) in the eqhosts.txt file\n";
} }
} }
@ -1640,9 +1643,10 @@ sub check_windows_firewall_rules {
} }
sub fetch_server_dlls { sub fetch_server_dlls {
print "[Download] Fetching lua51.dll, zlib1.dll, libmysql.dll...\n"; print "[Download] Fetching lua51.dll, zlib1.dll, zlib1.pdb, libmysql.dll...\n";
get_remote_file($install_repository_request_url . "lua51.dll", "lua51.dll", 1); get_remote_file($install_repository_request_url . "lua51.dll", "lua51.dll", 1);
get_remote_file($install_repository_request_url . "zlib1.dll", "zlib1.dll", 1); get_remote_file($install_repository_request_url . "zlib1.dll", "zlib1.dll", 1);
get_remote_file($install_repository_request_url . "zlib1.pdb", "zlib1.pdb", 1);
get_remote_file($install_repository_request_url . "libmysql.dll", "libmysql.dll", 1); get_remote_file($install_repository_request_url . "libmysql.dll", "libmysql.dll", 1);
} }

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

@ -104,6 +104,7 @@ Client::Client(EQStreamInterface* ieqs)
char_name[0] = 0; char_name[0] = 0;
charid = 0; charid = 0;
zone_waiting_for_bootup = 0; zone_waiting_for_bootup = 0;
enter_world_triggered = false;
StartInTutorial = false; StartInTutorial = false;
m_ClientVersion = eqs->ClientVersion(); m_ClientVersion = eqs->ClientVersion();
@ -1118,6 +1119,7 @@ bool Client::Process() {
Log(Logs::General, Logs::World_Server, "Zone bootup timer expired, bootup failed or too slow."); Log(Logs::General, Logs::World_Server, "Zone bootup timer expired, bootup failed or too slow.");
TellClientZoneUnavailable(); TellClientZoneUnavailable();
} }
if(connect.Check()){ if(connect.Check()){
SendGuildList();// Send OPCode: OP_GuildsList SendGuildList();// Send OPCode: OP_GuildsList
SendApproveWorld(); SendApproveWorld();
@ -1189,13 +1191,18 @@ void Client::EnterWorld(bool TryBootup) {
else else
zone_server = zoneserver_list.FindByZoneID(zone_id); zone_server = zoneserver_list.FindByZoneID(zone_id);
//Tell all the zones to drop any client with this lsid because we're coming back in.
zoneserver_list.DropClient(GetLSID());
const char *zone_name = database.GetZoneName(zone_id, true); const char *zone_name = database.GetZoneName(zone_id, true);
if (zone_server) { if (zone_server) {
// warn the world we're comming, so it knows not to shutdown if (false == enter_world_triggered) {
zone_server->IncomingClient(this); //Drop any clients we own in other zones.
zoneserver_list.DropClient(GetLSID(), zone_server);
// warn the zone we're coming
zone_server->IncomingClient(this);
//tell the server not to trigger this multiple times before we get a zone unavailable
enter_world_triggered = true;
}
} }
else { else {
if (TryBootup) { if (TryBootup) {
@ -1214,9 +1221,17 @@ void Client::EnterWorld(bool TryBootup) {
return; return;
} }
} }
zone_waiting_for_bootup = 0; zone_waiting_for_bootup = 0;
if(!cle) { if (GetAdmin() < 80 && zoneserver_list.IsZoneLocked(zone_id)) {
Log(Logs::General, Logs::World_Server, "Enter world failed. Zone is locked.");
TellClientZoneUnavailable();
return;
}
if (!cle) {
TellClientZoneUnavailable();
return; return;
} }
@ -1233,12 +1248,6 @@ void Client::EnterWorld(bool TryBootup) {
); );
if (seen_character_select) { if (seen_character_select) {
if (GetAdmin() < 80 && zoneserver_list.IsZoneLocked(zone_id)) {
Log(Logs::General, Logs::World_Server, "Enter world failed. Zone is locked.");
TellClientZoneUnavailable();
return;
}
auto pack = new ServerPacket; auto pack = new ServerPacket;
pack->opcode = ServerOP_AcceptWorldEntrance; pack->opcode = ServerOP_AcceptWorldEntrance;
pack->size = sizeof(WorldToZone_Struct); pack->size = sizeof(WorldToZone_Struct);
@ -1358,6 +1367,7 @@ void Client::TellClientZoneUnavailable() {
zone_id = 0; zone_id = 0;
zone_waiting_for_bootup = 0; zone_waiting_for_bootup = 0;
enter_world_triggered = false;
autobootup_timeout.Disable(); autobootup_timeout.Disable();
} }

View File

@ -82,6 +82,7 @@ private:
bool is_player_zoning; bool is_player_zoning;
Timer autobootup_timeout; Timer autobootup_timeout;
uint32 zone_waiting_for_bootup; uint32 zone_waiting_for_bootup;
bool enter_world_triggered;
bool StartInTutorial; bool StartInTutorial;
EQEmu::versions::ClientVersion m_ClientVersion; EQEmu::versions::ClientVersion m_ClientVersion;

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

@ -708,11 +708,16 @@ void ZSList::WorldShutDown(uint32 time, uint32 interval)
} }
} }
void ZSList::DropClient(uint32 lsid) { void ZSList::DropClient(uint32 lsid, ZoneServer *ignore_zoneserver) {
ServerPacket packet(ServerOP_DropClient, sizeof(ServerZoneDropClient_Struct)); ServerPacket packet(ServerOP_DropClient, sizeof(ServerZoneDropClient_Struct));
auto drop = (ServerZoneDropClient_Struct*)packet.pBuffer; auto drop = (ServerZoneDropClient_Struct*)packet.pBuffer;
drop->lsid = lsid; drop->lsid = lsid;
SendPacket(&packet);
for (auto &zs : zone_server_list) {
if (zs.get() != ignore_zoneserver) {
zs->SendPacket(&packet);
}
}
} }
void ZSList::OnTick(EQ::Timer *t) void ZSList::OnTick(EQ::Timer *t)

View File

@ -57,7 +57,7 @@ public:
void SOPZoneBootup(const char *adminname, uint32 ZoneServerID, const char *zonename, bool iMakeStatic = false); void SOPZoneBootup(const char *adminname, uint32 ZoneServerID, const char *zonename, bool iMakeStatic = false);
void UpdateUCSServerAvailable(bool ucss_available = true); void UpdateUCSServerAvailable(bool ucss_available = true);
void WorldShutDown(uint32 time, uint32 interval); void WorldShutDown(uint32 time, uint32 interval);
void DropClient(uint32 lsid); void DropClient(uint32 lsid, ZoneServer *ignore_zoneserver);
ZoneServer* FindByPort(uint16 port); ZoneServer* FindByPort(uint16 port);
ZoneServer* FindByID(uint32 ZoneID); ZoneServer* FindByID(uint32 ZoneID);

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;
} }
@ -489,7 +489,7 @@ void Client::ResetAA() {
database.DeleteCharacterLeadershipAAs(CharacterID()); database.DeleteCharacterLeadershipAAs(CharacterID());
// undefined for these clients // undefined for these clients
if (ClientVersionBit() & EQEmu::versions::maskTitaniumAndEarlier) if (ClientVersionBit() & EQEmu::versions::maskTitaniumAndEarlier)
Kick(); Kick("AA Reset on client that doesn't support it");
} }
void Client::SendClearAA() void Client::SendClearAA()
@ -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, MessageString(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, MessageString(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); MessageString(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); MessageString(Chat::SpellFailure, STAND_TO_CAST);
return; return;
} }
} }

View File

@ -52,12 +52,12 @@ void EntityList::CheckClientAggro(Client *around)
void EntityList::DescribeAggro(Client *towho, NPC *from_who, float d, bool verbose) { void EntityList::DescribeAggro(Client *towho, NPC *from_who, float d, bool verbose) {
float d2 = d*d; float d2 = d*d;
towho->Message(0, "Describing aggro for %s", from_who->GetName()); towho->Message(Chat::White, "Describing aggro for %s", from_who->GetName());
bool engaged = from_who->IsEngaged(); bool engaged = from_who->IsEngaged();
if(engaged) { if(engaged) {
Mob *top = from_who->GetHateTop(); Mob *top = from_who->GetHateTop();
towho->Message(0, ".. I am currently fighting with %s", top == nullptr?"(nullptr)":top->GetName()); towho->Message(Chat::White, ".. I am currently fighting with %s", top == nullptr?"(nullptr)":top->GetName());
} }
bool check_npcs = from_who->WillAggroNPCs(); bool check_npcs = from_who->WillAggroNPCs();
@ -77,7 +77,7 @@ void EntityList::DescribeAggro(Client *towho, NPC *from_who, float d, bool verbo
if(!database.GetFactionName(my_primary, namebuf, sizeof(namebuf))) if(!database.GetFactionName(my_primary, namebuf, sizeof(namebuf)))
strcpy(namebuf, "(Unknown)"); strcpy(namebuf, "(Unknown)");
} }
towho->Message(0, ".. I am on faction %s (%d)\n", namebuf, my_primary); towho->Message(Chat::White, ".. I am on faction %s (%d)\n", namebuf, my_primary);
} }
for (auto it = mob_list.begin(); it != mob_list.end(); ++it) { for (auto it = mob_list.begin(); it != mob_list.end(); ++it) {
@ -91,11 +91,11 @@ void EntityList::DescribeAggro(Client *towho, NPC *from_who, float d, bool verbo
if (engaged) { if (engaged) {
uint32 amm = from_who->GetHateAmount(mob); uint32 amm = from_who->GetHateAmount(mob);
if (amm == 0) if (amm == 0)
towho->Message(0, "... %s is not on my hate list.", mob->GetName()); towho->Message(Chat::White, "... %s is not on my hate list.", mob->GetName());
else else
towho->Message(0, "... %s is on my hate list with value %lu", mob->GetName(), (unsigned long)amm); towho->Message(Chat::White, "... %s is on my hate list with value %lu", mob->GetName(), (unsigned long)amm);
} else if (!check_npcs && mob->IsNPC()) { } else if (!check_npcs && mob->IsNPC()) {
towho->Message(0, "... %s is an NPC and my npc_aggro is disabled.", mob->GetName()); towho->Message(Chat::White, "... %s is an NPC and my npc_aggro is disabled.", mob->GetName());
} else { } else {
from_who->DescribeAggro(towho, mob, verbose); from_who->DescribeAggro(towho, mob, verbose);
} }
@ -114,13 +114,13 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) {
if(( t1 > iAggroRange) if(( t1 > iAggroRange)
|| ( t2 > iAggroRange) || ( t2 > iAggroRange)
|| ( t3 > iAggroRange) ) { || ( t3 > iAggroRange) ) {
towho->Message(0, "...%s is out of range (fast). distances (%.3f,%.3f,%.3f), range %.3f", mob->GetName(), towho->Message(Chat::White, "...%s is out of range (fast). distances (%.3f,%.3f,%.3f), range %.3f", mob->GetName(),
t1, t2, t3, iAggroRange); t1, t2, t3, iAggroRange);
return; return;
} }
if(mob->IsInvisible(this)) { if(mob->IsInvisible(this)) {
towho->Message(0, "...%s is invisible to me. ", mob->GetName()); towho->Message(Chat::White, "...%s is invisible to me. ", mob->GetName());
return; return;
} }
if((mob->IsClient() && if((mob->IsClient() &&
@ -131,13 +131,13 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) {
) )
)) ))
{ {
towho->Message(0, "...%s is my owner. ", mob->GetName()); towho->Message(Chat::White, "...%s is my owner. ", mob->GetName());
return; return;
} }
if(mob == GetOwner()) { if(mob == GetOwner()) {
towho->Message(0, "...%s a GM or is not connected. ", mob->GetName()); towho->Message(Chat::White, "...%s a GM or is not connected. ", mob->GetName());
return; return;
} }
@ -145,7 +145,7 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) {
float iAggroRange2 = iAggroRange*iAggroRange; float iAggroRange2 = iAggroRange*iAggroRange;
if( dist2 > iAggroRange2 ) { if( dist2 > iAggroRange2 ) {
towho->Message(0, "...%s is out of range. %.3f > %.3f ", mob->GetName(), towho->Message(Chat::White, "...%s is out of range. %.3f > %.3f ", mob->GetName(),
dist2, iAggroRange2); dist2, iAggroRange2);
return; return;
} }
@ -154,14 +154,14 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) {
{ {
if (GetLevel() < RuleI(Aggro, MinAggroLevel) && mob->GetLevelCon(GetLevel()) == CON_GRAY && GetBodyType() != 3) if (GetLevel() < RuleI(Aggro, MinAggroLevel) && mob->GetLevelCon(GetLevel()) == CON_GRAY && GetBodyType() != 3)
{ {
towho->Message(0, "...%s is red to me (basically)", mob->GetName(), dist2, iAggroRange2); towho->Message(Chat::White, "...%s is red to me (basically)", mob->GetName(), dist2, iAggroRange2);
return; return;
} }
} }
else else
{ {
if(GetINT() > RuleI(Aggro, IntAggroThreshold) && mob->GetLevelCon(GetLevel()) == CON_GRAY ) { if(GetINT() > RuleI(Aggro, IntAggroThreshold) && mob->GetLevelCon(GetLevel()) == CON_GRAY ) {
towho->Message(0, "...%s is red to me (basically)", mob->GetName(), towho->Message(Chat::White, "...%s is red to me (basically)", mob->GetName(),
dist2, iAggroRange2); dist2, iAggroRange2);
return; return;
} }
@ -178,9 +178,9 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) {
mob_primary = own->GetPrimaryFaction(); mob_primary = own->GetPrimaryFaction();
if(mob_primary == 0) { if(mob_primary == 0) {
towho->Message(0, "...%s has no primary faction", mob->GetName()); towho->Message(Chat::White, "...%s has no primary faction", mob->GetName());
} else if(mob_primary < 0) { } else if(mob_primary < 0) {
towho->Message(0, "...%s is on special faction %d", mob->GetName(), mob_primary); towho->Message(Chat::White, "...%s is on special faction %d", mob->GetName(), mob_primary);
} else { } else {
char namebuf[256]; char namebuf[256];
if(!database.GetFactionName(mob_primary, namebuf, sizeof(namebuf))) if(!database.GetFactionName(mob_primary, namebuf, sizeof(namebuf)))
@ -193,22 +193,22 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) {
struct NPCFaction* fac = *cur; struct NPCFaction* fac = *cur;
if ((int32)fac->factionID == mob_primary) { if ((int32)fac->factionID == mob_primary) {
if (fac->npc_value > 0) { if (fac->npc_value > 0) {
towho->Message(0, "...%s is on ALLY faction %s (%d) with %d", mob->GetName(), namebuf, mob_primary, fac->npc_value); towho->Message(Chat::White, "...%s is on ALLY faction %s (%d) with %d", mob->GetName(), namebuf, mob_primary, fac->npc_value);
res = true; res = true;
break; break;
} else if (fac->npc_value < 0) { } else if (fac->npc_value < 0) {
towho->Message(0, "...%s is on ENEMY faction %s (%d) with %d", mob->GetName(), namebuf, mob_primary, fac->npc_value); towho->Message(Chat::White, "...%s is on ENEMY faction %s (%d) with %d", mob->GetName(), namebuf, mob_primary, fac->npc_value);
res = true; res = true;
break; break;
} else { } else {
towho->Message(0, "...%s is on NEUTRAL faction %s (%d) with 0", mob->GetName(), namebuf, mob_primary); towho->Message(Chat::White, "...%s is on NEUTRAL faction %s (%d) with 0", mob->GetName(), namebuf, mob_primary);
res = true; res = true;
break; break;
} }
} }
} }
if(!res) { if(!res) {
towho->Message(0, "...%s is on faction %s (%d), which I have no entry for.", mob->GetName(), namebuf, mob_primary); towho->Message(Chat::White, "...%s is on faction %s (%d), which I have no entry for.", mob->GetName(), namebuf, mob_primary);
} }
} }
} }
@ -222,18 +222,18 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) {
|| ||
fv == FACTION_THREATENLY fv == FACTION_THREATENLY
)) { )) {
towho->Message(0, "...%s faction not low enough. value='%s'", mob->GetName(), FactionValueToString(fv)); towho->Message(Chat::White, "...%s faction not low enough. value='%s'", mob->GetName(), FactionValueToString(fv));
return; return;
} }
if(fv == FACTION_THREATENLY) { if(fv == FACTION_THREATENLY) {
towho->Message(0, "...%s threatening to me, so they only have a %d chance per check of attacking.", mob->GetName()); towho->Message(Chat::White, "...%s threatening to me, so they only have a %d chance per check of attacking.", mob->GetName());
} }
if(!CheckLosFN(mob)) { if(!CheckLosFN(mob)) {
towho->Message(0, "...%s is out of sight.", mob->GetName()); towho->Message(Chat::White, "...%s is out of sight.", mob->GetName());
} }
towho->Message(0, "...%s meets all conditions, I should be attacking them.", mob->GetName()); towho->Message(Chat::White, "...%s meets all conditions, I should be attacking them.", mob->GetName());
} }
/* /*
@ -973,11 +973,13 @@ bool Mob::CombatRange(Mob* other)
} }
//Father Nitwit's LOS code //Father Nitwit's LOS code
bool Mob::CheckLosFN(Mob* other) { bool Mob::CheckLosFN(Mob *other)
{
bool Result = false; bool Result = false;
if(other) if (other) {
Result = CheckLosFN(other->GetX(), other->GetY(), other->GetZ(), other->GetSize()); Result = CheckLosFN(other->GetX(), other->GetY(), other->GetZ(), other->GetSize());
}
SetLastLosState(Result); SetLastLosState(Result);

View File

@ -225,7 +225,7 @@ Json::Value ApiGetNpcListDetail(EQ::Net::WebsocketServerConnection *connection,
row["sec_skill"] = npc->GetSecSkill(); row["sec_skill"] = npc->GetSecSkill();
row["silver"] = npc->GetSilver(); row["silver"] = npc->GetSilver();
row["slow_mitigation"] = npc->GetSlowMitigation(); row["slow_mitigation"] = npc->GetSlowMitigation();
row["sp2"] = npc->GetSp2(); row["spawn_group_id"] = npc->GetSpawnGroupId();
row["swarm_owner"] = npc->GetSwarmOwner(); row["swarm_owner"] = npc->GetSwarmOwner();
row["swarm_target"] = npc->GetSwarmTarget(); row["swarm_target"] = npc->GetSwarmTarget();
row["waypoint_max"] = npc->GetWaypointMax(); row["waypoint_max"] = npc->GetWaypointMax();

View File

@ -34,6 +34,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "lua_parser.h" #include "lua_parser.h"
#include "fastmath.h" #include "fastmath.h"
#include "mob.h" #include "mob.h"
#include "npc.h"
#include <assert.h> #include <assert.h>
@ -1319,7 +1320,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, MessageString(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 +1341,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->MessageString(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->MessageString(Chat::Stun, SHAKE_OFF_STUN);
} else { } else {
other->Stun(3000); // yuck -- 3 seconds other->Stun(3000); // yuck -- 3 seconds
} }
@ -1392,7 +1393,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 cancelled, Divine Aura is in effect."); Log(Logs::Detail, Logs::Combat, "Attack cancelled, Divine Aura is in effect.");
Message_StringID(MT_DefaultText, DIVINE_AURA_NO_ATK); //You can't attack while invulnerable! MessageString(Chat::DefaultText, DIVINE_AURA_NO_ATK); //You can't attack while invulnerable
return false; return false;
} }
@ -1615,16 +1616,16 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, EQEmu::skills::Sk
if (killerMob && killerMob->IsClient() && (spell != SPELL_UNKNOWN) && damage > 0) { if (killerMob && killerMob->IsClient() && (spell != SPELL_UNKNOWN) && damage > 0) {
char val1[20] = { 0 }; char val1[20] = { 0 };
entity_list.MessageClose_StringID( entity_list.MessageCloseString(
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 */
ConvertArray(damage, val1)/* Message3 */ ConvertArray(damage, val1)/* Message3 */
); );
} }
int exploss = 0; int exploss = 0;
@ -1914,7 +1915,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
//Check that we can attack before we calc heading and face our target //Check that we can attack before we calc heading and face our target
if (!IsAttackAllowed(other)) { if (!IsAttackAllowed(other)) {
if (this->GetOwnerID()) if (this->GetOwnerID())
this->Say_StringID(NOT_LEGAL_TARGET); this->SayString(NOT_LEGAL_TARGET);
if (other) { if (other) {
if (other->IsClient()) if (other->IsClient())
other->CastToClient()->RemoveXTarget(this, false); other->CastToClient()->RemoveXTarget(this, false);
@ -2129,7 +2130,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, EQEmu::skills::Skill
{ {
if (IsLDoNTrapped()) if (IsLDoNTrapped())
{ {
Message_StringID(13, LDON_ACCIDENT_SETOFF2); MessageString(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);
@ -2169,16 +2170,16 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQEmu::skills::Skil
if (killer_mob->IsClient() && (spell != SPELL_UNKNOWN) && damage > 0) { if (killer_mob->IsClient() && (spell != SPELL_UNKNOWN) && damage > 0) {
char val1[20] = { 0 }; char val1[20] = { 0 };
entity_list.MessageClose_StringID( entity_list.MessageCloseString(
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 */
ConvertArray(damage, val1) /* Message3 */ ConvertArray(damage, val1) /* Message3 */
); );
} }
} }
else { else {
@ -3425,7 +3426,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 +3440,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()); MessageString(Chat::NPCQuestSay, PET_ATTACKING, pet->GetCleanName(), attacker->GetCleanName());
} }
} }
@ -3459,7 +3460,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.
@ -3507,15 +3508,15 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
//fade mez if we are mezzed //fade mez if we are mezzed
if (IsMezzed() && attacker) { if (IsMezzed() && attacker) {
Log(Logs::Detail, Logs::Combat, "Breaking mez due to attack."); Log(Logs::Detail, Logs::Combat, "Breaking mez due to attack.");
entity_list.MessageClose_StringID( entity_list.MessageCloseString(
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 */
); );
BuffFadeByEffect(SE_Mez); BuffFadeByEffect(SE_Mez);
} }
@ -3564,13 +3565,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); MessageString(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); MessageString(Chat::Stun, AVOID_STUNNING_BLOW);
} }
} }
else { else {
@ -3650,7 +3651,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->MessageString(Chat::NonMelee, OTHER_HIT_NONMELEE, GetCleanName(), ConvertArray(damage, val1));
} }
else { else {
if (damage > 0) { if (damage > 0) {
@ -3680,19 +3681,19 @@ 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->MessageString(Chat::DamageShield, OTHER_HIT_NONMELEE, GetCleanName(), ConvertArray(damage, val1));
} }
else { else {
entity_list.MessageClose_StringID( entity_list.MessageCloseString(
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 */
ConvertArray(damage, val1) /* Message3 */ ConvertArray(damage, val1) /* Message3 */
); );
} }
} }
else { else {
@ -3754,22 +3755,22 @@ 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->FilteredMessageString(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 */
entity_list.FilteredMessageClose_StringID( entity_list.FilteredMessageCloseString(
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 +3793,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, FilteredMessageString(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, FilteredMessageString(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->FilteredMessageString(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->FilteredMessageString(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, FilteredMessageString(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, FilteredMessageString(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, FilteredMessageString(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->FilteredMessageString(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 +3994,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->MessageString(Chat::Red, PROC_PETTOOLOW);
} }
else { else {
Message_StringID(13, PROC_TOOLOW); MessageString(Chat::Red, PROC_TOOLOW);
} }
} }
else { else {
@ -4030,10 +4031,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->MessageString(Chat::Red, PROC_PETTOOLOW);
} }
else { else {
Message_StringID(13, PROC_TOOLOW); MessageString(Chat::Red, PROC_TOOLOW);
} }
} }
else { else {
@ -4183,16 +4184,16 @@ void Mob::TryPetCriticalHit(Mob *defender, DamageHitInfo &hit)
hit.damage_done += 5; hit.damage_done += 5;
hit.damage_done = (hit.damage_done * critMod) / 100; hit.damage_done = (hit.damage_done * critMod) / 100;
entity_list.FilteredMessageClose_StringID( entity_list.FilteredMessageCloseString(
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 */
itoa(hit.damage_done + hit.min_damage) /* Message2 */ itoa(hit.damage_done + hit.min_damage) /* Message2 */
); );
} }
} }
@ -4243,29 +4244,29 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
/* Female */ /* Female */
if (GetGender() == 1) { if (GetGender() == 1) {
entity_list.FilteredMessageClose_StringID( entity_list.FilteredMessageCloseString(
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 */
itoa(hit.damage_done + hit.min_damage) /* Message2 */ itoa(hit.damage_done + hit.min_damage) /* Message2 */
); );
} }
/* Males and Neuter */ /* Males and Neuter */
else { else {
entity_list.FilteredMessageClose_StringID( entity_list.FilteredMessageCloseString(
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 */
itoa(hit.damage_done + hit.min_damage) /* Message2 */ itoa(hit.damage_done + hit.min_damage) /* Message2 */
); );
} }
return; return;
} }
@ -4340,16 +4341,16 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
} }
hit.damage_done = hit.damage_done * 200 / 100; hit.damage_done = hit.damage_done * 200 / 100;
entity_list.FilteredMessageClose_StringID( entity_list.FilteredMessageCloseString(
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 */
itoa(hit.damage_done + hit.min_damage) /* Message2 */ itoa(hit.damage_done + hit.min_damage) /* Message2 */
); );
return; return;
} }
} }
@ -4368,16 +4369,16 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
hit.damage_done += og_damage * 119 / 100; hit.damage_done += og_damage * 119 / 100;
Log(Logs::Detail, Logs::Combat, "Crip damage %d", hit.damage_done); Log(Logs::Detail, Logs::Combat, "Crip damage %d", hit.damage_done);
entity_list.FilteredMessageClose_StringID( entity_list.FilteredMessageCloseString(
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 */
itoa(hit.damage_done + hit.min_damage) /* Message2 */ itoa(hit.damage_done + hit.min_damage) /* Message2 */
); );
// Crippling blows also have a chance to stun // Crippling blows also have a chance to stun
// Kayen: Crippling Blow would cause a chance to interrupt for npcs < 55, with a // Kayen: Crippling Blow would cause a chance to interrupt for npcs < 55, with a
@ -4390,16 +4391,16 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
} }
/* Normal Critical hit message */ /* Normal Critical hit message */
entity_list.FilteredMessageClose_StringID( entity_list.FilteredMessageCloseString(
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 */
itoa(hit.damage_done + hit.min_damage) /* Message2 */ itoa(hit.damage_done + hit.min_damage) /* Message2 */
); );
} }
} }
} }
@ -4427,15 +4428,15 @@ bool Mob::TryFinishingBlow(Mob *defender, int &damage)
(ProcChance >= zone->random.Int(1, 1000))) { (ProcChance >= zone->random.Int(1, 1000))) {
/* Finishing Blow Critical Message */ /* Finishing Blow Critical Message */
entity_list.FilteredMessageClose_StringID( entity_list.FilteredMessageCloseString(
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 */
); );
damage = FB_Dmg; damage = FB_Dmg;
return true; return true;
@ -4453,7 +4454,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->MessageString(Chat::TooFarAway, CANT_SEE_TARGET);
return; return;
} }
@ -5042,7 +5043,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); MessageString(Chat::MeleeCrit, BOW_DOUBLE_DAMAGE);
} }
} }
} }
@ -5347,7 +5348,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); MessageString(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); MessageString(Chat::SpellFailure, NO_MORE_TRAPS);
return false; return false;
} else if (!trap && !HasFreeAuraSlots()) { } else if (!trap && !HasFreeAuraSlots()) {
Message_StringID(MT_SpellFailure, NO_MORE_AURAS); MessageString(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;
} }
@ -2276,12 +2276,12 @@ void Bot::AI_Process() {
// Berserk updates should occur if primary AI criteria are met // Berserk updates should occur if primary AI criteria are met
if (GetClass() == WARRIOR || GetClass() == BERSERKER) { if (GetClass() == WARRIOR || GetClass() == BERSERKER) {
if (!berserk && GetHP() > 0 && GetHPRatio() < 30.0f) { if (!berserk && GetHP() > 0 && GetHPRatio() < 30.0f) {
entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_START, GetName()); entity_list.MessageCloseString(this, false, 200, 0, BERSERK_START, GetName());
berserk = true; berserk = true;
} }
if (berserk && GetHPRatio() >= 30.0f) { if (berserk && GetHPRatio() >= 30.0f) {
entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_END, GetName()); entity_list.MessageCloseString(this, false, 200, 0, BERSERK_END, GetName());
berserk = false; berserk = 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); MessageString(Chat::NPCFlurry, YOU_FLURRY);
Attack(tar, EQEmu::invslot::slotPrimary, false); Attack(tar, EQEmu::invslot::slotPrimary, false);
TEST_TARGET(); TEST_TARGET();
@ -3256,9 +3256,9 @@ bool Bot::Spawn(Client* botCharacterOwner) {
this->texture = 0; //0xFF; this->texture = 0; //0xFF;
if(this->Save()) if(this->Save())
this->GetBotOwner()->CastToClient()->Message(0, "%s saved.", this->GetCleanName()); this->GetBotOwner()->CastToClient()->Message(Chat::White, "%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;
} }
@ -3838,32 +3838,32 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
} }
if (client != GetOwner()) { if (client != GetOwner()) {
client->Message(CC_Red, "You are not the owner of this bot - Trade Canceled."); client->Message(Chat::Red, "You are not the owner of this bot - Trade Canceled.");
client->ResetTrade(); client->ResetTrade();
return; return;
} }
if ((beginSlotID != invslot::TRADE_BEGIN) && (beginSlotID != invslot::slotCursor)) { if ((beginSlotID != invslot::TRADE_BEGIN) && (beginSlotID != invslot::slotCursor)) {
client->Message(CC_Red, "Trade request processing from illegal 'begin' slot - Trade Canceled."); client->Message(Chat::Red, "Trade request processing from illegal 'begin' slot - Trade Canceled.");
client->ResetTrade(); client->ResetTrade();
return; return;
} }
if ((endSlotID != invslot::TRADE_END) && (endSlotID != invslot::slotCursor)) { if ((endSlotID != invslot::TRADE_END) && (endSlotID != invslot::slotCursor)) {
client->Message(CC_Red, "Trade request processing from illegal 'end' slot - Trade Canceled."); client->Message(Chat::Red, "Trade request processing from illegal 'end' slot - Trade Canceled.");
client->ResetTrade(); client->ResetTrade();
return; return;
} }
if (((beginSlotID == invslot::slotCursor) && (endSlotID != invslot::slotCursor)) || ((beginSlotID != invslot::slotCursor) && (endSlotID == invslot::slotCursor))) { if (((beginSlotID == invslot::slotCursor) && (endSlotID != invslot::slotCursor)) || ((beginSlotID != invslot::slotCursor) && (endSlotID == invslot::slotCursor))) {
client->Message(CC_Red, "Trade request processing illegal slot range - Trade Canceled."); client->Message(Chat::Red, "Trade request processing illegal slot range - Trade Canceled.");
client->ResetTrade(); client->ResetTrade();
return; return;
} }
if (endSlotID < beginSlotID) { if (endSlotID < beginSlotID) {
client->Message(CC_Red, "Trade request processing in reverse slot order - Trade Canceled."); client->Message(Chat::Red, "Trade request processing in reverse slot order - Trade Canceled.");
client->ResetTrade(); client->ResetTrade();
return; return;
} }
if (client->IsEngaged() || IsEngaged()) { if (client->IsEngaged() || IsEngaged()) {
client->Message(CC_Yellow, "You may not perform a trade while engaged - Trade Canceled!"); client->Message(Chat::Yellow, "You may not perform a trade while engaged - Trade Canceled!");
client->ResetTrade(); client->ResetTrade();
return; return;
} }
@ -3879,23 +3879,23 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
if (!trade_instance->GetItem()) { if (!trade_instance->GetItem()) {
// TODO: add logging // TODO: add logging
client->Message(CC_Red, "A server error was encountered while processing client slot %i - Trade Canceled.", trade_index); client->Message(Chat::Red, "A server error was encountered while processing client slot %i - Trade Canceled.", trade_index);
client->ResetTrade(); client->ResetTrade();
return; return;
} }
if ((trade_index != invslot::slotCursor) && !trade_instance->IsDroppable()) { if ((trade_index != invslot::slotCursor) && !trade_instance->IsDroppable()) {
// TODO: add logging // TODO: add logging
client->Message(CC_Red, "Trade hack detected - Trade Canceled."); client->Message(Chat::Red, "Trade hack detected - Trade Canceled.");
client->ResetTrade(); client->ResetTrade();
return; return;
} }
if (trade_instance->IsStackable() && (trade_instance->GetCharges() < trade_instance->GetItem()->StackSize)) { // temp until partial stacks are implemented if (trade_instance->IsStackable() && (trade_instance->GetCharges() < trade_instance->GetItem()->StackSize)) { // temp until partial stacks are implemented
client->Message(CC_Yellow, "'%s' is only a partially stacked item - Trade Canceled!", trade_instance->GetItem()->Name); client->Message(Chat::Yellow, "'%s' is only a partially stacked item - Trade Canceled!", trade_instance->GetItem()->Name);
client->ResetTrade(); client->ResetTrade();
return; return;
} }
if (CheckLoreConflict(trade_instance->GetItem())) { if (CheckLoreConflict(trade_instance->GetItem())) {
client->Message(CC_Yellow, "This bot already has lore equipment matching the item '%s' - Trade Canceled!", trade_instance->GetItem()->Name); client->Message(Chat::Yellow, "This bot already has lore equipment matching the item '%s' - Trade Canceled!", trade_instance->GetItem()->Name);
client->ResetTrade(); client->ResetTrade();
return; return;
} }
@ -3925,13 +3925,13 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
if ((trade_iterator.tradeItemInstance->GetItem()->LoreGroup == -1) && (check_iterator.tradeItemInstance->GetItem()->ID == trade_iterator.tradeItemInstance->GetItem()->ID)) { if ((trade_iterator.tradeItemInstance->GetItem()->LoreGroup == -1) && (check_iterator.tradeItemInstance->GetItem()->ID == trade_iterator.tradeItemInstance->GetItem()->ID)) {
// TODO: add logging // TODO: add logging
client->Message(CC_Red, "Trade hack detected - Trade Canceled."); client->Message(Chat::Red, "Trade hack detected - Trade Canceled.");
client->ResetTrade(); client->ResetTrade();
return; return;
} }
if ((trade_iterator.tradeItemInstance->GetItem()->LoreGroup > 0) && (check_iterator.tradeItemInstance->GetItem()->LoreGroup == trade_iterator.tradeItemInstance->GetItem()->LoreGroup)) { if ((trade_iterator.tradeItemInstance->GetItem()->LoreGroup > 0) && (check_iterator.tradeItemInstance->GetItem()->LoreGroup == trade_iterator.tradeItemInstance->GetItem()->LoreGroup)) {
// TODO: add logging // TODO: add logging
client->Message(CC_Red, "Trade hack detected - Trade Canceled."); client->Message(Chat::Red, "Trade hack detected - Trade Canceled.");
client->ResetTrade(); client->ResetTrade();
return; return;
} }
@ -4040,14 +4040,14 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
if (!return_instance->GetItem()) { if (!return_instance->GetItem()) {
// TODO: add logging // TODO: add logging
client->Message(CC_Red, "A server error was encountered while processing bot slot %i - Trade Canceled.", return_iterator.fromBotSlot); client->Message(Chat::Red, "A server error was encountered while processing bot slot %i - Trade Canceled.", return_iterator.fromBotSlot);
client->ResetTrade(); client->ResetTrade();
return; return;
} }
// non-failing checks above are causing this to trigger (i.e., !ItemClassCommon and !IsEquipable{race, class, min_level}) // non-failing checks above are causing this to trigger (i.e., !ItemClassCommon and !IsEquipable{race, class, min_level})
// this process is hindered by not having bots use the inventory trade method (TODO: implement bot inventory use) // this process is hindered by not having bots use the inventory trade method (TODO: implement bot inventory use)
if (client->CheckLoreConflict(return_instance->GetItem())) { if (client->CheckLoreConflict(return_instance->GetItem())) {
client->Message(CC_Yellow, "You already have lore equipment matching the item '%s' - Trade Canceled!", return_instance->GetItem()->Name); client->Message(Chat::Yellow, "You already have lore equipment matching the item '%s' - Trade Canceled!", return_instance->GetItem()->Name);
client->ResetTrade(); client->ResetTrade();
return; return;
} }
@ -4104,7 +4104,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
} }
if (return_iterator.toClientSlot == invslot::SLOT_INVALID) { if (return_iterator.toClientSlot == invslot::SLOT_INVALID) {
client->Message(CC_Yellow, "You do not have room to complete this trade - Trade Canceled!"); client->Message(Chat::Yellow, "You do not have room to complete this trade - Trade Canceled!");
client->ResetTrade(); client->ResetTrade();
return; return;
} }
@ -4130,7 +4130,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
//} //}
if (!database.botdb.DeleteItemBySlot(GetBotID(), return_iterator.fromBotSlot)) if (!database.botdb.DeleteItemBySlot(GetBotID(), return_iterator.fromBotSlot))
client->Message(CC_Red, "%s (slot: %i, name: '%s')", BotDatabase::fail::DeleteItemBySlot(), return_iterator.fromBotSlot, (return_instance ? return_instance->GetItem()->Name : "nullptr")); client->Message(Chat::Red, "%s (slot: %i, name: '%s')", BotDatabase::fail::DeleteItemBySlot(), return_iterator.fromBotSlot, (return_instance ? return_instance->GetItem()->Name : "nullptr"));
BotRemoveEquipItem(return_iterator.fromBotSlot); BotRemoveEquipItem(return_iterator.fromBotSlot);
if (return_instance) if (return_instance)
@ -4145,7 +4145,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
// TODO: code for stackables // TODO: code for stackables
if (!database.botdb.SaveItemBySlot(this, trade_iterator.toBotSlot, trade_iterator.tradeItemInstance)) if (!database.botdb.SaveItemBySlot(this, trade_iterator.toBotSlot, trade_iterator.tradeItemInstance))
client->Message(CC_Red, "%s (slot: %i, name: '%s')", BotDatabase::fail::SaveItemBySlot(), trade_iterator.toBotSlot, (trade_iterator.tradeItemInstance ? trade_iterator.tradeItemInstance->GetItem()->Name : "nullptr")); client->Message(Chat::Red, "%s (slot: %i, name: '%s')", BotDatabase::fail::SaveItemBySlot(), trade_iterator.toBotSlot, (trade_iterator.tradeItemInstance ? trade_iterator.tradeItemInstance->GetItem()->Name : "nullptr"));
m_inv.PutItem(trade_iterator.toBotSlot, *trade_iterator.tradeItemInstance); m_inv.PutItem(trade_iterator.toBotSlot, *trade_iterator.tradeItemInstance);
this->BotAddEquipItem(trade_iterator.toBotSlot, (trade_iterator.tradeItemInstance ? trade_iterator.tradeItemInstance->GetID() : 0)); this->BotAddEquipItem(trade_iterator.toBotSlot, (trade_iterator.tradeItemInstance ? trade_iterator.tradeItemInstance->GetID() : 0));
@ -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());
@ -4190,9 +4190,9 @@ bool Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, EQEmu::skills::Sk
Mob *my_owner = GetBotOwner(); Mob *my_owner = GetBotOwner();
if (my_owner && my_owner->IsClient() && my_owner->CastToClient()->GetBotOptionDeathMarquee()) { if (my_owner && my_owner->IsClient() && my_owner->CastToClient()->GetBotOptionDeathMarquee()) {
if (killerMob) if (killerMob)
my_owner->CastToClient()->SendMarqueeMessage(CC_Yellow, 510, 0, 1000, 3000, StringFormat("%s has been slain by %s", GetCleanName(), killerMob->GetCleanName())); my_owner->CastToClient()->SendMarqueeMessage(Chat::Yellow, 510, 0, 1000, 3000, StringFormat("%s has been slain by %s", GetCleanName(), killerMob->GetCleanName()));
else else
my_owner->CastToClient()->SendMarqueeMessage(CC_Yellow, 510, 0, 1000, 3000, StringFormat("%s has been slain", GetCleanName())); my_owner->CastToClient()->SendMarqueeMessage(Chat::Yellow, 510, 0, 1000, 3000, StringFormat("%s has been slain", GetCleanName()));
} }
Mob *give_exp = hate_list.GetDamageTopOnHateList(this); Mob *give_exp = hate_list.GetDamageTopOnHateList(this);
@ -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.MessageCloseString(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.MessageCloseString(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;
} }
@ -5987,7 +5987,7 @@ bool Bot::ProcessGuildRemoval(Client* guildOfficer, std::string botName) {
GuildManageRemove_Struct* gm = (GuildManageRemove_Struct*) outapp->pBuffer; GuildManageRemove_Struct* gm = (GuildManageRemove_Struct*) outapp->pBuffer;
gm->guildeqid = guildOfficer->GuildID(); gm->guildeqid = guildOfficer->GuildID();
strcpy(gm->member, botName.c_str()); strcpy(gm->member, botName.c_str());
guildOfficer->Message(0, "%s successfully removed from your guild.", botName.c_str()); guildOfficer->Message(Chat::White, "%s successfully removed from your guild.", botName.c_str());
entity_list.QueueClientsGuild(guildOfficer, outapp, false, gm->guildeqid); entity_list.QueueClientsGuild(guildOfficer, outapp, false, gm->guildeqid);
safe_delete(outapp); safe_delete(outapp);
} }
@ -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); MessageString(Chat::Red, SILENCED_STRING);
if(IsAmnesiad() && IsDiscipline(spell_id)) if(IsAmnesiad() && IsDiscipline(spell_id))
Message_StringID(13, MELEE_SILENCE); MessageString(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); MessageString(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(Chat::White, "%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());
} }
} }
} }
@ -8868,7 +8868,7 @@ bool Bot::UseDiscipline(uint32 spell_id, uint32 target) {
SetDisciplineRecastTimer(spells[spell_id].EndurTimerIndex, spell.recast_time); SetDisciplineRecastTimer(spells[spell_id].EndurTimerIndex, spell.recast_time);
} else { } else {
uint32 remain = (GetDisciplineRemainingTime(this, spells[spell_id].EndurTimerIndex) / 1000); uint32 remain = (GetDisciplineRemainingTime(this, spells[spell_id].EndurTimerIndex) / 1000);
GetOwner()->Message(0, "%s can use this discipline in %d minutes %d seconds.", GetCleanName(), (remain / 60), (remain % 60)); GetOwner()->Message(Chat::White, "%s can use this discipline in %d minutes %d seconds.", GetCleanName(), (remain / 60), (remain % 60));
return false; return false;
} }
} }
@ -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::White
#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->MessageString(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->MessageString(Chat::White, 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->MessageString(Chat::White, PICK_LORE);
return; return;
} }
@ -7454,7 +7454,7 @@ void bot_subcommand_pet_get_lost(Client *c, const Seperator *sep)
if (!bot_iter->GetPet() || bot_iter->GetPet()->IsCharmed()) if (!bot_iter->GetPet() || bot_iter->GetPet()->IsCharmed())
continue; continue;
bot_iter->GetPet()->Say_StringID(PET_GETLOST_STRING); bot_iter->GetPet()->SayString(PET_GETLOST_STRING);
bot_iter->GetPet()->Depop(false); bot_iter->GetPet()->Depop(false);
bot_iter->SetPetID(0); bot_iter->SetPetID(0);
database.botdb.DeletePetItems(bot_iter->GetBotID()); database.botdb.DeletePetItems(bot_iter->GetBotID());
@ -7500,7 +7500,7 @@ void bot_subcommand_pet_remove(Client *c, const Seperator *sep)
} }
if (bot_iter->GetPet()) { if (bot_iter->GetPet()) {
bot_iter->GetPet()->Say_StringID(PET_GETLOST_STRING); bot_iter->GetPet()->SayString(PET_GETLOST_STRING);
bot_iter->GetPet()->Depop(false); bot_iter->GetPet()->Depop(false);
bot_iter->SetPetID(0); bot_iter->SetPetID(0);
} }

View File

@ -136,6 +136,7 @@ Client::Client(EQStreamInterface* ieqs)
forget_timer(0), forget_timer(0),
autosave_timer(RuleI(Character, AutosaveIntervalS) * 1000), autosave_timer(RuleI(Character, AutosaveIntervalS) * 1000),
client_scan_npc_aggro_timer(RuleI(Aggro, ClientAggroCheckInterval) * 1000), client_scan_npc_aggro_timer(RuleI(Aggro, ClientAggroCheckInterval) * 1000),
client_zone_wide_full_position_update_timer(5 * 60 * 1000),
tribute_timer(Tribute_duration), tribute_timer(Tribute_duration),
proximity_timer(ClientProximity_interval), proximity_timer(ClientProximity_interval),
TaskPeriodic_Timer(RuleI(TaskSystem, PeriodicCheckTimer) * 1000), TaskPeriodic_Timer(RuleI(TaskSystem, PeriodicCheckTimer) * 1000),
@ -845,7 +846,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
{ {
if(AttemptedMessages > RuleI(Chat, MaxMessagesBeforeKick)) if(AttemptedMessages > RuleI(Chat, MaxMessagesBeforeKick))
{ {
Kick(); Kick("Sent too many chat messages at once.");
return; return;
} }
if(GlobalChatLimiterTimer) if(GlobalChatLimiterTimer)
@ -913,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. MessageString(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))
@ -1096,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;
@ -1115,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;
@ -1264,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;
@ -1508,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 MessageString( 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) {
@ -2046,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();
@ -2549,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)
@ -2577,22 +2578,28 @@ void Client::SetPVP(bool toggle, bool message) {
if (message) { if (message) {
if(GetPVP()) if(GetPVP())
this->Message_StringID(MT_Shout,PVP_ON); this->MessageString(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());
Save(); Save();
} }
void Client::Kick(const std::string &reason) {
client_state = CLIENT_KICKED;
Log(Logs::General, Logs::Client_Login, "Client [%s] kicked, reason [%s]", GetCleanName(), reason.c_str());
}
void Client::WorldKick() { void Client::WorldKick() {
auto outapp = new EQApplicationPacket(OP_GMKick, sizeof(GMKick_Struct)); auto outapp = new EQApplicationPacket(OP_GMKick, sizeof(GMKick_Struct));
GMKick_Struct* gmk = (GMKick_Struct *)outapp->pBuffer; GMKick_Struct* gmk = (GMKick_Struct *)outapp->pBuffer;
strcpy(gmk->name,GetName()); strcpy(gmk->name,GetName());
QueuePacket(outapp); QueuePacket(outapp);
safe_delete(outapp); safe_delete(outapp);
Kick(); Kick("World kick issued");
} }
void Client::GMKill() { void Client::GMKill() {
@ -2707,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); MessageString(Chat::Skills, DISARMED);
if (disarmer != this) if (disarmer != this)
disarmer->Message_StringID(MT_Skills, DISARM_SUCCESS, this->GetCleanName()); disarmer->MessageString(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->MessageString(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->MessageString(Chat::Skills, DISARM_FAILED);
} }
bool Client::BindWound(Mob *bindmob, bool start, bool fail) bool Client::BindWound(Mob *bindmob, bool start, bool fail)
@ -2764,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()->MessageString(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?
@ -2848,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(
@ -2909,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);
} }
} }
} }
@ -3068,13 +3075,13 @@ 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::MessageString(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;
@ -3096,30 +3103,30 @@ void Client::Message_StringID(uint32 type, uint32 string_id, uint32 distance)
// to load the eqstr file and count them in the string. // to load the eqstr file and count them in the string.
// This hack sucks but it's gonna work for now. // This hack sucks but it's gonna work for now.
// //
void Client::Message_StringID(uint32 type, uint32 string_id, const char* message1, void Client::MessageString(uint32 type, uint32 string_id, const char* message1,
const char* message2,const char* message3,const char* message4, const char* message2,const char* message3,const char* message4,
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)
{ {
Message_StringID(type, string_id); // use the simple message instead MessageString(type, string_id); // use the simple message instead
return; return;
} }
@ -3198,7 +3205,7 @@ bool Client::FilteredMessageCheck(Mob *sender, eqFilterType filter)
return true; return true;
} }
void Client::FilteredMessage_StringID(Mob *sender, uint32 type, void Client::FilteredMessageString(Mob *sender, uint32 type,
eqFilterType filter, uint32 string_id) eqFilterType filter, uint32 string_id)
{ {
if (!FilteredMessageCheck(sender, filter)) if (!FilteredMessageCheck(sender, filter))
@ -3217,7 +3224,7 @@ void Client::FilteredMessage_StringID(Mob *sender, uint32 type,
return; return;
} }
void Client::FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType filter, uint32 string_id, void Client::FilteredMessageString(Mob *sender, uint32 type, eqFilterType filter, uint32 string_id,
const char *message1, const char *message2, const char *message3, const char *message1, const char *message2, const char *message3,
const char *message4, const char *message5, const char *message6, const char *message4, const char *message5, const char *message6,
const char *message7, const char *message8, const char *message9) const char *message7, const char *message8, const char *message9)
@ -3229,11 +3236,11 @@ 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) {
FilteredMessage_StringID(sender, type, filter, string_id); // use the simple message instead FilteredMessageString(sender, type, filter, string_id); // use the simple message instead
return; return;
} }
@ -3274,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); MessageString(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) {
@ -3337,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 MessageString( Chat::Skills, LANG_SKILL_IMPROVED ); //Notify the client
} }
void Client::LinkDead() void Client::LinkDead()
@ -3425,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); MessageString(Chat::Skills, ESCAPE);
} }
float Client::CalcPriceMod(Mob* other, bool reverse) float Client::CalcPriceMod(Mob* other, bool reverse)
@ -3821,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);
} }
} }
@ -3838,7 +3845,7 @@ void Client::SendRules(Client* client)
auto lines = SplitString(rules, '\n'); auto lines = SplitString(rules, '\n');
for (auto&& e : lines) for (auto&& e : lines)
client->Message(0, "%s", e.c_str()); client->Message(Chat::White, "%s", e.c_str());
} }
void Client::SetEndurance(int32 newEnd) void Client::SetEndurance(int32 newEnd)
@ -3865,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->MessageString(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->MessageString(Chat::Red, SAC_TOO_HIGH);
safe_delete(outapp); safe_delete(outapp);
return; return;
} }
@ -3940,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->MessageString(Chat::Red, SAC_TOO_LOW); // This being is not a worthy sacrifice.
} }
} }
@ -4215,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);
} }
@ -4231,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);
} }
} }
} }
@ -4407,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;
} }
@ -4917,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;
} }
@ -4925,7 +4932,7 @@ void Client::HandleLDoNOpen(NPC *target)
{ {
if(target->GetLDoNTrapSpellID() != 0) if(target->GetLDoNTrapSpellID() != 0)
{ {
Message_StringID(13, LDON_ACCIDENT_SETOFF2); MessageString(Chat::Red, LDON_ACCIDENT_SETOFF2);
target->SpellFinished(target->GetLDoNTrapSpellID(), this, EQEmu::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].ResistDiff); target->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);
@ -4941,7 +4948,7 @@ void Client::HandleLDoNOpen(NPC *target)
if(target->IsLDoNLocked()) if(target->IsLDoNLocked())
{ {
Message_StringID(MT_Skills, LDON_STILL_LOCKED, target->GetCleanName()); MessageString(Chat::Skills, LDON_STILL_LOCKED, target->GetCleanName());
return; return;
} }
else else
@ -4975,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()); MessageString(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()); MessageString(Chat::Skills, LDON_CERTAIN_TRAP, target->GetCleanName());
} }
else else
{ {
@ -4990,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()); MessageString(Chat::Skills, LDON_DONT_KNOW_TRAPPED, target->GetCleanName());
break; break;
case 1: case 1:
Message_StringID(MT_Skills, LDON_CERTAIN_TRAP, target->GetCleanName()); MessageString(Chat::Skills, LDON_CERTAIN_TRAP, target->GetCleanName());
target->SetLDoNTrapDetected(true); target->SetLDoNTrapDetected(true);
break; break;
default: default:
@ -5003,7 +5010,7 @@ void Client::HandleLDoNSenseTraps(NPC *target, uint16 skill, uint8 type)
} }
else else
{ {
Message_StringID(MT_Skills, LDON_CERTAIN_NOT_TRAP, target->GetCleanName()); MessageString(Chat::Skills, LDON_CERTAIN_NOT_TRAP, target->GetCleanName());
} }
} }
} }
@ -5016,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()); MessageString(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()); MessageString(Chat::Skills, LDON_HAVE_NOT_DISARMED, target->GetCleanName());
return; return;
} }
@ -5041,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()); MessageString(Chat::Skills, LDON_HAVE_DISARMED, target->GetCleanName());
break; break;
case 0: case 0:
Message_StringID(MT_Skills, LDON_HAVE_NOT_DISARMED, target->GetCleanName()); MessageString(Chat::Skills, LDON_HAVE_NOT_DISARMED, target->GetCleanName());
break; break;
case -1: case -1:
Message_StringID(13, LDON_ACCIDENT_SETOFF2); MessageString(Chat::Red, LDON_ACCIDENT_SETOFF2);
target->SpellFinished(target->GetLDoNTrapSpellID(), this, EQEmu::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].ResistDiff); target->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);
@ -5066,7 +5073,7 @@ void Client::HandleLDoNPickLock(NPC *target, uint16 skill, uint8 type)
{ {
if(target->IsLDoNTrapped()) if(target->IsLDoNTrapped())
{ {
Message_StringID(13, LDON_ACCIDENT_SETOFF2); MessageString(Chat::Red, LDON_ACCIDENT_SETOFF2);
target->SpellFinished(target->GetLDoNTrapSpellID(), this, EQEmu::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].ResistDiff); target->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);
@ -5075,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()); MessageString(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;
} }
@ -5091,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()); MessageString(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()); MessageString(Chat::Skills, LDON_PICKLOCK_SUCCESS, target->GetCleanName());
break; break;
} }
} }
@ -5154,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;
} }
@ -5163,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)
@ -5243,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;
} }
@ -5572,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;
} }
@ -5584,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;
} }
@ -5600,7 +5607,7 @@ void Client::SuspendMinion()
CurrentPet->SetMana(m_suspendedminion.Mana); CurrentPet->SetMana(m_suspendedminion.Mana);
Message_StringID(clientMessageTell, SUSPEND_MINION_UNSUSPEND, CurrentPet->GetCleanName()); MessageString(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 ...
@ -5630,19 +5637,19 @@ void Client::SuspendMinion()
{ {
if(m_suspendedminion.SpellID > 0) if(m_suspendedminion.SpellID > 0)
{ {
Message_StringID(clientMessageError,ONLY_ONE_PET); MessageString(Chat::Red,ONLY_ONE_PET);
return; return;
} }
else if(CurrentPet->IsEngaged()) else if(CurrentPet->IsEngaged())
{ {
Message_StringID(clientMessageError,SUSPEND_MINION_FIGHTING); MessageString(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); MessageString(Chat::Blue,SUSPEND_MINION_HAS_AGGRO);
} }
else else
{ {
@ -5659,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()); MessageString(Chat::Magenta, SUSPEND_MINION_SUSPEND, CurrentPet->GetCleanName());
CurrentPet->Depop(false); CurrentPet->Depop(false);
@ -5668,7 +5675,7 @@ void Client::SuspendMinion()
} }
else else
{ {
Message_StringID(clientMessageError, ONLY_SUMMONED_PETS); MessageString(Chat::Red, ONLY_SUMMONED_PETS);
return; return;
} }
@ -5741,7 +5748,7 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
strcpy(insr->text, requestee->GetInspectMessage().text); strcpy(insr->text, requestee->GetInspectMessage().text);
// There could be an OP for this..or not... (Ti clients are not processed here..this message is generated client-side) // There could be an OP for this..or not... (Ti clients are not processed here..this message is generated client-side)
if(requestee->IsClient() && (requestee != requester)) { requestee->Message(0, "%s is looking at your equipment...", requester->GetName()); } if(requestee->IsClient() && (requestee != requester)) { requestee->Message(Chat::White, "%s is looking at your equipment...", requester->GetName()); }
requester->QueuePacket(outapp); // Send answer to requester requester->QueuePacket(outapp); // Send answer to requester
safe_delete(outapp); safe_delete(outapp);
@ -6142,16 +6149,16 @@ void Client::LocateCorpse()
if(ClosestCorpse) if(ClosestCorpse)
{ {
Message_StringID(MT_Spells, SENSE_CORPSE_DIRECTION); MessageString(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); MessageString(Chat::Red, SENSE_CORPSE_NONE);
else else
Message_StringID(clientMessageError, SENSE_CORPSE_NOT_NAME); MessageString(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)
@ -6211,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); MessageString(Chat::DefaultText, CORPSEDRAG_STOP);
It = DraggedCorpses.erase(It); It = DraggedCorpses.erase(It);
if (It == DraggedCorpses.end()) if (It == DraggedCorpses.end())
break; break;
@ -6228,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;
} }
@ -6843,35 +6850,35 @@ 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(Chat::White, " Level: %i Class: %i Race: %i DS: %i/%i Size: %1.1f Weight: %.1f/%d ", GetLevel(), GetClass(), GetRace(), GetDS(), RuleI(Character, ItemDamageShieldCap), GetSize(), (float)CalcCurrentWeight() / 10.0f, GetSTR());
client->Message(0, " HP: %i/%i HP Regen: %i/%i",GetHP(), GetMaxHP(), CalcHPRegen(), CalcHPRegenCap()); client->Message(Chat::White, " 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(Chat::White, " compute_tohit: %i TotalToHit: %i", compute_tohit(skill), GetTotalToHit(skill, 0));
client->Message(0, " compute_defense: %i TotalDefense: %i", compute_defense(), GetTotalDefense()); client->Message(Chat::White, " compute_defense: %i TotalDefense: %i", compute_defense(), GetTotalDefense());
client->Message(0, " offense: %i mitigation ac: %i", offense(skill), GetMitigationAC()); client->Message(Chat::White, " offense: %i mitigation ac: %i", offense(skill), GetMitigationAC());
if(CalcMaxMana() > 0) if(CalcMaxMana() > 0)
client->Message(0, " Mana: %i/%i Mana Regen: %i/%i", GetMana(), GetMaxMana(), CalcManaRegen(), CalcManaRegenCap()); client->Message(Chat::White, " Mana: %i/%i Mana Regen: %i/%i", GetMana(), GetMaxMana(), CalcManaRegen(), CalcManaRegenCap());
client->Message(0, " End.: %i/%i End. Regen: %i/%i",GetEndurance(), GetMaxEndurance(), CalcEnduranceRegen(), CalcEnduranceRegenCap()); client->Message(Chat::White, " End.: %i/%i End. Regen: %i/%i",GetEndurance(), GetMaxEndurance(), CalcEnduranceRegen(), CalcEnduranceRegenCap());
client->Message(0, " ATK: %i Worn/Spell ATK %i/%i Server Side ATK: %i", GetTotalATK(), RuleI(Character, ItemATKCap), GetATKBonus(), GetATK()); client->Message(Chat::White, " ATK: %i Worn/Spell ATK %i/%i Server Side ATK: %i", GetTotalATK(), RuleI(Character, ItemATKCap), GetATKBonus(), GetATK());
client->Message(0, " Haste: %i / %i (Item: %i + Spell: %i + Over: %i)", GetHaste(), RuleI(Character, HasteCap), itembonuses.haste, spellbonuses.haste + spellbonuses.hastetype2, spellbonuses.hastetype3 + ExtraHaste); client->Message(Chat::White, " Haste: %i / %i (Item: %i + Spell: %i + Over: %i)", GetHaste(), RuleI(Character, HasteCap), itembonuses.haste, spellbonuses.haste + spellbonuses.hastetype2, spellbonuses.hastetype3 + ExtraHaste);
client->Message(0, " STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetSTR(), GetSTA(), GetDEX(), GetAGI(), GetINT(), GetWIS(), GetCHA()); client->Message(Chat::White, " STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetSTR(), GetSTA(), GetDEX(), GetAGI(), GetINT(), GetWIS(), GetCHA());
client->Message(0, " hSTR: %i hSTA: %i hDEX: %i hAGI: %i hINT: %i hWIS: %i hCHA: %i", GetHeroicSTR(), GetHeroicSTA(), GetHeroicDEX(), GetHeroicAGI(), GetHeroicINT(), GetHeroicWIS(), GetHeroicCHA()); client->Message(Chat::White, " hSTR: %i hSTA: %i hDEX: %i hAGI: %i hINT: %i hWIS: %i hCHA: %i", GetHeroicSTR(), GetHeroicSTA(), GetHeroicDEX(), GetHeroicAGI(), GetHeroicINT(), GetHeroicWIS(), GetHeroicCHA());
client->Message(0, " MR: %i PR: %i FR: %i CR: %i DR: %i Corruption: %i PhR: %i", GetMR(), GetPR(), GetFR(), GetCR(), GetDR(), GetCorrup(), GetPhR()); client->Message(Chat::White, " MR: %i PR: %i FR: %i CR: %i DR: %i Corruption: %i PhR: %i", GetMR(), GetPR(), GetFR(), GetCR(), GetDR(), GetCorrup(), GetPhR());
client->Message(0, " hMR: %i hPR: %i hFR: %i hCR: %i hDR: %i hCorruption: %i", GetHeroicMR(), GetHeroicPR(), GetHeroicFR(), GetHeroicCR(), GetHeroicDR(), GetHeroicCorrup()); client->Message(Chat::White, " hMR: %i hPR: %i hFR: %i hCR: %i hDR: %i hCorruption: %i", GetHeroicMR(), GetHeroicPR(), GetHeroicFR(), GetHeroicCR(), GetHeroicDR(), GetHeroicCorrup());
client->Message(0, " Shielding: %i Spell Shield: %i DoT Shielding: %i Stun Resist: %i Strikethrough: %i Avoidance: %i Accuracy: %i Combat Effects: %i", GetShielding(), GetSpellShield(), GetDoTShield(), GetStunResist(), GetStrikeThrough(), GetAvoidance(), GetAccuracy(), GetCombatEffects()); client->Message(Chat::White, " Shielding: %i Spell Shield: %i DoT Shielding: %i Stun Resist: %i Strikethrough: %i Avoidance: %i Accuracy: %i Combat Effects: %i", GetShielding(), GetSpellShield(), GetDoTShield(), GetStunResist(), GetStrikeThrough(), GetAvoidance(), GetAccuracy(), GetCombatEffects());
client->Message(0, " Heal Amt.: %i Spell Dmg.: %i Clairvoyance: %i DS Mitigation: %i", GetHealAmt(), GetSpellDmg(), GetClair(), GetDSMit()); client->Message(Chat::White, " Heal Amt.: %i Spell Dmg.: %i Clairvoyance: %i DS Mitigation: %i", GetHealAmt(), GetSpellDmg(), GetClair(), GetDSMit());
if(GetClass() == BARD) if(GetClass() == BARD)
client->Message(0, " Singing: %i Brass: %i String: %i Percussion: %i Wind: %i", GetSingMod(), GetBrassMod(), GetStringMod(), GetPercMod(), GetWindMod()); client->Message(Chat::White, " Singing: %i Brass: %i String: %i Percussion: %i Wind: %i", GetSingMod(), GetBrassMod(), GetStringMod(), GetPercMod(), GetWindMod());
Extra_Info: Extra_Info:
client->Message(0, " BaseRace: %i Gender: %i BaseGender: %i Texture: %i HelmTexture: %i", GetBaseRace(), GetGender(), GetBaseGender(), GetTexture(), GetHelmTexture()); client->Message(Chat::White, " BaseRace: %i Gender: %i BaseGender: %i Texture: %i HelmTexture: %i", GetBaseRace(), GetGender(), GetBaseGender(), GetTexture(), GetHelmTexture());
if (client->Admin() >= 100) { if (client->Admin() >= 100) {
client->Message(0, " CharID: %i EntityID: %i PetID: %i OwnerID: %i AIControlled: %i Targetted: %i", CharacterID(), GetID(), GetPetID(), GetOwnerID(), IsAIControlled(), targeted); client->Message(Chat::White, " CharID: %i EntityID: %i PetID: %i OwnerID: %i AIControlled: %i Targetted: %i", CharacterID(), GetID(), GetPetID(), GetOwnerID(), IsAIControlled(), targeted);
} }
} }
@ -7241,17 +7248,17 @@ void Client::ShowXTargets(Client *c)
return; return;
for(int i = 0; i < GetMaxXTargets(); ++i) for(int i = 0; i < GetMaxXTargets(); ++i)
c->Message(0, "Xtarget Slot: %i, Type: %2i, ID: %4i, Name: %s", i, XTargets[i].Type, XTargets[i].ID, XTargets[i].Name); c->Message(Chat::White, "Xtarget Slot: %i, Type: %2i, ID: %4i, Name: %s", i, XTargets[i].Type, XTargets[i].ID, XTargets[i].Name);
auto &list = GetXTargetAutoMgr()->get_list(); auto &list = GetXTargetAutoMgr()->get_list();
// yeah, I kept having to do something for debugging to tell if managers were the same object or not :P // yeah, I kept having to do something for debugging to tell if managers were the same object or not :P
// so lets use the address as an "ID" // so lets use the address as an "ID"
c->Message(0, "XTargetAutoMgr ID %p size %d", GetXTargetAutoMgr(), list.size()); c->Message(Chat::White, "XTargetAutoMgr ID %p size %d", GetXTargetAutoMgr(), list.size());
int count = 0; int count = 0;
for (auto &e : list) { for (auto &e : list) {
c->Message(0, "spawn id %d count %d", e.spawn_id, e.count); c->Message(Chat::White, "spawn id %d count %d", e.spawn_id, e.count);
count++; count++;
if (count == 20) { // lets not spam too many ... if (count == 20) { // lets not spam too many ...
c->Message(0, " ... "); c->Message(Chat::White, " ... ");
break; break;
} }
} }
@ -7616,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); MessageString(Chat::White, PICK_LORE);
return; return;
} }
@ -7625,7 +7632,7 @@ void Client::DuplicateLoreMessage(uint32 ItemID)
if(!item) if(!item)
return; return;
Message_StringID(0, PICK_LORE, item->Name); MessageString(Chat::White, PICK_LORE, item->Name);
} }
void Client::GarbleMessage(char *message, uint8 variance) void Client::GarbleMessage(char *message, uint8 variance)
@ -7789,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);
} }
@ -7832,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);
} }
@ -7941,7 +7948,7 @@ void Client::MerchantRejectMessage(Mob *merchant, int primaryfaction)
} }
// If no primary faction or biggest influence is your faction hit // If no primary faction or biggest influence is your faction hit
if (primaryfaction <= 0 || lowestvalue == tmpFactionValue) { if (primaryfaction <= 0 || lowestvalue == tmpFactionValue) {
merchant->Say_StringID(zone->random.Int(WONT_SELL_DEEDS1, WONT_SELL_DEEDS6)); merchant->SayString(zone->random.Int(WONT_SELL_DEEDS1, WONT_SELL_DEEDS6));
} else if (lowestvalue == fmod.race_mod) { // race biggest } else if (lowestvalue == fmod.race_mod) { // race biggest
// Non-standard race (ex. illusioned to wolf) // Non-standard race (ex. illusioned to wolf)
if (GetRace() > PLAYER_RACE_COUNT) { if (GetRace() > PLAYER_RACE_COUNT) {
@ -7960,7 +7967,7 @@ void Client::MerchantRejectMessage(Mob *merchant, int primaryfaction)
messageid = WONT_SELL_NONSTDRACE1; messageid = WONT_SELL_NONSTDRACE1;
break; break;
} }
merchant->Say_StringID(messageid); merchant->SayString(messageid);
} else { // normal player races } else { // normal player races
messageid = zone->random.Int(1, 4); messageid = zone->random.Int(1, 4);
switch (messageid) { switch (messageid) {
@ -7980,15 +7987,15 @@ void Client::MerchantRejectMessage(Mob *merchant, int primaryfaction)
messageid = WONT_SELL_RACE1; messageid = WONT_SELL_RACE1;
break; break;
} }
merchant->Say_StringID(messageid, itoa(GetRace())); merchant->SayString(messageid, itoa(GetRace()));
} }
} else if (lowestvalue == fmod.class_mod) { } else if (lowestvalue == fmod.class_mod) {
merchant->Say_StringID(zone->random.Int(WONT_SELL_CLASS1, WONT_SELL_CLASS5), itoa(GetClass())); merchant->SayString(zone->random.Int(WONT_SELL_CLASS1, WONT_SELL_CLASS5), itoa(GetClass()));
} else { } else {
// Must be deity - these two sound the best for that. // Must be deity - these two sound the best for that.
// Can't use a message with a field, GUI wants class/race names. // Can't use a message with a field, GUI wants class/race names.
// for those message IDs. These are straight text. // for those message IDs. These are straight text.
merchant->Say_StringID(zone->random.Int(WONT_SELL_DEEDS1, WONT_SELL_DEEDS2)); merchant->SayString(zone->random.Int(WONT_SELL_DEEDS1, WONT_SELL_DEEDS2));
} }
return; return;
} }
@ -8024,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); MessageString(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); MessageString(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); MessageString(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); MessageString(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;
} }
@ -8358,7 +8365,7 @@ void Client::Consume(const EQEmu::ItemData *item, uint8 type, int16 slot, bool a
DeleteItemInInventory(slot, 1, false); DeleteItemInInventory(slot, 1, false);
if (!auto_consume) // no message if the client consumed for us if (!auto_consume) // no message if the client consumed for us
entity_list.MessageClose_StringID(this, true, 50, 0, EATING_MESSAGE, GetName(), item->Name); entity_list.MessageCloseString(this, true, 50, 0, EATING_MESSAGE, GetName(), item->Name);
Log(Logs::General, Logs::Food, "Eating from slot: %i", (int)slot); Log(Logs::General, Logs::Food, "Eating from slot: %i", (int)slot);
@ -8376,7 +8383,7 @@ void Client::Consume(const EQEmu::ItemData *item, uint8 type, int16 slot, bool a
increase, m_pp.thirst_level); increase, m_pp.thirst_level);
if (!auto_consume) // no message if the client consumed for us if (!auto_consume) // no message if the client consumed for us
entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name); entity_list.MessageCloseString(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name);
Log(Logs::General, Logs::Food, "Drinking from slot: %i", (int)slot); Log(Logs::General, Logs::Food, "Drinking from slot: %i", (int)slot);
} }
@ -8421,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;
} }
@ -8524,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) {
@ -9037,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");
} }
} }
@ -9060,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");
} }
} }
@ -9100,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;
} }
@ -9115,3 +9122,16 @@ bool Client::GotoPlayer(std::string player_name)
return false; return false;
} }
glm::vec4 &Client::GetLastPositionBeforeBulkUpdate()
{
return last_position_before_bulk_update;
}
/**
* @param in_last_position_before_bulk_update
*/
void Client::SetLastPositionBeforeBulkUpdate(glm::vec4 in_last_position_before_bulk_update)
{
Client::last_position_before_bulk_update = in_last_position_before_bulk_update;
}

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
@ -295,11 +278,11 @@ public:
void SendBazaarWelcome(); void SendBazaarWelcome();
void DyeArmor(EQEmu::TintProfile* dye); void DyeArmor(EQEmu::TintProfile* dye);
uint8 SlotConvert(uint8 slot,bool bracer=false); uint8 SlotConvert(uint8 slot,bool bracer=false);
void Message_StringID(uint32 type, uint32 string_id, uint32 distance = 0); void MessageString(uint32 type, uint32 string_id, uint32 distance = 0);
void Message_StringID(uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0); void MessageString(uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0);
bool FilteredMessageCheck(Mob *sender, eqFilterType filter); bool FilteredMessageCheck(Mob *sender, eqFilterType filter);
void FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType filter, uint32 string_id); void FilteredMessageString(Mob *sender, uint32 type, eqFilterType filter, uint32 string_id);
void FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType filter, void FilteredMessageString(Mob *sender, uint32 type, eqFilterType filter,
uint32 string_id, const char *message1, const char *message2 = nullptr, uint32 string_id, const char *message1, const char *message2 = nullptr,
const char *message3 = nullptr, const char *message4 = nullptr, const char *message3 = nullptr, const char *message4 = nullptr,
const char *message5 = nullptr, const char *message6 = nullptr, const char *message5 = nullptr, const char *message6 = nullptr,
@ -371,9 +354,9 @@ public:
inline bool ClientDataLoaded() const { return client_data_loaded; } inline bool ClientDataLoaded() const { return client_data_loaded; }
inline bool Connected() const { return (client_state == CLIENT_CONNECTED); } inline bool Connected() const { return (client_state == CLIENT_CONNECTED); }
inline bool InZone() const { return (client_state == CLIENT_CONNECTED || client_state == CLIENT_LINKDEAD); } inline bool InZone() const { return (client_state == CLIENT_CONNECTED || client_state == CLIENT_LINKDEAD); }
inline void Kick() { client_state = CLIENT_KICKED; }
inline void Disconnect() { eqs->Close(); client_state = DISCONNECTED; } inline void Disconnect() { eqs->Close(); client_state = DISCONNECTED; }
inline bool IsLD() const { return (bool) (client_state == CLIENT_LINKDEAD); } inline bool IsLD() const { return (bool) (client_state == CLIENT_LINKDEAD); }
void Kick(const std::string &reason);
void WorldKick(); void WorldKick();
inline uint8 GetAnon() const { return m_pp.anon; } inline uint8 GetAnon() const { return m_pp.anon; }
inline PlayerProfile_Struct& GetPP() { return m_pp; } inline PlayerProfile_Struct& GetPP() { return m_pp; }
@ -1309,6 +1292,9 @@ public:
uint32 trapid; //ID of trap player has triggered. This is cleared when the player leaves the trap's radius, or it despawns. uint32 trapid; //ID of trap player has triggered. This is cleared when the player leaves the trap's radius, or it despawns.
void SetLastPositionBeforeBulkUpdate(glm::vec4 in_last_position_before_bulk_update);
glm::vec4 &GetLastPositionBeforeBulkUpdate();
protected: protected:
friend class Mob; friend class Mob;
void CalcItemBonuses(StatBonuses* newbon); void CalcItemBonuses(StatBonuses* newbon);
@ -1517,6 +1503,7 @@ private:
Timer forget_timer; // our 2 min everybody forgets you timer Timer forget_timer; // our 2 min everybody forgets you timer
Timer autosave_timer; Timer autosave_timer;
Timer client_scan_npc_aggro_timer; Timer client_scan_npc_aggro_timer;
Timer client_zone_wide_full_position_update_timer;
Timer tribute_timer; Timer tribute_timer;
Timer proximity_timer; Timer proximity_timer;
@ -1539,6 +1526,7 @@ private:
Timer position_update_timer; /* Timer used when client hasn't updated within a 10 second window */ Timer position_update_timer; /* Timer used when client hasn't updated within a 10 second window */
glm::vec3 m_Proximity; glm::vec3 m_Proximity;
glm::vec4 last_position_before_bulk_update;
void BulkSendInventoryItems(); void BulkSendInventoryItems();

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); MessageString(Chat::TooFarAway, TARGET_TOO_FAR);
} }
else if (auto_attack_target == this) { else if (auto_attack_target == this) {
Message_StringID(MT_TooFarAway, TRY_ATTACKING_SOMEONE); MessageString(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
@ -401,11 +401,11 @@ bool Client::Process() {
if (GetClass() == WARRIOR || GetClass() == BERSERKER) { if (GetClass() == WARRIOR || GetClass() == BERSERKER) {
if (!dead && !IsBerserk() && GetHPRatio() < RuleI(Combat, BerserkerFrenzyStart)) { if (!dead && !IsBerserk() && GetHPRatio() < RuleI(Combat, BerserkerFrenzyStart)) {
entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_START, GetName()); entity_list.MessageCloseString(this, false, 200, 0, BERSERK_START, GetName());
berserk = true; berserk = true;
} }
if (IsBerserk() && GetHPRatio() > RuleI(Combat, BerserkerFrenzyEnd)) { if (IsBerserk() && GetHPRatio() > RuleI(Combat, BerserkerFrenzyEnd)) {
entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_END, GetName()); entity_list.MessageCloseString(this, false, 200, 0, BERSERK_END, GetName());
berserk = false; berserk = false;
} }
} }
@ -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); //MessageString(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); //MessageString(Chat::TooFarAway,TRY_ATTACKING_SOMEONE);
} }
else if (!los_status || !los_status_facing) else if (!los_status || !los_status_facing)
{ {
@ -465,7 +465,8 @@ bool Client::Process() {
{ {
if (!CombatRange(shield_target)) if (!CombatRange(shield_target))
{ {
entity_list.MessageClose_StringID(this, false, 100, 0, entity_list.MessageCloseString(
this, false, 100, 0,
END_SHIELDING, GetCleanName(), shield_target->GetCleanName()); END_SHIELDING, GetCleanName(), shield_target->GetCleanName());
for (int y = 0; y < 2; y++) for (int y = 0; y < 2; y++)
{ {
@ -592,8 +593,8 @@ bool Client::Process() {
// only if client is not feigned // only if client is not feigned
if (zone->CanDoCombat() && ret && !GetFeigned() && client_scan_npc_aggro_timer.Check()) { if (zone->CanDoCombat() && ret && !GetFeigned() && client_scan_npc_aggro_timer.Check()) {
int npc_scan_count = 0; int npc_scan_count = 0;
for (auto it = close_mobs.begin(); it != close_mobs.end(); ++it) { for (auto & close_mob : close_mobs) {
Mob *mob = it->first; Mob *mob = close_mob.first;
if (!mob) if (!mob)
continue; continue;
@ -604,6 +605,7 @@ bool Client::Process() {
if (mob->CheckWillAggro(this) && !mob->CheckAggro(this)) { if (mob->CheckWillAggro(this) && !mob->CheckAggro(this)) {
mob->AddToHateList(this, 25); mob->AddToHateList(this, 25);
} }
npc_scan_count++; npc_scan_count++;
} }
Log(Logs::General, Logs::Aggro, "Checking Reverse Aggro (client->npc) scanned_npcs (%i)", npc_scan_count); Log(Logs::General, Logs::Aggro, "Checking Reverse Aggro (client->npc) scanned_npcs (%i)", npc_scan_count);
@ -950,9 +952,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); MessageString(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()); MessageString(Chat::NPCQuestSay, GENERIC_STRINGID_SAY, merch->GetCleanName(), handy_id, this->GetName());
} }
// safe_delete_array(cpi); // safe_delete_array(cpi);
@ -988,7 +990,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;
} }
@ -1042,7 +1044,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); MessageString(Chat::White, TGB() ? TGB_ON : TGB_OFF);
else else
tgb = tgb_flag; tgb = tgb_flag;
} }
@ -1060,7 +1062,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;
} }
@ -1071,8 +1073,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); MessageString(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;
} }
@ -1086,7 +1088,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); MessageString(Chat::Red, CANNOT_USE_ITEM);
break; break;
} }
@ -1438,7 +1440,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");
} }
} }
} }
@ -1454,8 +1456,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
); );
@ -1525,7 +1527,7 @@ void Client::OPGMTraining(const EQApplicationPacket *app)
// welcome message // welcome message
if (pTrainer && pTrainer->IsNPC()) if (pTrainer && pTrainer->IsNPC())
{ {
pTrainer->Say_StringID(zone->random.Int(1204, 1207), GetCleanName()); pTrainer->SayString(zone->random.Int(1204, 1207), GetCleanName());
} }
} }
@ -1554,7 +1556,7 @@ void Client::OPGMEndTraining(const EQApplicationPacket *app)
// goodbye message // goodbye message
if (pTrainer->IsNPC()) if (pTrainer->IsNPC())
{ {
pTrainer->Say_StringID(zone->random.Int(1208, 1211), GetCleanName()); pTrainer->SayString(zone->random.Int(1208, 1211), GetCleanName());
} }
} }
@ -1644,7 +1646,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()); MessageString(Chat::Red, MORE_SKILLED_THAN_I, pTrainer->GetCleanName());
return; return;
} }
break; break;
@ -1654,7 +1656,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()); MessageString(Chat::Red, MORE_SKILLED_THAN_I, pTrainer->GetCleanName());
return; return;
} }
default: default:
@ -1665,7 +1667,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()); MessageString(Chat::Red, MORE_SKILLED_THAN_I, pTrainer->GetCleanName());
return; return;
} }
@ -1675,7 +1677,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()); MessageString(Chat::Red, MORE_SKILLED_THAN_I, pTrainer->GetCleanName());
return; return;
} }
} }
@ -1918,7 +1920,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); MessageString(Chat::Skills, TRACK_LOST_TARGET);
TrackingID = 0; TrackingID = 0;
return; return;
} }
@ -1929,23 +1931,23 @@ void Client::DoTracking()
RelativeHeading += 512; RelativeHeading += 512;
if (RelativeHeading > 480) if (RelativeHeading > 480)
Message_StringID(MT_Skills, TRACK_STRAIGHT_AHEAD, m->GetCleanName()); MessageString(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"); MessageString(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"); MessageString(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"); MessageString(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()); MessageString(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"); MessageString(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"); MessageString(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"); MessageString(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()); MessageString(Chat::Skills, TRACK_STRAIGHT_AHEAD, m->GetCleanName());
} }
void Client::HandleRespawnFromHover(uint32 Option) void Client::HandleRespawnFromHover(uint32 Option)

File diff suppressed because it is too large Load Diff

View File

@ -182,6 +182,7 @@ void command_netstats(Client *c, const Seperator *sep);
void command_network(Client *c, const Seperator *sep); void command_network(Client *c, const Seperator *sep);
void command_npccast(Client *c, const Seperator *sep); void command_npccast(Client *c, const Seperator *sep);
void command_npcedit(Client *c, const Seperator *sep); void command_npcedit(Client *c, const Seperator *sep);
void command_npceditmass(Client *c, const Seperator *sep);
void command_npcemote(Client *c, const Seperator *sep); void command_npcemote(Client *c, const Seperator *sep);
void command_npcloot(Client *c, const Seperator *sep); void command_npcloot(Client *c, const Seperator *sep);
void command_npcsay(Client *c, const Seperator *sep); void command_npcsay(Client *c, const Seperator *sep);
@ -247,6 +248,7 @@ void command_repopclose(Client *c, const Seperator *sep);
void command_resetaa(Client* c,const Seperator *sep); void command_resetaa(Client* c,const Seperator *sep);
void command_resetaa_timer(Client *c, const Seperator *sep); void command_resetaa_timer(Client *c, const Seperator *sep);
void command_revoke(Client *c, const Seperator *sep); void command_revoke(Client *c, const Seperator *sep);
void command_roambox(Client *c, const Seperator *sep);
void command_rules(Client *c, const Seperator *sep); void command_rules(Client *c, const Seperator *sep);
void command_save(Client *c, const Seperator *sep); void command_save(Client *c, const Seperator *sep);
void command_scale(Client *c, const Seperator *sep); void command_scale(Client *c, const Seperator *sep);
@ -286,6 +288,7 @@ void command_showzonegloballoot(Client *c, const Seperator *sep);
void command_shutdown(Client *c, const Seperator *sep); void command_shutdown(Client *c, const Seperator *sep);
void command_size(Client *c, const Seperator *sep); void command_size(Client *c, const Seperator *sep);
void command_spawn(Client *c, const Seperator *sep); void command_spawn(Client *c, const Seperator *sep);
void command_spawneditmass(Client *c, const Seperator *sep);
void command_spawnfix(Client *c, const Seperator *sep); void command_spawnfix(Client *c, const Seperator *sep);
void command_spawnstatus(Client *c, const Seperator *sep); void command_spawnstatus(Client *c, const Seperator *sep);
void command_spellinfo(Client *c, const Seperator *sep); void command_spellinfo(Client *c, const Seperator *sep);

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->MessageString(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->MessageString(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->MessageString(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->MessageString(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->GroupMessageString(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->RaidMessageString(client, Chat::Loot, OTHER_LOOTED_MESSAGE,
client->GetName(), linker.Link().c_str()); client->GetName(), linker.Link().c_str());
} }
} }
@ -1371,7 +1371,7 @@ void Corpse::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
void Corpse::QueryLoot(Client* to) { void Corpse::QueryLoot(Client* to) {
int x = 0, y = 0; // x = visible items, y = total items int x = 0, y = 0; // x = visible items, y = total items
to->Message(0, "Coin: %ip, %ig, %is, %ic", platinum, gold, silver, copper); to->Message(Chat::White, "Coin: %ip, %ig, %is, %ic", platinum, gold, silver, copper);
ItemList::iterator cur,end; ItemList::iterator cur,end;
cur = itemlist.begin(); cur = itemlist.begin();
@ -1405,19 +1405,19 @@ void Corpse::QueryLoot(Client* to) {
const EQEmu::ItemData* item = database.GetItem(sitem->item_id); const EQEmu::ItemData* item = database.GetItem(sitem->item_id);
if (item) if (item)
to->Message(0, "LootSlot: %i Item: %s (%d), Count: %i", sitem->lootslot, item->Name, item->ID, sitem->charges); to->Message(Chat::White, "LootSlot: %i Item: %s (%d), Count: %i", sitem->lootslot, item->Name, item->ID, sitem->charges);
else else
to->Message(0, "Error: 0x%04x", sitem->item_id); to->Message(Chat::White, "Error: 0x%04x", sitem->item_id);
y++; y++;
} }
} }
if (IsPlayerCorpse()) { if (IsPlayerCorpse()) {
to->Message(0, "%i visible %s (%i total) on %s (DBID: %i).", x, x==1?"item":"items", y, this->GetName(), this->GetCorpseDBID()); to->Message(Chat::White, "%i visible %s (%i total) on %s (DBID: %i).", x, x==1?"item":"items", y, this->GetName(), this->GetCorpseDBID());
} }
else { else {
to->Message(0, "%i %s on %s.", y, y==1?"item":"items", this->GetName()); to->Message(Chat::White, "%i %s on %s.", y, y==1?"item":"items", this->GetName());
} }
} }
@ -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)) {
@ -1434,7 +1434,7 @@ bool Corpse::Summon(Client* client, bool spell, bool CheckDistance) {
is_corpse_changed = true; is_corpse_changed = true;
} }
else { else {
client->Message(0, "Corpse is too far away."); client->Message(Chat::White, "Corpse is too far away.");
return false; return false;
} }
} }
@ -1449,14 +1449,14 @@ bool Corpse::Summon(Client* client, bool spell, bool CheckDistance) {
is_corpse_changed = true; is_corpse_changed = true;
} }
else { else {
client->Message(0, "Corpse is too far away."); client->Message(Chat::White, "Corpse is too far away.");
return false; return false;
} }
consented = true; consented = true;
} }
} }
if(!consented) { if(!consented) {
client->Message(0, "You do not have permission to move this corpse."); client->Message(Chat::White, "You do not have permission to move this corpse.");
return false; return false;
} }
} }

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->MessageString(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->MessageString(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->MessageString(Chat::LightBlue, DOORS_SUCCESSFUL_PICK);
} else { } else {
sender->Message_StringID(4, DOORS_INSUFFICIENT_SKILL); sender->MessageString(Chat::LightBlue, DOORS_INSUFFICIENT_SKILL);
safe_delete(outapp); safe_delete(outapp);
return; return;
} }
} else { } else {
sender->Message_StringID(4, DOORS_NO_PICK); sender->MessageString(Chat::LightBlue, DOORS_NO_PICK);
safe_delete(outapp); safe_delete(outapp);
return; return;
} }
} else { } else {
sender->Message_StringID(4, DOORS_CANT_PICK); sender->MessageString(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->MessageString(Chat::LightBlue, DOORS_LOCKED);
safe_delete(outapp); safe_delete(outapp);
return; return;
} }

View File

@ -122,11 +122,12 @@ 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.MessageCloseString(
OTHER_CRIT_BLAST, GetName(), itoa(-value)); this, true, 100, Chat::SpellCrit,
OTHER_CRIT_BLAST, GetName(), itoa(-value));
if (IsClient()) if (IsClient())
Message_StringID(MT_SpellCrits, YOU_CRIT_BLAST, itoa(-value)); MessageString(Chat::SpellCrit, YOU_CRIT_BLAST, itoa(-value));
return value; return value;
} }
@ -306,11 +307,12 @@ 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.MessageCloseString(
OTHER_CRIT_HEAL, GetName(), itoa(value)); this, true, 100, Chat::SpellCrit,
OTHER_CRIT_HEAL, GetName(), itoa(value));
if (IsClient()) if (IsClient())
Message_StringID(MT_SpellCrits, YOU_CRIT_HEAL, itoa(value)); MessageString(Chat::SpellCrit, YOU_CRIT_HEAL, itoa(value));
} }
return value; return value;
@ -432,13 +434,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 +464,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 +472,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 +482,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 +490,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 +498,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 +515,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 +527,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 +539,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 +583,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 +591,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); MessageString(Chat::Red, DISC_LEVEL_USE_ERROR);
//should summon them a new one... //should summon them a new one...
return(false); return(false);
} }
@ -607,7 +609,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
// sneak attack discs require you to be hidden for 4 seconds before use // 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); MessageString(Chat::SpellFailure, SNEAK_RESTRICT);
return false; return false;
} }
@ -621,7 +623,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)); //MessageString(Chat::White, DISCIPLINE_CANUSEIN, ConvertArray((remain)/60,val1), ConvertArray(remain%60,val2));
Message(0, "You can use this discipline in %d minutes %d seconds.", ((remain)/60), (remain%60)); 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->MessageString(Chat::Yellow, DUEL_FLED, winner->GetName(),loser->GetName(),loser->GetName());
else else
cur->Message_StringID(15, DUEL_FINISHED, winner->GetName(),loser->GetName()); cur->MessageString(Chat::Yellow, DUEL_FINISHED, winner->GetName(),loser->GetName());
} }
++it; ++it;
} }
@ -2071,7 +2071,7 @@ void EntityList::QueueClientsGuildBankItemUpdate(const GuildBankItemUpdate_Struc
void EntityList::MessageStatus(uint32 to_guild_id, int to_minstatus, uint32 type, const char *message, ...) void EntityList::MessageStatus(uint32 to_guild_id, int to_minstatus, uint32 type, const char *message, ...)
{ {
va_list argptr; va_list argptr;
char buffer[4096]; char buffer[4096];
va_start(argptr, message); va_start(argptr, message);
vsnprintf(buffer, 4096, message, argptr); vsnprintf(buffer, 4096, message, argptr);
@ -2080,75 +2080,242 @@ void EntityList::MessageStatus(uint32 to_guild_id, int to_minstatus, uint32 type
auto it = client_list.begin(); auto it = client_list.begin();
while (it != client_list.end()) { while (it != client_list.end()) {
Client *client = it->second; Client *client = it->second;
if ((to_guild_id == 0 || client->IsInGuild(to_guild_id)) && client->Admin() >= to_minstatus) if ((to_guild_id == 0 || client->IsInGuild(to_guild_id)) && client->Admin() >= to_minstatus) {
client->Message(type, buffer); client->Message(type, buffer);
}
++it; ++it;
} }
} }
// works much like MessageClose, but with formatted strings /**
void EntityList::MessageClose_StringID(Mob *sender, bool skipsender, float dist, uint32 type, uint32 string_id, const char* message1,const char* message2,const char* message3,const char* message4,const char* message5,const char* message6,const char* message7,const char* message8,const char* message9) * @param sender
* @param skipsender
* @param dist
* @param type
* @param string_id
* @param message1
* @param message2
* @param message3
* @param message4
* @param message5
* @param message6
* @param message7
* @param message8
* @param message9
*/
void EntityList::MessageCloseString(
Mob *sender,
bool skipsender,
float dist,
uint32 type,
uint32 string_id,
const char *message1,
const char *message2,
const char *message3,
const char *message4,
const char *message5,
const char *message6,
const char *message7,
const char *message8,
const char *message9
)
{ {
Client *c; Client *c;
float dist2 = dist * dist; float dist2 = dist * dist;
for (auto it = client_list.begin(); it != client_list.end(); ++it) { for (auto & it : client_list) {
c = it->second; c = it.second;
if(c && DistanceSquared(c->GetPosition(), sender->GetPosition()) <= dist2 && (!skipsender || c != sender)) if (c && DistanceSquared(c->GetPosition(), sender->GetPosition()) <= dist2 && (!skipsender || c != sender)) {
c->Message_StringID(type, string_id, message1, message2, message3, message4, message5, message6, message7, message8, message9); c->MessageString(
type,
string_id,
message1,
message2,
message3,
message4,
message5,
message6,
message7,
message8,
message9
);
}
} }
} }
void EntityList::FilteredMessageClose_StringID(Mob *sender, bool skipsender, /**
float dist, uint32 type, eqFilterType filter, uint32 string_id, * @param sender
const char *message1, const char *message2, const char *message3, * @param skipsender
const char *message4, const char *message5, const char *message6, * @param dist
const char *message7, const char *message8, const char *message9) * @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::FilteredMessageCloseString(
Mob *sender, bool skipsender,
float dist,
uint32 type,
eqFilterType filter,
uint32 string_id,
const char *message1,
const char *message2,
const char *message3,
const char *message4,
const char *message5,
const char *message6,
const char *message7,
const char *message8,
const char *message9
)
{ {
Client *c; Client *c;
float dist2 = dist * dist; float dist2 = dist * dist;
for (auto it = client_list.begin(); it != client_list.end(); ++it) { for (auto & it : client_list) {
c = it->second; c = it.second;
if (c && DistanceSquared(c->GetPosition(), sender->GetPosition()) <= dist2 && (!skipsender || c != sender)) if (c && DistanceSquared(c->GetPosition(), sender->GetPosition()) <= dist2 && (!skipsender || c != sender)) {
c->FilteredMessage_StringID(sender, type, filter, string_id, c->FilteredMessageString(
message1, message2, message3, message4, message5, sender, type, filter, string_id,
message6, message7, message8, message9); message1, message2, message3, message4, message5,
message6, message7, message8, message9
);
}
} }
} }
void EntityList::Message_StringID(Mob *sender, bool skipsender, uint32 type, uint32 string_id, const char* message1,const char* message2,const char* message3,const char* message4,const char* message5,const char* message6,const char* message7,const char* message8,const char* message9) /**
*
* @param sender
* @param skipsender
* @param type
* @param string_id
* @param message1
* @param message2
* @param message3
* @param message4
* @param message5
* @param message6
* @param message7
* @param message8
* @param message9
*/
void EntityList::MessageString(
Mob *sender,
bool skipsender,
uint32 type,
uint32 string_id,
const char *message1,
const char *message2,
const char *message3,
const char *message4,
const char *message5,
const char *message6,
const char *message7,
const char *message8,
const char *message9
)
{ {
Client *c; Client *c;
for (auto it = client_list.begin(); it != client_list.end(); ++it) { for (auto & it : client_list) {
c = it->second; c = it.second;
if(c && (!skipsender || c != sender)) if (c && (!skipsender || c != sender)) {
c->Message_StringID(type, string_id, message1, message2, message3, message4, message5, message6, message7, message8, message9); c->MessageString(
type,
string_id,
message1,
message2,
message3,
message4,
message5,
message6,
message7,
message8,
message9
);
}
} }
} }
void EntityList::FilteredMessage_StringID(Mob *sender, bool skipsender, /**
uint32 type, eqFilterType filter, uint32 string_id, *
const char *message1, const char *message2, const char *message3, * @param sender
const char *message4, const char *message5, const char *message6, * @param skipsender
const char *message7, const char *message8, const char *message9) * @param type
* @param filter
* @param string_id
* @param message1
* @param message2
* @param message3
* @param message4
* @param message5
* @param message6
* @param message7
* @param message8
* @param message9
*/
void EntityList::FilteredMessageString(
Mob *sender,
bool skipsender,
uint32 type,
eqFilterType filter,
uint32 string_id,
const char *message1,
const char *message2,
const char *message3,
const char *message4,
const char *message5,
const char *message6,
const char *message7,
const char *message8,
const char *message9
)
{ {
Client *c; Client *c;
for (auto it = client_list.begin(); it != client_list.end(); ++it) { for (auto & it : client_list) {
c = it->second; c = it.second;
if (c && (!skipsender || c != sender)) if (c && (!skipsender || c != sender)) {
c->FilteredMessage_StringID(sender, type, filter, string_id, c->FilteredMessageString(
message1, message2, message3, message4, message5, message6, sender,
message7, message8, message9); type,
filter,
string_id,
message1,
message2,
message3,
message4,
message5,
message6,
message7,
message8,
message9
);
}
} }
} }
void EntityList::MessageClose(Mob* sender, bool skipsender, float dist, uint32 type, const char* message, ...) /**
* @param sender
* @param skipsender
* @param dist
* @param type
* @param message
* @param ...
*/
void EntityList::MessageClose(Mob *sender, bool skipsender, float dist, uint32 type, const char *message, ...)
{ {
va_list argptr; va_list argptr;
char buffer[4096]; char buffer[4096];
va_start(argptr, message); va_start(argptr, message);
vsnprintf(buffer, 4095, message, argptr); vsnprintf(buffer, 4095, message, argptr);
@ -2158,16 +2325,26 @@ void EntityList::MessageClose(Mob* sender, bool skipsender, float dist, uint32 t
auto it = client_list.begin(); auto it = client_list.begin();
while (it != client_list.end()) { while (it != client_list.end()) {
if (DistanceSquared(it->second->GetPosition(), sender->GetPosition()) <= dist2 && (!skipsender || it->second != sender)) if (DistanceSquared(it->second->GetPosition(), sender->GetPosition()) <= dist2 &&
(!skipsender || it->second != sender)) {
it->second->Message(type, buffer); it->second->Message(type, buffer);
}
++it; ++it;
} }
} }
void EntityList::FilteredMessageClose(Mob *sender, bool skipsender, float dist, uint32 type, eqFilterType filter, const char *message, ...) void EntityList::FilteredMessageClose(
Mob *sender,
bool skipsender,
float dist,
uint32 type,
eqFilterType filter,
const char *message,
...
)
{ {
va_list argptr; va_list argptr;
char buffer[4096]; char buffer[4096];
va_start(argptr, message); va_start(argptr, message);
vsnprintf(buffer, 4095, message, argptr); vsnprintf(buffer, 4095, message, argptr);
@ -2177,8 +2354,10 @@ void EntityList::FilteredMessageClose(Mob *sender, bool skipsender, float dist,
auto it = client_list.begin(); auto it = client_list.begin();
while (it != client_list.end()) { while (it != client_list.end()) {
if (DistanceSquared(it->second->GetPosition(), sender->GetPosition()) <= dist2 && (!skipsender || it->second != sender)) if (DistanceSquared(it->second->GetPosition(), sender->GetPosition()) <= dist2 &&
it->second->FilteredMessage(sender, type, filter, buffer); (!skipsender || it->second != sender)) {
it->second->FilteredMessage(sender, type, filter, buffer);
}
++it; ++it;
} }
} }
@ -2723,15 +2902,15 @@ void EntityList::ListNPCCorpses(Client *client)
uint32 x = 0; uint32 x = 0;
auto it = corpse_list.begin(); auto it = corpse_list.begin();
client->Message(0, "NPC Corpses in the zone:"); client->Message(Chat::White, "NPC Corpses in the zone:");
while (it != corpse_list.end()) { while (it != corpse_list.end()) {
if (it->second->IsNPCCorpse()) { if (it->second->IsNPCCorpse()) {
client->Message(0, " %5d: %s", it->first, it->second->GetName()); client->Message(Chat::White, " %5d: %s", it->first, it->second->GetName());
x++; x++;
} }
++it; ++it;
} }
client->Message(0, "%d npc corpses listed.", x); client->Message(Chat::White, "%d npc corpses listed.", x);
} }
void EntityList::ListPlayerCorpses(Client *client) void EntityList::ListPlayerCorpses(Client *client)
@ -2739,15 +2918,15 @@ void EntityList::ListPlayerCorpses(Client *client)
uint32 x = 0; uint32 x = 0;
auto it = corpse_list.begin(); auto it = corpse_list.begin();
client->Message(0, "Player Corpses in the zone:"); client->Message(Chat::White, "Player Corpses in the zone:");
while (it != corpse_list.end()) { while (it != corpse_list.end()) {
if (it->second->IsPlayerCorpse()) { if (it->second->IsPlayerCorpse()) {
client->Message(0, " %5d: %s", it->first, it->second->GetName()); client->Message(Chat::White, " %5d: %s", it->first, it->second->GetName());
x++; x++;
} }
++it; ++it;
} }
client->Message(0, "%d player corpses listed.", x); client->Message(Chat::White, "%d player corpses listed.", x);
} }
// returns the number of corpses deleted. A negative number indicates an error code. // returns the number of corpses deleted. A negative number indicates an error code.
@ -2774,7 +2953,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);
} }
} }
@ -3549,7 +3728,7 @@ void EntityList::LimitAddNPC(NPC *npc)
SpawnLimitRecord r; SpawnLimitRecord r;
uint16 eid = npc->GetID(); uint16 eid = npc->GetID();
r.spawngroup_id = npc->GetSp2(); r.spawngroup_id = npc->GetSpawnGroupId();
r.npc_type = npc->GetNPCTypeID(); r.npc_type = npc->GetNPCTypeID();
npc_limit_list[eid] = r; npc_limit_list[eid] = r;
@ -3744,8 +3923,8 @@ bool Entity::CheckCoordLosNoZLeaps(float cur_x, float cur_y, float cur_z,
return false; return false;
} }
void EntityList::QuestJournalledSayClose(Mob *sender, Client *QuestInitiator, void EntityList::QuestJournalledSayClose(Mob *sender, float dist, const char *mobname, const char *message,
float dist, const char* mobname, const char* message, Journal::Options &opts) Journal::Options &opts)
{ {
SerializeBuffer buf(sizeof(SpecialMesgHeader_Struct) + 12 + 64 + 64); SerializeBuffer buf(sizeof(SpecialMesgHeader_Struct) + 12 + 64 + 64);
@ -4632,7 +4811,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->MessageString(Chat::Yellow, EXPEDITION_MIN_REMAIN, itoa((int)minutes_left));
it->second->QueuePacket(outapp); it->second->QueuePacket(outapp);
++it; ++it;
} }

View File

@ -321,10 +321,39 @@ public:
void MessageStatus(uint32 to_guilddbid, int to_minstatus, uint32 type, const char* message, ...); void MessageStatus(uint32 to_guilddbid, int to_minstatus, uint32 type, const char* message, ...);
void MessageClose(Mob* sender, bool skipsender, float dist, uint32 type, const char* message, ...); void MessageClose(Mob* sender, bool skipsender, float dist, uint32 type, const char* message, ...);
void FilteredMessageClose(Mob* sender, bool skipsender, float dist, uint32 type, eqFilterType filter, const char* message, ...); void FilteredMessageClose(Mob* sender, bool skipsender, float dist, uint32 type, eqFilterType filter, const char* message, ...);
void Message_StringID(Mob *sender, bool skipsender, uint32 type, uint32 string_id, const char* message1=0,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0); void MessageString(Mob *sender, bool skipsender, uint32 type, uint32 string_id, const char* message1=0,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0);
void FilteredMessage_StringID(Mob *sender, bool skipsender, uint32 type, eqFilterType filter, uint32 string_id, const char* message1=0,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0); void FilteredMessageString(Mob *sender, bool skipsender, uint32 type, eqFilterType filter, uint32 string_id, const char* message1=0,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0);
void MessageClose_StringID(Mob *sender, bool skipsender, float dist, uint32 type, uint32 string_id, const char* message1=0,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0); void MessageCloseString(
void FilteredMessageClose_StringID(Mob *sender, bool skipsender, float dist, uint32 type, eqFilterType filter, uint32 string_id, const char* message1=0,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0); Mob *sender,
bool skipsender,
float dist,
uint32 type,
uint32 string_id,
const char *message1 = 0,
const char *message2 = 0,
const char *message3 = 0,
const char *message4 = 0,
const char *message5 = 0,
const char *message6 = 0,
const char *message7 = 0,
const char *message8 = 0,
const char *message9 = 0);
void FilteredMessageCloseString(
Mob *sender,
bool skipsender,
float dist,
uint32 type,
eqFilterType filter,
uint32 string_id,
const char *message1 = 0,
const char *message2 = 0,
const char *message3 = 0,
const char *message4 = 0,
const char *message5 = 0,
const char *message6 = 0,
const char *message7 = 0,
const char *message8 = 0,
const char *message9 = 0);
void ChannelMessageFromWorld(const char* from, const char* to, uint8 chan_num, uint32 guilddbid, uint8 language, uint8 lang_skill, const char* message); void ChannelMessageFromWorld(const char* from, const char* to, uint8 chan_num, uint32 guilddbid, uint8 language, uint8 lang_skill, const char* message);
void ChannelMessage(Mob* from, uint8 chan_num, uint8 language, const char* message, ...); void ChannelMessage(Mob* from, uint8 chan_num, uint8 language, const char* message, ...);
void ChannelMessage(Mob* from, uint8 chan_num, uint8 language, uint8 lang_skill, const char* message, ...); void ChannelMessage(Mob* from, uint8 chan_num, uint8 language, uint8 lang_skill, const char* message, ...);
@ -339,7 +368,7 @@ public:
void SendNimbusEffects(Client *c); void SendNimbusEffects(Client *c);
void SendUntargetable(Client *c); void SendUntargetable(Client *c);
void DuelMessage(Mob* winner, Mob* loser, bool flee); void DuelMessage(Mob* winner, Mob* loser, bool flee);
void QuestJournalledSayClose(Mob *sender, Client *QuestIntiator, float dist, const char* mobname, const char* message, Journal::Options &opts); void QuestJournalledSayClose(Mob *sender, float dist, const char* mobname, const char* message, Journal::Options &opts);
void GroupMessage(uint32 gid, const char *from, const char *message); void GroupMessage(uint32 gid, const char *from, const char *message);
void ExpeditionWarning(uint32 minutes_left); void ExpeditionWarning(uint32 minutes_left);

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->MessageString(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); MessageString(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_EXP);
} }
} }
else else
{ {
Message_StringID(MT_Leadership, MAX_GROUP_LEADERSHIP_POINTS); MessageString(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); MessageString(Chat::LeaderShip, GAIN_RAID_LEADERSHIP_EXP);
} }
else else
{ {
Message_StringID(MT_Leadership, MAX_RAID_LEADERSHIP_POINTS); MessageString(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->MessageString(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); MessageString(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_EXP);
} }
} }
else else
{ {
Message_StringID(MT_Leadership, MAX_GROUP_LEADERSHIP_POINTS); MessageString(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 MessageString(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 MessageString(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 MessageString(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 MessageString(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. MessageString(Chat::Experience, GAIN_ABILITY_POINT, ConvertArray(m_pp.aapoints, val1),m_pp.aapoints == 1 ? "" : "(s)"); //You have gained an ability point! You now have %1 ability point%2.
/* QS: PlayerLogAARate */ /* 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)); MessageString(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); MessageString(Chat::Yellow, CORPSE_ITEM_LOST);
if (check_level == RuleI(Character, DeathExpLossLevel)) if (check_level == RuleI(Character, DeathExpLossLevel))
Message_StringID(15, CORPSE_EXP_LOST); MessageString(Chat::Yellow, CORPSE_EXP_LOST);
} }
else else
Message_StringID(MT_Experience, LOSE_LEVEL, ConvertArray(check_level, val1)); MessageString(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). MessageString(Chat::Experience, GM_GAINXP, ConvertArray(set_aaxp,val1),ConvertArray(set_exp,val2),ConvertArray(GetEXPForLevel(GetLevel()+1),val3)); //[GM] You have gained %1 AXP and %2 EXP (%3).
} }
} }
@ -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); MessageString(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); MessageString(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. MessageString(Chat::Skills, FISHING_EQUIP_POLE); //You need to put your fishing pole in your primary hand.
else //We don't have a fishing pole anywhere 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. MessageString(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. MessageString(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); MessageString(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? MessageString(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); MessageString(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! MessageString(Chat::White, 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); MessageString(Chat::Skills, FISHING_SUCCESS);
} }
else { else {
Message_StringID(MT_Skills, FISHING_SUCCESS_FISH_NAME, food_item->Name); MessageString(Chat::Skills, FISHING_SUCCESS_FISH_NAME, food_item->Name);
} }
EQEmu::ItemInstance* inst = database.CreateItem(food_item, 1); 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); MessageString(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! MessageString(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. MessageString(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. MessageString(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! MessageString(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); MessageString(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); MessageString(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); MessageString(Chat::Skills, FORAGE_MASTERY);
ForageItem(true); ForageItem(true);
} }
} else { } else {
Message_StringID(MT_Skills, FORAGE_FAILED); MessageString(Chat::Skills, FORAGE_FAILED);
parse->EventPlayer(EVENT_FORAGE_FAILURE, this, "", 0); parse->EventPlayer(EVENT_FORAGE_FAILURE, this, "", 0);
} }

View File

@ -21,14 +21,14 @@ std::vector<int> GlobalLootManager::GetGlobalLootTables(NPC *mob) const
void GlobalLootManager::ShowZoneGlobalLoot(Client *to) const void GlobalLootManager::ShowZoneGlobalLoot(Client *to) const
{ {
for (auto &e : m_entries) for (auto &e : m_entries)
to->Message(0, " %s : %d table %d", e.GetDescription().c_str(), e.GetID(), e.GetLootTableID()); to->Message(Chat::White, " %s : %d table %d", e.GetDescription().c_str(), e.GetID(), e.GetLootTableID());
} }
void GlobalLootManager::ShowNPCGlobalLoot(Client *to, NPC *who) const void GlobalLootManager::ShowNPCGlobalLoot(Client *to, NPC *who) const
{ {
for (auto &e : m_entries) { for (auto &e : m_entries) {
if (e.PassesRules(who)) if (e.PassesRules(who))
to->Message(0, " %s : %d table %d", e.GetDescription().c_str(), e.GetID(), e.GetLootTableID()); to->Message(Chat::White, " %s : %d table %d", e.GetDescription().c_str(), e.GetID(), e.GetLootTableID());
} }
} }

View File

@ -199,7 +199,7 @@ void Group::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinu
Client *c = members[i]->CastToClient(); Client *c = members[i]->CastToClient();
//I could not get MoneyOnCorpse to work, so we use this //I could not get MoneyOnCorpse to work, so we use this
c->AddMoneyToPP(cpsplit, spsplit, gpsplit, ppsplit, true); c->AddMoneyToPP(cpsplit, spsplit, gpsplit, ppsplit, true);
c->Message(2, msg.c_str()); c->Message(Chat::Green, msg.c_str());
} }
} }
} }
@ -1236,7 +1236,7 @@ void Group::VerifyGroup() {
} }
} }
void Group::GroupMessage_StringID(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2,const char* message3,const char* message4,const char* message5,const char* message6,const char* message7,const char* message8,const char* message9, uint32 distance) { void Group::GroupMessageString(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2,const char* message3,const char* message4,const char* message5,const char* message6,const char* message7,const char* message8,const char* message9, uint32 distance) {
uint32 i; uint32 i;
for (i = 0; i < MAX_GROUP_MEMBERS; i++) { for (i = 0; i < MAX_GROUP_MEMBERS; i++) {
if(members[i] == nullptr) if(members[i] == nullptr)
@ -1248,7 +1248,7 @@ void Group::GroupMessage_StringID(Mob* sender, uint32 type, uint32 string_id, co
if(!members[i]->IsClient()) if(!members[i]->IsClient())
continue; continue;
members[i]->Message_StringID(type, string_id, message, message2, message3, message4, message5, message6, message7, message8, message9, 0); members[i]->MessageString(type, string_id, message, message2, message3, message4, message5, message6, message7, message8, message9, 0);
} }
} }
@ -1680,9 +1680,9 @@ void Group::NotifyMainTank(Client *c, uint8 toggle)
if (c->ClientVersion() < EQEmu::versions::ClientVersion::SoD) if (c->ClientVersion() < EQEmu::versions::ClientVersion::SoD)
{ {
if(toggle) if(toggle)
c->Message(0, "%s is now Main Tank.", MainTankName.c_str()); c->Message(Chat::White, "%s is now Main Tank.", MainTankName.c_str());
else else
c->Message(0, "%s is no longer Main Tank.", MainTankName.c_str()); c->Message(Chat::White, "%s is no longer Main Tank.", MainTankName.c_str());
} }
else else
{ {
@ -1775,9 +1775,9 @@ void Group::NotifyPuller(Client *c, uint8 toggle)
if (c->ClientVersion() < EQEmu::versions::ClientVersion::SoD) if (c->ClientVersion() < EQEmu::versions::ClientVersion::SoD)
{ {
if(toggle) if(toggle)
c->Message(0, "%s is now Puller.", PullerName.c_str()); c->Message(Chat::White, "%s is now Puller.", PullerName.c_str());
else else
c->Message(0, "%s is no longer Puller.", PullerName.c_str()); c->Message(Chat::White, "%s is no longer Puller.", PullerName.c_str());
} }
else else
{ {

View File

@ -74,7 +74,7 @@ public:
void GroupBardPulse(Mob* caster,uint16 spellid); void GroupBardPulse(Mob* caster,uint16 spellid);
void SplitExp(uint32 exp, Mob* other); void SplitExp(uint32 exp, Mob* other);
void GroupMessage(Mob* sender,uint8 language,uint8 lang_skill,const char* message); void GroupMessage(Mob* sender,uint8 language,uint8 lang_skill,const char* message);
void GroupMessage_StringID(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0); void GroupMessageString(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0);
uint32 GetTotalGroupDamage(Mob* other); uint32 GetTotalGroupDamage(Mob* other);
void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Client *splitter = nullptr); void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Client *splitter = nullptr);
inline void SetLeader(Mob* newleader){ leader=newleader; }; inline void SetLeader(Mob* newleader){ leader=newleader; };

View File

@ -189,7 +189,7 @@ uint8 *ZoneGuildManager::MakeGuildMembers(uint32 guild_id, const char *prefix_na
} }
void ZoneGuildManager::ListGuilds(Client *c) const { void ZoneGuildManager::ListGuilds(Client *c) const {
c->Message(0, "Listing guilds on the server:"); c->Message(Chat::White, "Listing guilds on the server:");
char leadername[64]; char leadername[64];
std::map<uint32, GuildInfo *>::const_iterator cur, end; std::map<uint32, GuildInfo *>::const_iterator cur, end;
cur = m_guilds.begin(); cur = m_guilds.begin();
@ -199,12 +199,12 @@ void ZoneGuildManager::ListGuilds(Client *c) const {
leadername[0] = '\0'; leadername[0] = '\0';
database.GetCharName(cur->second->leader_char_id, leadername); database.GetCharName(cur->second->leader_char_id, leadername);
if (leadername[0] == '\0') if (leadername[0] == '\0')
c->Message(0, " Guild #%i <%s>", cur->first, cur->second->name.c_str()); c->Message(Chat::White, " Guild #%i <%s>", cur->first, cur->second->name.c_str());
else else
c->Message(0, " Guild #%i <%s> Leader: %s", cur->first, cur->second->name.c_str(), leadername); c->Message(Chat::White, " Guild #%i <%s> Leader: %s", cur->first, cur->second->name.c_str(), leadername);
r++; r++;
} }
c->Message(0, "%i guilds listed.", r); c->Message(Chat::White, "%i guilds listed.", r);
} }
@ -212,17 +212,17 @@ void ZoneGuildManager::DescribeGuild(Client *c, uint32 guild_id) const {
std::map<uint32, GuildInfo *>::const_iterator res; std::map<uint32, GuildInfo *>::const_iterator res;
res = m_guilds.find(guild_id); res = m_guilds.find(guild_id);
if(res == m_guilds.end()) { if(res == m_guilds.end()) {
c->Message(0, "Guild %d not found.", guild_id); c->Message(Chat::White, "Guild %d not found.", guild_id);
return; return;
} }
const GuildInfo *info = res->second; const GuildInfo *info = res->second;
c->Message(0, "Guild info DB# %i <%s>", guild_id, info->name.c_str()); c->Message(Chat::White, "Guild info DB# %i <%s>", guild_id, info->name.c_str());
char leadername[64]; char leadername[64];
database.GetCharName(info->leader_char_id, leadername); database.GetCharName(info->leader_char_id, leadername);
c->Message(0, "Guild Leader: %s", leadername); c->Message(Chat::White, "Guild Leader: %s", leadername);
char permbuffer[256]; char permbuffer[256];
uint8 i; uint8 i;
@ -232,8 +232,8 @@ void ZoneGuildManager::DescribeGuild(Client *c, uint32 guild_id) const {
for(r = 0; r < _MaxGuildAction; r++) for(r = 0; r < _MaxGuildAction; r++)
permptr += sprintf(permptr, " %s: %c", GuildActionNames[r], info->ranks[i].permissions[r]?'Y':'N'); permptr += sprintf(permptr, " %s: %c", GuildActionNames[r], info->ranks[i].permissions[r]?'Y':'N');
c->Message(0, "Rank %i: %s", i, info->ranks[i].name.c_str()); c->Message(Chat::White, "Rank %i: %s", i, info->ranks[i].name.c_str());
c->Message(0, "Permissions: %s", permbuffer); c->Message(Chat::White, "Permissions: %s", permbuffer);
} }
} }
@ -537,14 +537,14 @@ void ZoneGuildManager::AddMemberApproval(uint32 refid,Client* name)
if(tmp != 0) if(tmp != 0)
{ {
if(!tmp->AddMemberApproval(name)) if(!tmp->AddMemberApproval(name))
name->Message(0,"Unable to add to list."); name->Message(Chat::White,"Unable to add to list.");
else else
{ {
name->Message(0,"Added to list."); name->Message(Chat::White,"Added to list.");
} }
} }
else else
name->Message(0,"Unable to find guild reference id."); name->Message(Chat::White,"Unable to find guild reference id.");
} }
ZoneGuildManager::~ZoneGuildManager() ZoneGuildManager::~ZoneGuildManager()
@ -1391,13 +1391,13 @@ 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)
{ {
if(owner) if(owner)
owner->Message(0,"You took too long! Your guild request has been deleted."); owner->Message(Chat::White,"You took too long! Your guild request has been deleted.");
return false; return false;
} }
@ -1414,7 +1414,7 @@ GuildApproval::GuildApproval(const char* guildname, Client* owner,uint32 id)
this->owner = owner; this->owner = owner;
this->refid = id; this->refid = id;
if(owner) if(owner)
owner->Message(0,"You can now start getting your guild approved, tell your %i members to #guildapprove %i, you have 30 minutes to create your guild.",tmp,GetID()); owner->Message(Chat::White,"You can now start getting your guild approved, tell your %i members to #guildapprove %i, you have 30 minutes to create your guild.",tmp,GetID());
for(int i=0;i<tmp;i++) for(int i=0;i<tmp;i++)
members[i] = 0; members[i] = 0;
} }
@ -1463,7 +1463,7 @@ void GuildApproval::ApprovedMembers(Client* requestee)
for(int i=0;i<tmp;i++) for(int i=0;i<tmp;i++)
{ {
if(members[i]) if(members[i])
requestee->Message(0,"%i: %s",i,members[i]->GetName()); requestee->Message(Chat::White,"%i: %s",i,members[i]->GetName());
} }
} }
@ -1484,8 +1484,8 @@ void GuildApproval::GuildApproved()
{ {
if(members[i]) if(members[i])
{ {
owner->Message(0, "%s",members[i]->GetName()); owner->Message(Chat::White, "%s",members[i]->GetName());
owner->Message(0, "%i",members[i]->CharacterID()); owner->Message(Chat::White, "%i",members[i]->CharacterID());
guild_mgr.SetGuild(members[i]->CharacterID(),tmpeq,0); guild_mgr.SetGuild(members[i]->CharacterID(),tmpeq,0);
size_t len = MBUFFER - strlen(gmembers)+1; size_t len = MBUFFER - strlen(gmembers)+1;
strncat(gmembers," ",len); strncat(gmembers," ",len);
@ -1521,7 +1521,7 @@ void GuildApproval::GuildApproved()
memcpy(pack->pBuffer, &tmpeq, 4); memcpy(pack->pBuffer, &tmpeq, 4);
worldserver.SendPacket(pack); worldserver.SendPacket(pack);
safe_delete(pack); safe_delete(pack);
owner->Message(0, "Your guild was created."); owner->Message(Chat::White, "Your guild was created.");
owner = 0; owner = 0;
} }

View File

@ -608,7 +608,7 @@ void HateList::PrintHateListToClient(Client *c)
while (iterator != list.end()) while (iterator != list.end())
{ {
struct_HateList *e = (*iterator); struct_HateList *e = (*iterator);
c->Message(0, "- name: %s, damage: %d, hate: %d", c->Message(Chat::White, "- name: %s, damage: %d, hate: %d",
(e->entity_on_hatelist && e->entity_on_hatelist->GetName()) ? e->entity_on_hatelist->GetName() : "(null)", (e->entity_on_hatelist && e->entity_on_hatelist->GetName()) ? e->entity_on_hatelist->GetName() : "(null)",
e->hatelist_damage, e->stored_hate_amount); e->hatelist_damage, e->stored_hate_amount);

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); MessageString(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); MessageString(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);
} }
@ -1608,7 +1608,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
banker ? banker->GetName() : "UNKNOWN NPC", distance); banker ? banker->GetName() : "UNKNOWN NPC", distance);
database.SetMQDetectionFlag(AccountName(), GetName(), hacked_string, zone->GetShortName()); database.SetMQDetectionFlag(AccountName(), GetName(), hacked_string, zone->GetShortName());
safe_delete_array(hacked_string); safe_delete_array(hacked_string);
Kick(); // Kicking player to avoid item loss do to client and server inventories not being sync'd Kick("Inventory desync"); // Kicking player to avoid item loss do to client and server inventories not being sync'd
return false; return false;
} }
} }
@ -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.");
} }
} }
@ -1822,14 +1822,14 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
// Step 4: Check for entity trade // Step 4: Check for entity trade
if (dst_slot_id >= EQEmu::invslot::TRADE_BEGIN && dst_slot_id <= EQEmu::invslot::TRADE_END) { if (dst_slot_id >= EQEmu::invslot::TRADE_BEGIN && dst_slot_id <= EQEmu::invslot::TRADE_END) {
if (src_slot_id != EQEmu::invslot::slotCursor) { if (src_slot_id != EQEmu::invslot::slotCursor) {
Kick(); Kick("Trade with non-cursor item");
return false; return false;
} }
if (with) { if (with) {
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;
} }
} }
@ -3397,7 +3397,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
Log(Logs::General, Logs::Error, "Client::InterrogateInventory() called for %s by %s with an error state of %s", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE")); Log(Logs::General, Logs::Error, "Client::InterrogateInventory() called for %s by %s with an error state of %s", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE"));
} }
if (!silent) { if (!silent) {
requester->Message(1, "--- Inventory Interrogation Report for %s (requested by: %s, error state: %s) ---", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE")); requester->Message(Chat::Default, "--- Inventory Interrogation Report for %s (requested by: %s, error state: %s) ---", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE"));
} }
// call InterrogateInventory_ for report // call InterrogateInventory_ for report
@ -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();
@ -3419,8 +3419,8 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
Log(Logs::Detail, Logs::None, "[CLIENT] Client::InterrogateInventory() -- End"); Log(Logs::Detail, Logs::None, "[CLIENT] Client::InterrogateInventory() -- End");
} }
if (!silent) { if (!silent) {
requester->Message(1, "Target interrogation flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); requester->Message(Chat::Default, "Target interrogation flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE"));
requester->Message(1, "--- End of Interrogation Report ---"); requester->Message(Chat::Default, "--- End of Interrogation Report ---");
} }
instmap.clear(); instmap.clear();
@ -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

@ -47,7 +47,7 @@ bool Lua_Client::InZone() {
void Lua_Client::Kick() { void Lua_Client::Kick() {
Lua_Safe_Call_Void(); Lua_Safe_Call_Void();
self->Kick(); self->Kick("Lua Quest");
} }
void Lua_Client::Disconnect() { void Lua_Client::Disconnect() {

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

@ -743,9 +743,9 @@ void Lua_Mob::Message(int type, const char *message) {
self->Message(type, message); self->Message(type, message);
} }
void Lua_Mob::Message_StringID(int type, int string_id, uint32 distance) { void Lua_Mob::MessageString(int type, int string_id, uint32 distance) {
Lua_Safe_Call_Void(); Lua_Safe_Call_Void();
self->Message_StringID(type, string_id, distance); self->MessageString(type, string_id, distance);
} }
void Lua_Mob::Say(const char *message) { void Lua_Mob::Say(const char *message) {
@ -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) {
@ -2386,7 +2386,8 @@ luabind::scope lua_register_mob() {
.def("SetCurrentWP", &Lua_Mob::SetCurrentWP) .def("SetCurrentWP", &Lua_Mob::SetCurrentWP)
.def("GetSize", &Lua_Mob::GetSize) .def("GetSize", &Lua_Mob::GetSize)
.def("Message", &Lua_Mob::Message) .def("Message", &Lua_Mob::Message)
.def("Message_StringID", &Lua_Mob::Message_StringID) .def("MessageString", &Lua_Mob::MessageString)
.def("Message_StringID", &Lua_Mob::MessageString)
.def("Say", (void(Lua_Mob::*)(const char*))& Lua_Mob::Say) .def("Say", (void(Lua_Mob::*)(const char*))& Lua_Mob::Say)
.def("Say", (void(Lua_Mob::*)(const char*, int))& Lua_Mob::Say) .def("Say", (void(Lua_Mob::*)(const char*, int))& Lua_Mob::Say)
.def("QuestSay", (void(Lua_Mob::*)(Lua_Client,const char *))&Lua_Mob::QuestSay) .def("QuestSay", (void(Lua_Mob::*)(Lua_Client,const char *))&Lua_Mob::QuestSay)

View File

@ -166,7 +166,7 @@ public:
void SetCurrentWP(int wp); void SetCurrentWP(int wp);
double GetSize(); double GetSize();
void Message(int type, const char *message); void Message(int type, const char *message);
void Message_StringID(int type, int string_id, uint32 distance); void MessageString(int type, int string_id, uint32 distance);
void Say(const char *message); void Say(const char *message);
void Say(const char* message, int language); void Say(const char* message, int language);
void QuestSay(Lua_Client client, const char *message); void QuestSay(Lua_Client client, const char *message);

View File

@ -159,7 +159,7 @@ void Lua_NPC::SetSaveWaypoint(int wp) {
void Lua_NPC::SetSp2(int sg2) { void Lua_NPC::SetSp2(int sg2) {
Lua_Safe_Call_Void(); Lua_Safe_Call_Void();
self->SetSp2(sg2); self->SetSpawnGroupId(sg2);
} }
int Lua_NPC::GetWaypointMax() { int Lua_NPC::GetWaypointMax() {
@ -174,7 +174,7 @@ int Lua_NPC::GetGrid() {
uint32 Lua_NPC::GetSp2() { uint32 Lua_NPC::GetSp2() {
Lua_Safe_Call_Int(); Lua_Safe_Call_Int();
return self->GetSp2(); return self->GetSpawnGroupId();
} }
int Lua_NPC::GetNPCFactionID() { int Lua_NPC::GetNPCFactionID() {
@ -529,6 +529,24 @@ int Lua_NPC::GetAvoidanceRating()
return self->GetAvoidanceRating(); return self->GetAvoidanceRating();
} }
void Lua_NPC::SetSimpleRoamBox(float box_size)
{
Lua_Safe_Call_Void();
self->SetSimpleRoamBox(box_size);
}
void Lua_NPC::SetSimpleRoamBox(float box_size, float move_distance)
{
Lua_Safe_Call_Void();
self->SetSimpleRoamBox(box_size, move_distance);
}
void Lua_NPC::SetSimpleRoamBox(float box_size, float move_distance, int move_delay)
{
Lua_Safe_Call_Void();
self->SetSimpleRoamBox(box_size, move_distance, move_delay);
}
luabind::scope lua_register_npc() { luabind::scope lua_register_npc() {
return luabind::class_<Lua_NPC, Lua_Mob>("NPC") return luabind::class_<Lua_NPC, Lua_Mob>("NPC")
.def(luabind::constructor<>()) .def(luabind::constructor<>())
@ -614,6 +632,9 @@ luabind::scope lua_register_npc() {
.def("GetGuardPointZ", (float(Lua_NPC::*)(void))&Lua_NPC::GetGuardPointZ) .def("GetGuardPointZ", (float(Lua_NPC::*)(void))&Lua_NPC::GetGuardPointZ)
.def("SetPrimSkill", (void(Lua_NPC::*)(int))&Lua_NPC::SetPrimSkill) .def("SetPrimSkill", (void(Lua_NPC::*)(int))&Lua_NPC::SetPrimSkill)
.def("SetSecSkill", (void(Lua_NPC::*)(int))&Lua_NPC::SetSecSkill) .def("SetSecSkill", (void(Lua_NPC::*)(int))&Lua_NPC::SetSecSkill)
.def("SetSimpleRoamBox", (void(Lua_NPC::*)(float))&Lua_NPC::SetSimpleRoamBox)
.def("SetSimpleRoamBox", (void(Lua_NPC::*)(float, float))&Lua_NPC::SetSimpleRoamBox)
.def("SetSimpleRoamBox", (void(Lua_NPC::*)(float, float, int))&Lua_NPC::SetSimpleRoamBox)
.def("GetPrimSkill", (int(Lua_NPC::*)(void))&Lua_NPC::GetPrimSkill) .def("GetPrimSkill", (int(Lua_NPC::*)(void))&Lua_NPC::GetPrimSkill)
.def("GetSecSkill", (int(Lua_NPC::*)(void))&Lua_NPC::GetSecSkill) .def("GetSecSkill", (int(Lua_NPC::*)(void))&Lua_NPC::GetSecSkill)
.def("GetSwarmOwner", (int(Lua_NPC::*)(void))&Lua_NPC::GetSwarmOwner) .def("GetSwarmOwner", (int(Lua_NPC::*)(void))&Lua_NPC::GetSwarmOwner)

View File

@ -131,6 +131,9 @@ public:
void MerchantCloseShop(); void MerchantCloseShop();
int GetRawAC(); int GetRawAC();
int GetAvoidanceRating(); int GetAvoidanceRating();
void SetSimpleRoamBox(float box_size);
void SetSimpleRoamBox(float box_size, float move_distance);
void SetSimpleRoamBox(float box_size, float move_distance, int move_delay);
}; };
#endif #endif

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); MessageString(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);
} }
@ -1637,11 +1637,11 @@ void Merc::AI_Process() {
// TODO: Do mercs berserk? Find this out on live... // TODO: Do mercs berserk? Find this out on live...
//if (GetClass() == WARRIOR || GetClass() == BERSERKER) { //if (GetClass() == WARRIOR || GetClass() == BERSERKER) {
// if(GetHP() > 0 && !berserk && this->GetHPRatio() < 30) { // if(GetHP() > 0 && !berserk && this->GetHPRatio() < 30) {
// entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_START, GetName()); // entity_list.MessageCloseString(this, false, 200, 0, BERSERK_START, GetName());
// this->berserk = true; // this->berserk = true;
// } // }
// if (berserk && this->GetHPRatio() > 30) { // if (berserk && this->GetHPRatio() > 30) {
// entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_END, GetName()); // entity_list.MessageCloseString(this, false, 200, 0, BERSERK_END, GetName());
// this->berserk = false; // this->berserk = 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); MessageString(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

@ -1551,39 +1551,39 @@ void Mob::ShowStats(Client* client)
} }
else if (IsCorpse()) { else if (IsCorpse()) {
if (IsPlayerCorpse()) { if (IsPlayerCorpse()) {
client->Message(0, " CharID: %i PlayerCorpse: %i", CastToCorpse()->GetCharID(), CastToCorpse()->GetCorpseDBID()); client->Message(Chat::White, " CharID: %i PlayerCorpse: %i", CastToCorpse()->GetCharID(), CastToCorpse()->GetCorpseDBID());
} }
else { else {
client->Message(0, " NPCCorpse", GetID()); client->Message(Chat::White, " NPCCorpse", GetID());
} }
} }
else { else {
client->Message(0, " Level: %i AC: %i Class: %i Size: %1.1f Haste: %i", GetLevel(), ACSum(), GetClass(), GetSize(), GetHaste()); client->Message(Chat::White, " Level: %i AC: %i Class: %i Size: %1.1f Haste: %i", GetLevel(), ACSum(), GetClass(), GetSize(), GetHaste());
client->Message(0, " HP: %i Max HP: %i",GetHP(), GetMaxHP()); client->Message(Chat::White, " HP: %i Max HP: %i",GetHP(), GetMaxHP());
client->Message(0, " Mana: %i Max Mana: %i", GetMana(), GetMaxMana()); client->Message(Chat::White, " Mana: %i Max Mana: %i", GetMana(), GetMaxMana());
client->Message(0, " Total ATK: %i Worn/Spell ATK (Cap %i): %i", GetATK(), RuleI(Character, ItemATKCap), GetATKBonus()); client->Message(Chat::White, " Total ATK: %i Worn/Spell ATK (Cap %i): %i", GetATK(), RuleI(Character, ItemATKCap), GetATKBonus());
client->Message(0, " STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetSTR(), GetSTA(), GetDEX(), GetAGI(), GetINT(), GetWIS(), GetCHA()); client->Message(Chat::White, " STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetSTR(), GetSTA(), GetDEX(), GetAGI(), GetINT(), GetWIS(), GetCHA());
client->Message(0, " MR: %i PR: %i FR: %i CR: %i DR: %i Corruption: %i PhR: %i", GetMR(), GetPR(), GetFR(), GetCR(), GetDR(), GetCorrup(), GetPhR()); client->Message(Chat::White, " MR: %i PR: %i FR: %i CR: %i DR: %i Corruption: %i PhR: %i", GetMR(), GetPR(), GetFR(), GetCR(), GetDR(), GetCorrup(), GetPhR());
client->Message(0, " Race: %i BaseRace: %i Texture: %i HelmTexture: %i Gender: %i BaseGender: %i", GetRace(), GetBaseRace(), GetTexture(), GetHelmTexture(), GetGender(), GetBaseGender()); client->Message(Chat::White, " Race: %i BaseRace: %i Texture: %i HelmTexture: %i Gender: %i BaseGender: %i", GetRace(), GetBaseRace(), GetTexture(), GetHelmTexture(), GetGender(), GetBaseGender());
if (client->Admin() >= 100) if (client->Admin() >= 100)
client->Message(0, " EntityID: %i PetID: %i OwnerID: %i AIControlled: %i Targetted: %i", GetID(), GetPetID(), GetOwnerID(), IsAIControlled(), targeted); client->Message(Chat::White, " EntityID: %i PetID: %i OwnerID: %i AIControlled: %i Targetted: %i", GetID(), GetPetID(), GetOwnerID(), IsAIControlled(), targeted);
if (IsNPC()) { if (IsNPC()) {
NPC *n = CastToNPC(); NPC *n = CastToNPC();
uint32 spawngroupid = 0; uint32 spawngroupid = 0;
if(n->respawn2 != 0) if(n->respawn2 != 0)
spawngroupid = n->respawn2->SpawnGroupID(); spawngroupid = n->respawn2->SpawnGroupID();
client->Message(0, " NPCID: %u SpawnGroupID: %u Grid: %i LootTable: %u FactionID: %i SpellsID: %u ", GetNPCTypeID(),spawngroupid, n->GetGrid(), n->GetLoottableID(), n->GetNPCFactionID(), n->GetNPCSpellsID()); client->Message(Chat::White, " NPCID: %u SpawnGroupID: %u Grid: %i LootTable: %u FactionID: %i SpellsID: %u ", GetNPCTypeID(),spawngroupid, n->GetGrid(), n->GetLoottableID(), n->GetNPCFactionID(), n->GetNPCSpellsID());
client->Message(0, " Accuracy: %i MerchantID: %i EmoteID: %i Runspeed: %.3f Walkspeed: %.3f", n->GetAccuracyRating(), n->MerchantType, n->GetEmoteID(), static_cast<float>(0.025f * n->GetRunspeed()), static_cast<float>(0.025f * n->GetWalkspeed())); client->Message(Chat::White, " Accuracy: %i MerchantID: %i EmoteID: %i Runspeed: %.3f Walkspeed: %.3f", n->GetAccuracyRating(), n->MerchantType, n->GetEmoteID(), static_cast<float>(0.025f * n->GetRunspeed()), static_cast<float>(0.025f * n->GetWalkspeed()));
n->QueryLoot(client); n->QueryLoot(client);
} }
if (IsAIControlled()) { if (IsAIControlled()) {
client->Message(0, " AggroRange: %1.0f AssistRange: %1.0f", GetAggroRange(), GetAssistRange()); client->Message(Chat::White, " AggroRange: %1.0f AssistRange: %1.0f", GetAggroRange(), GetAssistRange());
} }
client->Message(0, " compute_tohit: %i TotalToHit: %i", compute_tohit(EQEmu::skills::SkillHandtoHand), GetTotalToHit(EQEmu::skills::SkillHandtoHand, 0)); client->Message(Chat::White, " compute_tohit: %i TotalToHit: %i", compute_tohit(EQEmu::skills::SkillHandtoHand), GetTotalToHit(EQEmu::skills::SkillHandtoHand, 0));
client->Message(0, " compute_defense: %i TotalDefense: %i", compute_defense(), GetTotalDefense()); client->Message(Chat::White, " compute_defense: %i TotalDefense: %i", compute_defense(), GetTotalDefense());
client->Message(0, " offense: %i mitigation ac: %i", offense(EQEmu::skills::SkillHandtoHand), GetMitigationAC()); client->Message(Chat::White, " offense: %i mitigation ac: %i", offense(EQEmu::skills::SkillHandtoHand), GetMitigationAC());
} }
} }
@ -1620,33 +1620,33 @@ void Mob::DoAnim(const int animnum, int type, bool ackreq, eqFilterType filter)
void Mob::ShowBuffs(Client* client) { void Mob::ShowBuffs(Client* client) {
if(SPDAT_RECORDS <= 0) if(SPDAT_RECORDS <= 0)
return; return;
client->Message(0, "Buffs on: %s", this->GetName()); client->Message(Chat::White, "Buffs on: %s", this->GetName());
uint32 i; uint32 i;
uint32 buff_count = GetMaxTotalSlots(); uint32 buff_count = GetMaxTotalSlots();
for (i=0; i < buff_count; i++) { for (i=0; i < buff_count; i++) {
if (buffs[i].spellid != SPELL_UNKNOWN) { if (buffs[i].spellid != SPELL_UNKNOWN) {
if (spells[buffs[i].spellid].buffdurationformula == DF_Permanent) if (spells[buffs[i].spellid].buffdurationformula == DF_Permanent)
client->Message(0, " %i: %s: Permanent", i, spells[buffs[i].spellid].name); client->Message(Chat::White, " %i: %s: Permanent", i, spells[buffs[i].spellid].name);
else else
client->Message(0, " %i: %s: %i tics left", i, spells[buffs[i].spellid].name, buffs[i].ticsremaining); client->Message(Chat::White, " %i: %s: %i tics left", i, spells[buffs[i].spellid].name, buffs[i].ticsremaining);
} }
} }
if (IsClient()){ if (IsClient()){
client->Message(0, "itembonuses:"); client->Message(Chat::White, "itembonuses:");
client->Message(0, "Atk:%i Ac:%i HP(%i):%i Mana:%i", itembonuses.ATK, itembonuses.AC, itembonuses.HPRegen, itembonuses.HP, itembonuses.Mana); client->Message(Chat::White, "Atk:%i Ac:%i HP(%i):%i Mana:%i", itembonuses.ATK, itembonuses.AC, itembonuses.HPRegen, itembonuses.HP, itembonuses.Mana);
client->Message(0, "Str:%i Sta:%i Dex:%i Agi:%i Int:%i Wis:%i Cha:%i", client->Message(Chat::White, "Str:%i Sta:%i Dex:%i Agi:%i Int:%i Wis:%i Cha:%i",
itembonuses.STR,itembonuses.STA,itembonuses.DEX,itembonuses.AGI,itembonuses.INT,itembonuses.WIS,itembonuses.CHA); itembonuses.STR,itembonuses.STA,itembonuses.DEX,itembonuses.AGI,itembonuses.INT,itembonuses.WIS,itembonuses.CHA);
client->Message(0, "SvMagic:%i SvFire:%i SvCold:%i SvPoison:%i SvDisease:%i", client->Message(Chat::White, "SvMagic:%i SvFire:%i SvCold:%i SvPoison:%i SvDisease:%i",
itembonuses.MR,itembonuses.FR,itembonuses.CR,itembonuses.PR,itembonuses.DR); itembonuses.MR,itembonuses.FR,itembonuses.CR,itembonuses.PR,itembonuses.DR);
client->Message(0, "DmgShield:%i Haste:%i", itembonuses.DamageShield, itembonuses.haste ); client->Message(Chat::White, "DmgShield:%i Haste:%i", itembonuses.DamageShield, itembonuses.haste );
client->Message(0, "spellbonuses:"); client->Message(Chat::White, "spellbonuses:");
client->Message(0, "Atk:%i Ac:%i HP(%i):%i Mana:%i", spellbonuses.ATK, spellbonuses.AC, spellbonuses.HPRegen, spellbonuses.HP, spellbonuses.Mana); client->Message(Chat::White, "Atk:%i Ac:%i HP(%i):%i Mana:%i", spellbonuses.ATK, spellbonuses.AC, spellbonuses.HPRegen, spellbonuses.HP, spellbonuses.Mana);
client->Message(0, "Str:%i Sta:%i Dex:%i Agi:%i Int:%i Wis:%i Cha:%i", client->Message(Chat::White, "Str:%i Sta:%i Dex:%i Agi:%i Int:%i Wis:%i Cha:%i",
spellbonuses.STR,spellbonuses.STA,spellbonuses.DEX,spellbonuses.AGI,spellbonuses.INT,spellbonuses.WIS,spellbonuses.CHA); spellbonuses.STR,spellbonuses.STA,spellbonuses.DEX,spellbonuses.AGI,spellbonuses.INT,spellbonuses.WIS,spellbonuses.CHA);
client->Message(0, "SvMagic:%i SvFire:%i SvCold:%i SvPoison:%i SvDisease:%i", client->Message(Chat::White, "SvMagic:%i SvFire:%i SvCold:%i SvPoison:%i SvDisease:%i",
spellbonuses.MR,spellbonuses.FR,spellbonuses.CR,spellbonuses.PR,spellbonuses.DR); spellbonuses.MR,spellbonuses.FR,spellbonuses.CR,spellbonuses.PR,spellbonuses.DR);
client->Message(0, "DmgShield:%i Haste:%i", spellbonuses.DamageShield, spellbonuses.haste ); client->Message(Chat::White, "DmgShield:%i Haste:%i", spellbonuses.DamageShield, spellbonuses.haste );
} }
} }
@ -1654,15 +1654,15 @@ void Mob::ShowBuffList(Client* client) {
if(SPDAT_RECORDS <= 0) if(SPDAT_RECORDS <= 0)
return; return;
client->Message(0, "Buffs on: %s", this->GetCleanName()); client->Message(Chat::White, "Buffs on: %s", this->GetCleanName());
uint32 i; uint32 i;
uint32 buff_count = GetMaxTotalSlots(); uint32 buff_count = GetMaxTotalSlots();
for (i = 0; i < buff_count; i++) { for (i = 0; i < buff_count; i++) {
if (buffs[i].spellid != SPELL_UNKNOWN) { if (buffs[i].spellid != SPELL_UNKNOWN) {
if (spells[buffs[i].spellid].buffdurationformula == DF_Permanent) if (spells[buffs[i].spellid].buffdurationformula == DF_Permanent)
client->Message(0, " %i: %s: Permanent", i, spells[buffs[i].spellid].name); client->Message(Chat::White, " %i: %s: Permanent", i, spells[buffs[i].spellid].name);
else else
client->Message(0, " %i: %s: %i tics left", i, spells[buffs[i].spellid].name, buffs[i].ticsremaining); client->Message(Chat::White, " %i: %s: %i tics left", i, spells[buffs[i].spellid].name, buffs[i].ticsremaining);
} }
} }
} }
@ -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());
} }
} }
@ -2789,10 +2789,10 @@ void Mob::WipeHateList()
} }
} }
uint32 Mob::RandomTimer(int min,int max) { uint32 Mob::RandomTimer(int min, int max)
{
int r = 14000; int r = 14000;
if(min != 0 && max != 0 && min < max) if (min != 0 && max != 0 && min < max) {
{
r = zone->random.Int(min, max); r = zone->random.Int(min, max);
} }
return r; return r;
@ -2835,7 +2835,7 @@ void Mob::Say(const char *format, ...)
talker = this; talker = this;
} }
entity_list.MessageClose_StringID( entity_list.MessageCloseString(
talker, false, 200, 10, talker, false, 200, 10,
GENERIC_SAY, GetCleanName(), buf GENERIC_SAY, GetCleanName(), buf
); );
@ -2844,48 +2844,50 @@ void Mob::Say(const char *format, ...)
// //
// this is like the above, but the first parameter is a string id // this is like the above, but the first parameter is a string id
// //
void Mob::Say_StringID(uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9) void Mob::SayString(uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9)
{ {
char string_id_str[10]; char string_id_str[10];
snprintf(string_id_str, 10, "%d", string_id); snprintf(string_id_str, 10, "%d", string_id);
entity_list.MessageClose_StringID(this, false, 200, 10, entity_list.MessageCloseString(
this, false, 200, 10,
GENERIC_STRINGID_SAY, GetCleanName(), string_id_str, message3, message4, message5, GENERIC_STRINGID_SAY, GetCleanName(), string_id_str, message3, message4, message5,
message6, message7, message8, message9 message6, message7, message8, message9
); );
} }
void Mob::Say_StringID(uint32 type, uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9) void Mob::SayString(uint32 type, uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9)
{ {
char string_id_str[10]; char string_id_str[10];
snprintf(string_id_str, 10, "%d", string_id); snprintf(string_id_str, 10, "%d", string_id);
entity_list.MessageClose_StringID(this, false, 200, type, entity_list.MessageCloseString(
this, false, 200, type,
GENERIC_STRINGID_SAY, GetCleanName(), string_id_str, message3, message4, message5, GENERIC_STRINGID_SAY, GetCleanName(), string_id_str, message3, message4, message5,
message6, message7, message8, message9 message6, message7, message8, message9
); );
} }
void Mob::SayTo_StringID(Client *to, uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9) void Mob::SayString(Client *to, uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9)
{ {
if (!to) if (!to)
return; return;
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->MessageString(Chat::NPCQuestSay, GENERIC_STRINGID_SAY, GetCleanName(), string_id_str.c_str(), message3, message4, message5, message6, message7, message8, message9);
} }
void Mob::SayTo_StringID(Client *to, uint32 type, uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9) void Mob::SayString(Client *to, uint32 type, uint32 string_id, const char *message3, const char *message4, const char *message5, const char *message6, const char *message7, const char *message8, const char *message9)
{ {
if (!to) if (!to)
return; return;
auto string_id_str = std::to_string(string_id); auto string_id_str = std::to_string(string_id);
to->Message_StringID(type, GENERIC_STRINGID_SAY, GetCleanName(), string_id_str.c_str(), message3, message4, message5, message6, message7, message8, message9); to->MessageString(type, GENERIC_STRINGID_SAY, GetCleanName(), string_id_str.c_str(), message3, message4, message5, message6, message7, message8, message9);
} }
void Mob::Shout(const char *format, ...) void Mob::Shout(const char *format, ...)
@ -2897,7 +2899,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.MessageString(this, false, Chat::Shout,
GENERIC_SHOUT, GetCleanName(), buf); GENERIC_SHOUT, GetCleanName(), buf);
} }
@ -2910,8 +2912,10 @@ void Mob::Emote(const char *format, ...)
vsnprintf(buf, 1000, format, ap); vsnprintf(buf, 1000, format, ap);
va_end(ap); va_end(ap);
entity_list.MessageClose_StringID(this, false, 200, 10, entity_list.MessageCloseString(
GENERIC_EMOTE, GetCleanName(), buf); this, false, 200, 10,
GENERIC_EMOTE, GetCleanName(), buf
);
} }
void Mob::QuestJournalledSay(Client *QuestInitiator, const char *str, Journal::Options &opts) void Mob::QuestJournalledSay(Client *QuestInitiator, const char *str, Journal::Options &opts)
@ -2920,7 +2924,7 @@ void Mob::QuestJournalledSay(Client *QuestInitiator, const char *str, Journal::O
if (opts.target_spawn_id == 0 && QuestInitiator) if (opts.target_spawn_id == 0 && QuestInitiator)
opts.target_spawn_id = QuestInitiator->GetID(); opts.target_spawn_id = QuestInitiator->GetID();
entity_list.QuestJournalledSayClose(this, QuestInitiator, 200, GetCleanName(), str, opts); entity_list.QuestJournalledSayClose(this, 200, GetCleanName(), str, opts);
} }
const char *Mob::GetCleanName() const char *Mob::GetCleanName()
@ -3569,7 +3573,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 +4891,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->MessageString(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->MessageString(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->MessageString(Chat::SpellFailure, SLOW_SLIGHTLY_SUCCESSFUL);
else if (GetSlowMitigation() > 100) else if (GetSlowMitigation() > 100)
caster->Message_StringID(MT_SpellFailure, SPELL_OPPOSITE_EFFECT); caster->MessageString(Chat::SpellFailure, SPELL_OPPOSITE_EFFECT);
} }
} }

View File

@ -722,25 +722,25 @@ public:
inline void SetRareSpawn(bool in) { rare_spawn = in; } inline void SetRareSpawn(bool in) { rare_spawn = in; }
virtual void Message(uint32 type, const char* message, ...) { } virtual void Message(uint32 type, const char* message, ...) { }
virtual void Message_StringID(uint32 type, uint32 string_id, uint32 distance = 0) { } virtual void MessageString(uint32 type, uint32 string_id, uint32 distance = 0) { }
virtual void Message_StringID(uint32 type, uint32 string_id, const char* message, const char* message2 = 0, virtual void MessageString(uint32 type, uint32 string_id, const char* message, const char* message2 = 0,
const char* message3 = 0, const char* message4 = 0, const char* message5 = 0, const char* message6 = 0, const char* message3 = 0, const char* message4 = 0, const char* message5 = 0, const char* message6 = 0,
const char* message7 = 0, const char* message8 = 0, const char* message9 = 0, uint32 distance = 0) { } const char* message7 = 0, const char* message8 = 0, const char* message9 = 0, uint32 distance = 0) { }
virtual void FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType filter, uint32 string_id) { } virtual void FilteredMessageString(Mob *sender, uint32 type, eqFilterType filter, uint32 string_id) { }
virtual void FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType filter, virtual void FilteredMessageString(Mob *sender, uint32 type, eqFilterType filter,
uint32 string_id, const char *message1, const char *message2 = nullptr, uint32 string_id, const char *message1, const char *message2 = nullptr,
const char *message3 = nullptr, const char *message4 = nullptr, const char *message3 = nullptr, const char *message4 = nullptr,
const char *message5 = nullptr, const char *message6 = nullptr, const char *message5 = nullptr, const char *message6 = nullptr,
const char *message7 = nullptr, const char *message8 = nullptr, const char *message7 = nullptr, const char *message8 = nullptr,
const char *message9 = nullptr) { } const char *message9 = nullptr) { }
void Say(const char *format, ...); void Say(const char *format, ...);
void Say_StringID(uint32 string_id, const char *message3 = 0, const char *message4 = 0, const char *message5 = 0, void SayString(uint32 string_id, const char *message3 = 0, const char *message4 = 0, const char *message5 = 0,
const char *message6 = 0, const char *message7 = 0, const char *message8 = 0, const char *message9 = 0); const char *message6 = 0, const char *message7 = 0, const char *message8 = 0, const char *message9 = 0);
void Say_StringID(uint32 type, uint32 string_id, const char *message3 = 0, const char *message4 = 0, const char *message5 = 0, void SayString(uint32 type, uint32 string_id, const char *message3 = 0, const char *message4 = 0, const char *message5 = 0,
const char *message6 = 0, const char *message7 = 0, const char *message8 = 0, const char *message9 = 0); const char *message6 = 0, const char *message7 = 0, const char *message8 = 0, const char *message9 = 0);
void SayTo_StringID(Client *to, uint32 string_id, const char *message3 = 0, const char *message4 = 0, const char *message5 = 0, void SayString(Client *to, uint32 string_id, const char *message3 = 0, const char *message4 = 0, const char *message5 = 0,
const char *message6 = 0, const char *message7 = 0, const char *message8 = 0, const char *message9 = 0); const char *message6 = 0, const char *message7 = 0, const char *message8 = 0, const char *message9 = 0);
void SayTo_StringID(Client *to, uint32 type, uint32 string_id, const char *message3 = 0, const char *message4 = 0, const char *message5 = 0, void SayString(Client *to, uint32 type, uint32 string_id, const char *message3 = 0, const char *message4 = 0, const char *message5 = 0,
const char *message6 = 0, const char *message7 = 0, const char *message8 = 0, const char *message9 = 0); const char *message6 = 0, const char *message7 = 0, const char *message8 = 0, const char *message9 = 0);
void Shout(const char *format, ...); void Shout(const char *format, ...);
void Emote(const char *format, ...); void Emote(const char *format, ...);

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->MessageString(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;
@ -1579,7 +1579,25 @@ void NPC::AI_DoMovement() {
if (GetCWP() == EQEmu::WaypointStatus::RoamBoxPauseInProgress && !IsMoving()) { if (GetCWP() == EQEmu::WaypointStatus::RoamBoxPauseInProgress && !IsMoving()) {
// We have arrived // We have arrived
time_until_can_move = Timer::GetCurrentTime() + RandomTimer(roambox_min_delay, roambox_delay);
int roambox_move_delay = EQEmu::ClampLower(GetRoamboxDelay(), GetRoamboxMinDelay());
int move_delay_max = (roambox_move_delay > 0 ? roambox_move_delay : (int) GetRoamboxMinDelay() * 4);
int random_timer = RandomTimer(
GetRoamboxMinDelay(),
move_delay_max
);
Log(
Logs::Detail,
Logs::NPCRoamBox, "(%s) Timer calc | random_timer [%i] roambox_move_delay [%i] move_min [%i] move_max [%i]",
this->GetCleanName(),
random_timer,
roambox_move_delay,
(int) GetRoamboxMinDelay(),
move_delay_max
);
time_until_can_move = Timer::GetCurrentTime() + random_timer;
SetCurrentWP(0); SetCurrentWP(0);
return; return;
} }
@ -1636,25 +1654,51 @@ void NPC::AI_DoMovement() {
} }
} }
roambox_destination_z = 0; PathfinderOptions opts;
/* opts.smooth_path = true;
if (zone->zonemap) { opts.step_size = RuleR(Pathing, NavmeshStepSize);
roambox_destination_z = FindGroundZ(roambox_destination_x, roambox_destination_y, this->GetZOffset()); opts.offset = GetZOffset();
} opts.flags = PathingNotDisabled ^ PathingZoneLine;
*/
Log(Logs::Detail, auto partial = false;
auto stuck = false;
auto route = zone->pathing->FindPath(
glm::vec3(GetX(), GetY(), GetZ()),
glm::vec3(
roambox_destination_x,
roambox_destination_y,
GetGroundZ(roambox_destination_x, roambox_destination_y)
),
partial,
stuck,
opts
);
if (route.empty()) {
Log(
Logs::Detail,
Logs::NPCRoamBox, "(%s) We don't have a path route... exiting...",
this->GetCleanName()
);
return;
}
roambox_destination_z = 0;
Log(
Logs::General,
Logs::NPCRoamBox, Logs::NPCRoamBox,
"Calculate | NPC: %s distance %.3f | min_x %.3f | max_x %.3f | final_x %.3f | min_y %.3f | max_y %.3f | final_y %.3f", "NPC (%s) distance [%.0f] X (min/max) [%.0f / %.0f] Y (min/max) [%.0f / %.0f] | Dest x/y/z [%.0f / %.0f / %.0f]",
this->GetCleanName(), this->GetCleanName(),
roambox_distance, roambox_distance,
roambox_min_x, roambox_min_x,
roambox_max_x, roambox_max_x,
roambox_destination_x,
roambox_min_y, roambox_min_y,
roambox_max_y, roambox_max_y,
roambox_destination_y); roambox_destination_x,
Log(Logs::Detail, Logs::NPCRoamBox, "Dest Z is (%f)", roambox_destination_z); roambox_destination_y,
roambox_destination_z
);
SetCurrentWP(EQEmu::WaypointStatus::RoamBoxPauseInProgress); SetCurrentWP(EQEmu::WaypointStatus::RoamBoxPauseInProgress);
NavigateTo(roambox_destination_x, roambox_destination_y, roambox_destination_z); NavigateTo(roambox_destination_x, roambox_destination_y, roambox_destination_z);
@ -1667,9 +1711,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 +1729,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 +2073,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.MessageCloseString(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.MessageCloseString(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 +2101,23 @@ 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.MessageCloseString(
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.MessageCloseString(
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 +2154,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.MessageCloseString(this, true, 200, Chat::NPCRampage, NPC_RAMPAGE, GetCleanName());
else else
entity_list.MessageClose_StringID(this, true, 200, MT_PetFlurry, NPC_RAMPAGE, GetCleanName()); entity_list.MessageCloseString(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 +2211,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.MessageCloseString(this, true, 200, Chat::NPCRampage, AE_RAMPAGE, GetCleanName());
} else { } else {
entity_list.MessageClose_StringID(this, true, 200, MT_PetFlurry, AE_RAMPAGE, GetCleanName()); entity_list.MessageCloseString(this, true, 200, Chat::PetFlurry, AE_RAMPAGE, GetCleanName());
} }
int rampage_targets = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 1); int rampage_targets = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 1);
@ -2744,7 +2802,7 @@ void NPC::AISpellsList(Client *c)
return; return;
for (auto it = AIspells.begin(); it != AIspells.end(); ++it) for (auto it = AIspells.begin(); it != AIspells.end(); ++it)
c->Message(0, "%s (%d): Type %d, Priority %d, Recast Delay %d, Resist Adjust %d, Min HP %d, Max HP %d", c->Message(Chat::White, "%s (%d): Type %d, Priority %d, Recast Delay %d, Resist Adjust %d, Min HP %d, Max HP %d",
spells[it->spellid].name, it->spellid, it->type, it->priority, it->recast_delay, it->resist_adjust, it->min_hp, it->max_hp); spells[it->spellid].name, it->spellid, it->type, it->priority, it->recast_delay, it->resist_adjust, it->min_hp, it->max_hp);
return; return;

View File

@ -278,7 +278,7 @@ inline std::string GetMobAttributeByString(Mob *mob, const std::string &attribut
return std::to_string((int)npc->GetWalkspeed()); return std::to_string((int)npc->GetWalkspeed());
} }
if (attribute == "spawngroup") { if (attribute == "spawngroup") {
return std::to_string(npc->GetSp2()); return std::to_string(npc->GetSpawnGroupId());
} }
if (attribute == "grid") { if (attribute == "grid") {
return std::to_string(npc->GetGrid()); return std::to_string(npc->GetGrid());
@ -624,7 +624,7 @@ inline void NPCCommandsMenu(Client* client, NPC* npc)
if (menu_commands.length() > 0) { if (menu_commands.length() > 0) {
std::string dev_menu = "[" + EQEmu::SayLinkEngine::GenerateQuestSaylink("#devtools", false, "DevTools") + "] ";; std::string dev_menu = "[" + EQEmu::SayLinkEngine::GenerateQuestSaylink("#devtools", false, "DevTools") + "] ";;
client->Message(0, "| %s [Show Commands] %s", dev_menu.c_str(), menu_commands.c_str()); client->Message(Chat::White, "| %s [Show Commands] %s", dev_menu.c_str(), menu_commands.c_str());
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -41,18 +41,29 @@ class MobMovementManager
public: public:
~MobMovementManager(); ~MobMovementManager();
void Process(); void Process();
void AddMob(Mob *m); void AddMob(Mob *mob);
void RemoveMob(Mob *m); void RemoveMob(Mob *mob);
void AddClient(Client *c); void AddClient(Client *client);
void RemoveClient(Client *c); void RemoveClient(Client *client);
void RotateTo(Mob *who, float to, MobMovementMode mode = MovementRunning); void RotateTo(Mob *who, float to, MobMovementMode mob_movement_mode = MovementRunning);
void Teleport(Mob *who, float x, float y, float z, float heading); void Teleport(Mob *who, float x, float y, float z, float heading);
void NavigateTo(Mob *who, float x, float y, float z, MobMovementMode mode = MovementRunning); void NavigateTo(Mob *who, float x, float y, float z, MobMovementMode mode = MovementRunning);
void StopNavigation(Mob *who); void StopNavigation(Mob *who);
void SendCommandToClients(Mob *m, float dx, float dy, float dz, float dh, int anim, ClientRange range);
void SendCommandToClients(
Mob *mob,
float delta_x,
float delta_y,
float delta_z,
float delta_heading,
int anim,
ClientRange range,
Client* single_client = nullptr
);
float FixHeading(float in); float FixHeading(float in);
void DumpStats(Client *to); void DumpStats(Client *client);
void ClearStats(); void ClearStats();
static MobMovementManager &Get() { static MobMovementManager &Get() {
@ -65,18 +76,18 @@ private:
MobMovementManager(const MobMovementManager&); MobMovementManager(const MobMovementManager&);
MobMovementManager& operator=(const MobMovementManager&); MobMovementManager& operator=(const MobMovementManager&);
void FillCommandStruct(PlayerPositionUpdateServer_Struct *spu, Mob *m, float dx, float dy, float dz, float dh, int anim); void FillCommandStruct(PlayerPositionUpdateServer_Struct *position_update, Mob *mob, float delta_x, float delta_y, float delta_z, float delta_heading, int anim);
void UpdatePath(Mob *who, float x, float y, float z, MobMovementMode mode); void UpdatePath(Mob *who, float x, float y, float z, MobMovementMode mob_movement_mode);
void UpdatePathGround(Mob *who, float x, float y, float z, MobMovementMode mode); void UpdatePathGround(Mob *who, float x, float y, float z, MobMovementMode mode);
void UpdatePathUnderwater(Mob *who, float x, float y, float z, MobMovementMode mode); void UpdatePathUnderwater(Mob *who, float x, float y, float z, MobMovementMode movement_mode);
void UpdatePathBoat(Mob *who, float x, float y, float z, MobMovementMode mode); void UpdatePathBoat(Mob *who, float x, float y, float z, MobMovementMode mode);
void PushTeleportTo(MobMovementEntry &ent, float x, float y, float z, float heading); void PushTeleportTo(MobMovementEntry &ent, float x, float y, float z, float heading);
void PushMoveTo(MobMovementEntry &ent, float x, float y, float z, MobMovementMode mode); void PushMoveTo(MobMovementEntry &ent, float x, float y, float z, MobMovementMode mob_movement_mode);
void PushSwimTo(MobMovementEntry &ent, float x, float y, float z, MobMovementMode mode); void PushSwimTo(MobMovementEntry &ent, float x, float y, float z, MobMovementMode mob_movement_mode);
void PushRotateTo(MobMovementEntry &ent, Mob *who, float to, MobMovementMode mode); void PushRotateTo(MobMovementEntry &ent, Mob *who, float to, MobMovementMode mob_movement_mode);
void PushStopMoving(MobMovementEntry &ent); void PushStopMoving(MobMovementEntry &mob_movement_entry);
void PushEvadeCombat(MobMovementEntry &ent); void PushEvadeCombat(MobMovementEntry &mob_movement_entry);
void HandleStuckBehavior(Mob *who, float x, float y, float z, MobMovementMode mode); void HandleStuckBehavior(Mob *who, float x, float y, float z, MobMovementMode mob_movement_mode);
struct Implementation; struct Implementation;
std::unique_ptr<Implementation> _impl; std::unique_ptr<Implementation> _impl;

View File

@ -146,33 +146,33 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
size = GetRaceGenderDefaultHeight(race, gender); size = GetRaceGenderDefaultHeight(race, gender);
} }
taunting = false; taunting = false;
proximity = nullptr; proximity = nullptr;
copper = 0; copper = 0;
silver = 0; silver = 0;
gold = 0; gold = 0;
platinum = 0; platinum = 0;
max_dmg = npc_type_data->max_dmg; max_dmg = npc_type_data->max_dmg;
min_dmg = npc_type_data->min_dmg; min_dmg = npc_type_data->min_dmg;
attack_count = npc_type_data->attack_count; attack_count = npc_type_data->attack_count;
grid = 0; grid = 0;
wp_m = 0; wp_m = 0;
max_wp = 0; max_wp = 0;
save_wp = 0; save_wp = 0;
spawn_group = 0; spawn_group_id = 0;
swarmInfoPtr = nullptr; swarmInfoPtr = nullptr;
spellscale = npc_type_data->spellscale; spellscale = npc_type_data->spellscale;
healscale = npc_type_data->healscale; healscale = npc_type_data->healscale;
pAggroRange = npc_type_data->aggroradius; pAggroRange = npc_type_data->aggroradius;
pAssistRange = npc_type_data->assistradius; pAssistRange = npc_type_data->assistradius;
findable = npc_type_data->findable; findable = npc_type_data->findable;
trackable = npc_type_data->trackable; trackable = npc_type_data->trackable;
MR = npc_type_data->MR; MR = npc_type_data->MR;
CR = npc_type_data->CR; CR = npc_type_data->CR;
DR = npc_type_data->DR; DR = npc_type_data->DR;
FR = npc_type_data->FR; FR = npc_type_data->FR;
PR = npc_type_data->PR; PR = npc_type_data->PR;
Corrup = npc_type_data->Corrup; Corrup = npc_type_data->Corrup;
PhR = npc_type_data->PhR; PhR = npc_type_data->PhR;
STR = npc_type_data->STR; STR = npc_type_data->STR;
STA = npc_type_data->STA; STA = npc_type_data->STA;
@ -611,7 +611,7 @@ void NPC::ClearItemList() {
void NPC::QueryLoot(Client* to) void NPC::QueryLoot(Client* to)
{ {
to->Message(0, "| # Current Loot (%s) LootTableID: %i", GetName(), GetLoottableID()); to->Message(Chat::White, "| # Current Loot (%s) LootTableID: %i", GetName(), GetLoottableID());
int item_count = 0; int item_count = 0;
for (auto cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++item_count) { for (auto cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++item_count) {
@ -639,7 +639,7 @@ void NPC::QueryLoot(Client* to)
); );
} }
to->Message(0, "| %i Platinum %i Gold %i Silver %i Copper", platinum, gold, silver, copper); to->Message(Chat::White, "| %i Platinum %i Gold %i Silver %i Copper", platinum, gold, silver, copper);
} }
void NPC::AddCash(uint16 in_copper, uint16 in_silver, uint16 in_gold, uint16 in_platinum) { void NPC::AddCash(uint16 in_copper, uint16 in_silver, uint16 in_gold, uint16 in_platinum) {
@ -1190,17 +1190,17 @@ NPC* NPC::SpawnNPC(const char* spawncommand, const glm::vec4& position, Client*
if (client) { if (client) {
// Notify client of spawn data // Notify client of spawn data
client->Message(0, "New spawn:"); client->Message(Chat::White, "New spawn:");
client->Message(0, "Name: %s", npc->name); client->Message(Chat::White, "Name: %s", npc->name);
client->Message(0, "Race: %u", npc->race); client->Message(Chat::White, "Race: %u", npc->race);
client->Message(0, "Level: %u", npc->level); client->Message(Chat::White, "Level: %u", npc->level);
client->Message(0, "Material: %u", npc->texture); client->Message(Chat::White, "Material: %u", npc->texture);
client->Message(0, "Current/Max HP: %i", npc->max_hp); client->Message(Chat::White, "Current/Max HP: %i", npc->max_hp);
client->Message(0, "Gender: %u", npc->gender); client->Message(Chat::White, "Gender: %u", npc->gender);
client->Message(0, "Class: %u", npc->class_); client->Message(Chat::White, "Class: %u", npc->class_);
client->Message(0, "Weapon Item Number: %u/%u", npc->d_melee_texture1, npc->d_melee_texture2); client->Message(Chat::White, "Weapon Item Number: %u/%u", npc->d_melee_texture1, npc->d_melee_texture2);
client->Message(0, "MerchantID: %u", npc->MerchantType); client->Message(Chat::White, "MerchantID: %u", npc->MerchantType);
client->Message(0, "Bodytype: %u", npc->bodytype); client->Message(Chat::White, "Bodytype: %u", npc->bodytype);
} }
return npc; return npc;
@ -1270,7 +1270,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char *zone, uint32 zone_version,
} }
uint32 spawngroupid = results.LastInsertedID(); uint32 spawngroupid = results.LastInsertedID();
spawn->SetSp2(spawngroupid); spawn->SetSpawnGroupId(spawngroupid);
spawn->SetNPCTypeID(npc_type_id); spawn->SetNPCTypeID(npc_type_id);
query = StringFormat("INSERT INTO spawn2 (zone, version, x, y, z, respawntime, heading, spawngroupID) " query = StringFormat("INSERT INTO spawn2 (zone, version, x, y, z, respawntime, heading, spawngroupID) "
@ -1355,7 +1355,7 @@ uint32 ZoneDatabase::DeleteSpawnLeaveInNPCTypeTable(const char *zone, Client *cl
std::string query = StringFormat("SELECT id, spawngroupID FROM spawn2 WHERE " std::string query = StringFormat("SELECT id, spawngroupID FROM spawn2 WHERE "
"zone='%s' AND spawngroupID=%i", "zone='%s' AND spawngroupID=%i",
zone, spawn->GetSp2()); zone, spawn->GetSpawnGroupId());
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) if (!results.Success())
return 0; return 0;
@ -1396,7 +1396,7 @@ uint32 ZoneDatabase::DeleteSpawnRemoveFromNPCTypeTable(const char *zone, uint32
std::string query = StringFormat("SELECT id, spawngroupID FROM spawn2 WHERE zone = '%s' " std::string query = StringFormat("SELECT id, spawngroupID FROM spawn2 WHERE zone = '%s' "
"AND (version = %u OR version = -1) AND spawngroupID = %i", "AND (version = %u OR version = -1) AND spawngroupID = %i",
zone, zone_version, spawn->GetSp2()); zone, zone_version, spawn->GetSpawnGroupId());
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) if (!results.Success())
return 0; return 0;
@ -1471,7 +1471,7 @@ uint32 ZoneDatabase::AddNPCTypes(const char *zone, uint32 zone_version, Client *
npc_type_id = results.LastInsertedID(); npc_type_id = results.LastInsertedID();
if (client) if (client)
client->Message(0, "%s npc_type ID %i created successfully!", numberlessName, npc_type_id); client->Message(Chat::White, "%s npc_type ID %i created successfully!", numberlessName, npc_type_id);
return 1; return 1;
} }
@ -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;
} }
@ -1694,7 +1694,7 @@ void NPC::PickPocket(Client* thief)
return; return;
} }
thief->Message(0, "This target's pockets are empty"); thief->Message(Chat::White, "This target's pockets are empty");
thief->SendPickPocketResponse(this, 0, PickPocketFailed); thief->SendPickPocketResponse(this, 0, PickPocketFailed);
} }
@ -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->MessageString(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->MessageString(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->MessageString(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) {
@ -2592,7 +2592,7 @@ void NPC::DoNPCEmote(uint8 event_, uint16 emoteid)
else if(nes->type == 2) else if(nes->type == 2)
this->Shout("%s",nes->text); this->Shout("%s",nes->text);
else if(nes->type == 3) else if(nes->type == 3)
entity_list.MessageClose_StringID(this, true, 200, 10, GENERIC_STRING, nes->text); entity_list.MessageCloseString(this, true, 200, 10, GENERIC_STRING, nes->text);
else else
this->Say("%s",nes->text); this->Say("%s",nes->text);
} }
@ -2924,3 +2924,15 @@ bool NPC::IsProximitySet()
return false; return false;
} }
void NPC::SetSimpleRoamBox(float box_size, float move_distance, int move_delay)
{
AI_SetRoambox(
(move_distance != 0 ? move_distance : box_size / 2),
GetX() + box_size,
GetX() - box_size,
GetY() + box_size,
GetY() - box_size,
move_delay
);
}

View File

@ -214,13 +214,13 @@ public:
virtual int32 CalcMaxMana(); virtual int32 CalcMaxMana();
void SetGrid(int32 grid_){ grid=grid_; } void SetGrid(int32 grid_){ grid=grid_; }
void SetSp2(uint32 sg2){ spawn_group=sg2; } void SetSpawnGroupId(uint32 sg2){ spawn_group_id =sg2; }
void SetWaypointMax(uint16 wp_){ wp_m=wp_; } void SetWaypointMax(uint16 wp_){ wp_m=wp_; }
void SetSaveWaypoint(uint16 wp_){ save_wp=wp_; } void SetSaveWaypoint(uint16 wp_){ save_wp=wp_; }
uint16 GetWaypointMax() const { return wp_m; } uint16 GetWaypointMax() const { return wp_m; }
int32 GetGrid() const { return grid; } int32 GetGrid() const { return grid; }
uint32 GetSp2() const { return spawn_group; } uint32 GetSpawnGroupId() const { return spawn_group_id; }
uint32 GetSpawnPointID() const; uint32 GetSpawnPointID() const;
glm::vec4 const GetSpawnPoint() const { return m_SpawnPoint; } glm::vec4 const GetSpawnPoint() const { return m_SpawnPoint; }
@ -453,6 +453,8 @@ public:
bool IgnoreDespawn() { return ignore_despawn; } bool IgnoreDespawn() { return ignore_despawn; }
void SetSimpleRoamBox(float box_size, float move_distance = 0, int move_delay = 0);
float GetRoamboxMaxX() const; float GetRoamboxMaxX() const;
float GetRoamboxMaxY() const; float GetRoamboxMaxY() const;
float GetRoamboxMinX() const; float GetRoamboxMinX() const;
@ -478,13 +480,13 @@ protected:
friend class EntityList; friend class EntityList;
friend class Aura; friend class Aura;
std::list<struct NPCFaction*> faction_list; std::list<struct NPCFaction*> faction_list;
uint32 copper; uint32 copper;
uint32 silver; uint32 silver;
uint32 gold; uint32 gold;
uint32 platinum; uint32 platinum;
int32 grid; int32 grid;
uint32 spawn_group; uint32 spawn_group_id;
uint16 wp_m; uint16 wp_m;
int32 npc_faction_id; int32 npc_faction_id;
int32 primary_faction; int32 primary_faction;

View File

@ -572,7 +572,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
if (sender->ClientVersion() >= EQEmu::versions::ClientVersion::RoF) { if (sender->ClientVersion() >= EQEmu::versions::ClientVersion::RoF) {
coa->drop_id = 0xFFFFFFFF; coa->drop_id = 0xFFFFFFFF;
sender->Message(0, "Someone else is using that. Try again later."); sender->Message(Chat::White, "Someone else is using that. Try again later.");
} }
} }

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)); MessageString(Chat::White,DISCIPLINE_CANUSEIN,ConvertArray((remain)/60,val1),ConvertArray(remain%60,val2));
//Message(0,"You can use a new discipline in %i minutes %i seconds.", (disc_timer.GetRemainingTime()/1000)/60, disc_timer.GetRemainingTime()/1000%60); //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;
} }
@ -1233,7 +1233,7 @@ Message(0, "Disc packet id=%d, %x,%x,%x", disc_in->disc_id, disc_in->unknown3[0]
return; return;
duration = 11; duration = 11;
reuse = 60*60; reuse = 60*60;
entity_list.MessageClose_StringID(this, false, 100, 0, DISCIPLINE_FEARLESS, GetName()); entity_list.MessageCloseString(this, false, 100, 0, DISCIPLINE_FEARLESS, GetName());
//entity_list.MessageClose(this, false, 100, 0, "%s becomes fearless!", GetName()); //entity_list.MessageClose(this, false, 100, 0, "%s becomes fearless!", GetName());
break; break;
} }

View File

@ -355,7 +355,7 @@ void PathfinderNavmesh::DebugCommand(Client *c, const Seperator *sep)
{ {
if (sep->arg[1][0] == '\0' || !strcasecmp(sep->arg[1], "help")) if (sep->arg[1][0] == '\0' || !strcasecmp(sep->arg[1], "help"))
{ {
c->Message(0, "#path show: Plots a path from the user to their target."); c->Message(Chat::White, "#path show: Plots a path from the user to their target.");
return; return;
} }

View File

@ -200,9 +200,9 @@ void PathfinderWaypoint::DebugCommand(Client *c, const Seperator *sep)
{ {
if(sep->arg[1][0] == '\0' || !strcasecmp(sep->arg[1], "help")) if(sep->arg[1][0] == '\0' || !strcasecmp(sep->arg[1], "help"))
{ {
c->Message(0, "Syntax: #path shownodes: Spawns a npc to represent every npc node."); c->Message(Chat::White, "Syntax: #path shownodes: Spawns a npc to represent every npc node.");
c->Message(0, "#path show: Plots a path from the user to their target."); c->Message(Chat::White, "#path show: Plots a path from the user to their target.");
c->Message(0, "#path info node_id: Gives information about node info (requires shownode target)."); c->Message(Chat::White, "#path info node_id: Gives information about node info (requires shownode target).");
return; return;
} }
@ -425,11 +425,11 @@ void PathfinderWaypoint::NodeInfo(Client *c)
return; return;
} }
c->Message(0, "Pathing node: %i at (%.2f, %.2f, %.2f) with bestz %.2f", c->Message(Chat::White, "Pathing node: %i at (%.2f, %.2f, %.2f) with bestz %.2f",
node->id, node->v.x, node->v.y, node->v.z, node->bestz); node->id, node->v.x, node->v.y, node->v.z, node->bestz);
for (auto &edge : node->edges) { for (auto &edge : node->edges) {
c->Message(0, "id: %i, distance: %.2f, door id: %i, is teleport: %i", c->Message(Chat::White, "id: %i, distance: %.2f, door id: %i, is teleport: %i",
edge.first, edge.first,
edge.second.distance, edge.second.distance,
edge.second.door_id, edge.second.door_id,

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

@ -174,7 +174,7 @@ XS(XS_Client_Kick) {
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
THIS->Kick(); THIS->Kick("Perl Quest");
} }
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }

View File

@ -3702,7 +3702,7 @@ XS(XS_Mob_Message_StringID) {
distance = (uint32) SvUV(ST(3)); distance = (uint32) SvUV(ST(3));
} }
THIS->Message_StringID(type, string_id, distance); THIS->MessageString(type, string_id, distance);
} }
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }

View File

@ -571,7 +571,7 @@ XS(XS_NPC_SetSp2) {
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
THIS->SetSp2(sg2); THIS->SetSpawnGroupId(sg2);
} }
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }
@ -644,7 +644,7 @@ XS(XS_NPC_GetSp2) {
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetSp2(); RETVAL = THIS->GetSpawnGroupId();
XSprePUSH; XSprePUSH;
PUSHu((UV) RETVAL); PUSHu((UV) RETVAL);
} }
@ -2377,6 +2377,42 @@ XS(XS_NPC_GetCombatState) {
XSRETURN(1); XSRETURN(1);
} }
XS(XS_NPC_SetSimpleRoamBox); /* prototype to pass -Wmissing-prototypes */
XS(XS_NPC_SetSimpleRoamBox) {
dXSARGS;
if (items < 2)
Perl_croak(aTHX_ "Usage: NPC::SetSimpleRoamBox(THIS, box_size, move_distance, move_delay)");
{
NPC *THIS;
auto box_size = (float) SvNV(ST(1));
float move_distance = 0;
int move_delay = 0;
if (items >= 3) {
move_distance = (float) SvNV(ST(2));
}
if (items >= 4) {
move_delay = (int) SvIV(ST(3));
}
if (sv_derived_from(ST(0), "NPC")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(NPC *, tmp);
}
else {
Perl_croak(aTHX_ "THIS is not of type NPC");
}
if (THIS == nullptr) {
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
}
THIS->SetSimpleRoamBox(box_size, move_distance, move_delay);
}
XSRETURN_EMPTY;
}
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
@ -2488,6 +2524,7 @@ XS(boot_NPC) {
newXSproto(strcpy(buf, "ChangeLastName"), XS_NPC_ChangeLastName, file, "$:$"); newXSproto(strcpy(buf, "ChangeLastName"), XS_NPC_ChangeLastName, file, "$:$");
newXSproto(strcpy(buf, "ClearLastName"), XS_NPC_ClearLastName, file, "$"); newXSproto(strcpy(buf, "ClearLastName"), XS_NPC_ClearLastName, file, "$");
newXSproto(strcpy(buf, "GetCombatState"), XS_NPC_GetCombatState, file, "$"); newXSproto(strcpy(buf, "GetCombatState"), XS_NPC_GetCombatState, file, "$");
newXSproto(strcpy(buf, "SetSimpleRoamBox"), XS_NPC_SetSimpleRoamBox, file, "$$;$$");
XSRETURN_YES; XSRETURN_YES;
} }

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

@ -161,12 +161,10 @@ void QuestManager::say(const char *str, Journal::Options &opts) {
return; return;
} }
else { else {
if (!RuleB(NPC, EnableNPCQuestJournal)) // if there is no initiator we still want stuff to work (timers, signals, waypoints, etc)
if (!RuleB(NPC, EnableNPCQuestJournal) || initiator == nullptr)
opts.journal_mode = Journal::Mode::None; opts.journal_mode = Journal::Mode::None;
if (initiator) { owner->QuestJournalledSay(initiator, str, opts);
opts.target_spawn_id = initiator->GetID();
owner->QuestJournalledSay(initiator, str, opts);
}
} }
} }
@ -236,59 +234,48 @@ Mob* QuestManager::unique_spawn(int npc_type, int grid, int unused, const glm::v
return nullptr; return nullptr;
} }
Mob* QuestManager::spawn_from_spawn2(uint32 spawn2_id) Mob *QuestManager::spawn_from_spawn2(uint32 spawn2_id)
{ {
LinkedListIterator<Spawn2*> iterator(zone->spawn2_list); LinkedListIterator<Spawn2 *> iterator(zone->spawn2_list);
iterator.Reset(); iterator.Reset();
Spawn2 *found_spawn = nullptr; Spawn2 *found_spawn = nullptr;
while(iterator.MoreElements()) while (iterator.MoreElements()) {
{ Spawn2 *cur = iterator.GetData();
Spawn2* cur = iterator.GetData();
iterator.Advance(); iterator.Advance();
if(cur->GetID() == spawn2_id) if (cur->GetID() == spawn2_id) {
{
found_spawn = cur; found_spawn = cur;
break; break;
} }
} }
if(found_spawn) if (found_spawn) {
{ SpawnGroup *spawn_group = zone->spawn_group_list.GetSpawnGroup(found_spawn->SpawnGroupID());
SpawnGroup* sg = zone->spawn_group_list.GetSpawnGroup(found_spawn->SpawnGroupID()); if (!spawn_group) {
if(!sg) database.LoadSpawnGroupsByID(found_spawn->SpawnGroupID(), &zone->spawn_group_list);
{ spawn_group = zone->spawn_group_list.GetSpawnGroup(found_spawn->SpawnGroupID());
database.LoadSpawnGroupsByID(found_spawn->SpawnGroupID(),&zone->spawn_group_list); if (!spawn_group) {
sg = zone->spawn_group_list.GetSpawnGroup(found_spawn->SpawnGroupID());
if(!sg)
{
return nullptr; return nullptr;
} }
} }
uint32 npcid = sg->GetNPCType(); uint32 npcid = spawn_group->GetNPCType();
if(npcid == 0) if (npcid == 0) {
{
return nullptr; return nullptr;
} }
const NPCType* tmp = database.LoadNPCTypesData(npcid); const NPCType *tmp = database.LoadNPCTypesData(npcid);
if(!tmp) if (!tmp) {
{
return nullptr; return nullptr;
} }
if(tmp->unique_spawn_by_name) if (tmp->unique_spawn_by_name) {
{ if (!entity_list.LimitCheckName(tmp->name)) {
if(!entity_list.LimitCheckName(tmp->name))
{
return nullptr; return nullptr;
} }
} }
if(tmp->spawn_limit > 0) if (tmp->spawn_limit > 0) {
{ if (!entity_list.LimitCheckType(npcid, tmp->spawn_limit)) {
if(!entity_list.LimitCheckType(npcid, tmp->spawn_limit))
{
return nullptr; return nullptr;
} }
} }
@ -296,21 +283,35 @@ Mob* QuestManager::spawn_from_spawn2(uint32 spawn2_id)
database.UpdateRespawnTime(spawn2_id, zone->GetInstanceID(), 0); database.UpdateRespawnTime(spawn2_id, zone->GetInstanceID(), 0);
found_spawn->SetCurrentNPCID(npcid); found_spawn->SetCurrentNPCID(npcid);
auto position = glm::vec4(found_spawn->GetX(), found_spawn->GetY(), found_spawn->GetZ(), found_spawn->GetHeading()); auto position = glm::vec4(
found_spawn->GetX(),
found_spawn->GetY(),
found_spawn->GetZ(),
found_spawn->GetHeading()
);
auto npc = new NPC(tmp, found_spawn, position, GravityBehavior::Water); auto npc = new NPC(tmp, found_spawn, position, GravityBehavior::Water);
found_spawn->SetNPCPointer(npc); found_spawn->SetNPCPointer(npc);
npc->AddLootTable(); npc->AddLootTable();
if (npc->DropsGlobalLoot()) if (npc->DropsGlobalLoot()) {
npc->CheckGlobalLootTables(); npc->CheckGlobalLootTables();
npc->SetSp2(found_spawn->SpawnGroupID()); }
npc->SetSpawnGroupId(found_spawn->SpawnGroupID());
entity_list.AddNPC(npc); entity_list.AddNPC(npc);
entity_list.LimitAddNPC(npc); entity_list.LimitAddNPC(npc);
if (sg->roamdist && sg->roambox[0] && sg->roambox[1] && sg->roambox[2] && sg->roambox[3] && sg->delay && if (spawn_group->roamdist > 0) {
sg->min_delay) npc->AI_SetRoambox(
npc->AI_SetRoambox(sg->roamdist, sg->roambox[0], sg->roambox[1], sg->roambox[2], sg->roambox[3], spawn_group->roamdist,
sg->delay, sg->min_delay); spawn_group->roambox[0],
spawn_group->roambox[1],
spawn_group->roambox[2],
spawn_group->roambox[3],
spawn_group->delay,
spawn_group->min_delay
);
}
if (zone->InstantGrids()) { if (zone->InstantGrids()) {
found_spawn->LoadGrid(); found_spawn->LoadGrid();
} }
@ -807,13 +808,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(); initiator->Kick("Deity change by QuestManager");
} }
else else
{ {
initiator->Message(15,"Error changing Deity"); initiator->Message(Chat::Yellow,"Error changing Deity");
} }
} }
} }
@ -929,11 +930,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");
} }
} }
} }
@ -943,7 +944,7 @@ void QuestManager::permaclass(int class_id) {
//Makes the client the class specified //Makes the client the class specified
initiator->SetBaseClass(class_id); initiator->SetBaseClass(class_id);
initiator->Save(2); initiator->Save(2);
initiator->Kick(); initiator->Kick("Base class change by QuestManager");
} }
void QuestManager::permarace(int race_id) { void QuestManager::permarace(int race_id) {
@ -951,7 +952,7 @@ void QuestManager::permarace(int race_id) {
//Makes the client the race specified //Makes the client the race specified
initiator->SetBaseRace(race_id); initiator->SetBaseRace(race_id);
initiator->Save(2); initiator->Save(2);
initiator->Kick(); initiator->Kick("Base race change by QuestManager");
} }
void QuestManager::permagender(int gender_id) { void QuestManager::permagender(int gender_id) {
@ -959,7 +960,7 @@ void QuestManager::permagender(int gender_id) {
//Makes the client the gender specified //Makes the client the gender specified
initiator->SetBaseGender(gender_id); initiator->SetBaseGender(gender_id);
initiator->Save(2); initiator->Save(2);
initiator->Kick(); initiator->Kick("Base gender change by QuestManager");
} }
uint16 QuestManager::scribespells(uint8 max_level, uint8 min_level) { uint16 QuestManager::scribespells(uint8 max_level, uint8 min_level) {
@ -986,11 +987,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 +1009,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 +1060,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 +1078,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 +1087,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) {
@ -1097,7 +1098,7 @@ uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) {
initiator->GetPP().disciplines.values[r] = spell_id_; initiator->GetPP().disciplines.values[r] = spell_id_;
database.SaveCharacterDisc(char_id, r, spell_id_); database.SaveCharacterDisc(char_id, r, spell_id_);
change = true; change = true;
initiator->Message(0, "You have learned a new discipline!"); initiator->Message(Chat::White, "You have learned a new discipline!");
++count; // success counter ++count; // success counter
} }
break; // continue the 1st loop break; // continue the 1st loop
@ -1109,7 +1110,7 @@ uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) {
initiator->GetPP().disciplines.values[r] = spell_id_; initiator->GetPP().disciplines.values[r] = spell_id_;
database.SaveCharacterDisc(char_id, r, spell_id_); database.SaveCharacterDisc(char_id, r, spell_id_);
change = true; change = true;
initiator->Message(0, "You have learned a new discipline!"); initiator->Message(Chat::White, "You have learned a new discipline!");
++count; ++count;
} }
break; break;
@ -1118,7 +1119,7 @@ uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) {
initiator->GetPP().disciplines.values[r] = spell_id_; initiator->GetPP().disciplines.values[r] = spell_id_;
database.SaveCharacterDisc(char_id, r, spell_id_); database.SaveCharacterDisc(char_id, r, spell_id_);
change = true;; change = true;;
initiator->Message(0, "You have learned a new discipline!"); initiator->Message(Chat::White, "You have learned a new discipline!");
++count; // success counter ++count; // success counter
break; // continue the 1st loop break; // continue the 1st loop
} }
@ -1190,7 +1191,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());
} }
} }
@ -1411,7 +1412,7 @@ void QuestManager::itemlink(int item_id) {
linker.SetLinkType(EQEmu::saylink::SayLinkItemData); linker.SetLinkType(EQEmu::saylink::SayLinkItemData);
linker.SetItemData(item); linker.SetItemData(item);
initiator->Message(0, "%s tells you, %s", owner->GetCleanName(), linker.GenerateLink().c_str()); initiator->Message(Chat::White, "%s tells you, %s", owner->GetCleanName(), linker.GenerateLink().c_str());
} }
} }
@ -2164,18 +2165,18 @@ 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;
} }
std::string test_name = name; std::string test_name = name;
bool available_flag = false; bool available_flag = false;
if(!database.botdb.QueryNameAvailablity(test_name, available_flag)) { if(!database.botdb.QueryNameAvailablity(test_name, available_flag)) {
initiator->Message(0, "%s for '%s'", BotDatabase::fail::QueryNameAvailablity(), (char*)name); initiator->Message(Chat::White, "%s for '%s'", BotDatabase::fail::QueryNameAvailablity(), (char*)name);
return false; return false;
} }
if (!available_flag) { if (!available_flag) {
initiator->Message(0, "The name %s is already being used or is invalid. Please choose a different name.", (char*)name); initiator->Message(Chat::White, "The name %s is already being used or is invalid. Please choose a different name.", (char*)name);
return false; return false;
} }
@ -2184,23 +2185,23 @@ bool QuestManager::createBot(const char *name, const char *lastname, uint8 level
if(NewBot) if(NewBot)
{ {
if(!NewBot->IsValidRaceClassCombo()) { if(!NewBot->IsValidRaceClassCombo()) {
initiator->Message(0, "That Race/Class combination cannot be created."); initiator->Message(Chat::White, "That Race/Class combination cannot be created.");
return false; return false;
} }
if(!NewBot->IsValidName()) { if(!NewBot->IsValidName()) {
initiator->Message(0, "%s has invalid characters. You can use only the A-Z, a-z and _ characters in a bot name.", NewBot->GetCleanName()); initiator->Message(Chat::White, "%s has invalid characters. You can use only the A-Z, a-z and _ characters in a bot name.", NewBot->GetCleanName());
return false; return false;
} }
// Now that all validation is complete, we can save our newly created bot // Now that all validation is complete, we can save our newly created bot
if(!NewBot->Save()) if(!NewBot->Save())
{ {
initiator->Message(0, "Unable to save %s as a bot.", NewBot->GetCleanName()); initiator->Message(Chat::White, "Unable to save %s as a bot.", NewBot->GetCleanName());
} }
else else
{ {
initiator->Message(0, "%s saved as bot %u.", NewBot->GetCleanName(), NewBot->GetBotID()); initiator->Message(Chat::White, "%s saved as bot %u.", NewBot->GetCleanName(), NewBot->GetBotID());
return true; return true;
} }
} }
@ -2657,13 +2658,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 +2777,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 +2795,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

@ -813,7 +813,7 @@ void Raid::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum
//I could not get MoneyOnCorpse to work, so we use this //I could not get MoneyOnCorpse to work, so we use this
members[i].member->AddMoneyToPP(cpsplit, spsplit, gpsplit, ppsplit, true); members[i].member->AddMoneyToPP(cpsplit, spsplit, gpsplit, ppsplit, true);
members[i].member->Message(2, msg.c_str()); members[i].member->Message(Chat::Green, msg.c_str());
} }
} }
} }
@ -1712,12 +1712,12 @@ const char *Raid::GetClientNameByIndex(uint8 index)
return members[index].membername; return members[index].membername;
} }
void Raid::RaidMessage_StringID(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2,const char* message3,const char* message4,const char* message5,const char* message6,const char* message7,const char* message8,const char* message9, uint32 distance) { void Raid::RaidMessageString(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2,const char* message3,const char* message4,const char* message5,const char* message6,const char* message7,const char* message8,const char* message9, uint32 distance) {
uint32 i; uint32 i;
for (i = 0; i < MAX_RAID_MEMBERS; i++) { for (i = 0; i < MAX_RAID_MEMBERS; i++) {
if(members[i].member) { if(members[i].member) {
if(members[i].member != sender) if(members[i].member != sender)
members[i].member->Message_StringID(type, string_id, message, message2, message3, message4, message5, message6, message7, message8, message9, distance); members[i].member->MessageString(type, string_id, message, message2, message3, message4, message5, message6, message7, message8, message9, distance);
} }
} }
} }

View File

@ -152,7 +152,7 @@ public:
//Actual Implementation Stuff //Actual Implementation Stuff
void RaidMessage_StringID(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0); void RaidMessageString(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0);
void CastGroupSpell(Mob* caster,uint16 spellid, uint32 gid); void CastGroupSpell(Mob* caster,uint16 spellid, uint32 gid);
void SplitExp(uint32 exp, Mob* other); void SplitExp(uint32 exp, Mob* other);
uint32 GetTotalRaidDamage(Mob* other); uint32 GetTotalRaidDamage(Mob* other);

View File

@ -264,7 +264,7 @@ bool Spawn2::Process() {
if (npc->DropsGlobalLoot()) { if (npc->DropsGlobalLoot()) {
npc->CheckGlobalLootTables(); npc->CheckGlobalLootTables();
} }
npc->SetSp2(spawngroup_id_); npc->SetSpawnGroupId(spawngroup_id_);
npc->SaveGuardPointAnim(anim); npc->SaveGuardPointAnim(anim);
npc->SetAppearance((EmuAppearance) anim); npc->SetAppearance((EmuAppearance) anim);
entity_list.AddNPC(npc); entity_list.AddNPC(npc);
@ -274,9 +274,7 @@ bool Spawn2::Process() {
/** /**
* Roambox init * Roambox init
*/ */
if (spawn_group->roamdist && spawn_group->roambox[0] && spawn_group->roambox[1] && spawn_group->roambox[2] && if (spawn_group->roamdist > 0) {
spawn_group->roambox[3] && spawn_group->delay && spawn_group->min_delay) {
npc->AI_SetRoambox( npc->AI_SetRoambox(
spawn_group->roamdist, spawn_group->roamdist,
spawn_group->roambox[0], spawn_group->roambox[0],
@ -298,7 +296,8 @@ bool Spawn2::Process() {
npcid, npcid,
x, x,
y, y,
z); z
);
LoadGrid(); LoadGrid();
} }

View File

@ -16,8 +16,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <fmt/format.h>
#include "../common/global_define.h" #include "../common/global_define.h"
#include "../common/string_util.h"
#include "../common/types.h" #include "../common/types.h"
#include "entity.h" #include "entity.h"
@ -26,209 +26,352 @@
#include "zonedb.h" #include "zonedb.h"
extern EntityList entity_list; extern EntityList entity_list;
extern Zone* zone; extern Zone *zone;
SpawnEntry::SpawnEntry( uint32 in_NPCType, int in_chance, uint8 in_npc_spawn_limit ) { SpawnEntry::SpawnEntry(uint32 in_NPCType, int in_chance, uint8 in_npc_spawn_limit)
NPCType = in_NPCType; {
chance = in_chance; NPCType = in_NPCType;
chance = in_chance;
npc_spawn_limit = in_npc_spawn_limit; npc_spawn_limit = in_npc_spawn_limit;
} }
SpawnGroup::SpawnGroup( uint32 in_id, char* name, int in_group_spawn_limit, float dist, float maxx, float minx, float maxy, float miny, int delay_in, int despawn_in, uint32 despawn_timer_in, int min_delay_in ) { SpawnGroup::SpawnGroup(
uint32 in_id,
char *name,
int in_group_spawn_limit,
float dist,
float maxx,
float minx,
float maxy,
float miny,
int delay_in,
int despawn_in,
uint32 despawn_timer_in,
int min_delay_in
)
{
id = in_id; id = in_id;
strn0cpy( name_, name, 120); strn0cpy(name_, name, 120);
group_spawn_limit = in_group_spawn_limit; group_spawn_limit = in_group_spawn_limit;
roambox[0]=maxx; roambox[0] = maxx;
roambox[1]=minx; roambox[1] = minx;
roambox[2]=maxy; roambox[2] = maxy;
roambox[3]=miny; roambox[3] = miny;
roamdist=dist; roamdist = dist;
min_delay=min_delay_in; min_delay = min_delay_in;
delay=delay_in; delay = delay_in;
despawn=despawn_in; despawn = despawn_in;
despawn_timer=despawn_timer_in; despawn_timer = despawn_timer_in;
} }
uint32 SpawnGroup::GetNPCType() { uint32 SpawnGroup::GetNPCType()
{
#if EQDEBUG >= 10 #if EQDEBUG >= 10
Log(Logs::General, Logs::None, "SpawnGroup[%08x]::GetNPCType()", (uint32) this); Log(Logs::General, Logs::None, "SpawnGroup[%08x]::GetNPCType()", (uint32) this);
#endif #endif
int npcType = 0; int npcType = 0;
int totalchance = 0; int totalchance = 0;
if(!entity_list.LimitCheckGroup(id, group_spawn_limit)) if (!entity_list.LimitCheckGroup(id, group_spawn_limit)) {
return(0); return (0);
}
std::list<SpawnEntry*>::iterator cur,end; std::list<SpawnEntry *>::iterator cur, end;
std::list<SpawnEntry*> possible; std::list<SpawnEntry *> possible;
cur = list_.begin(); cur = list_.begin();
end = list_.end(); end = list_.end();
for(; cur != end; ++cur) { for (; cur != end; ++cur) {
SpawnEntry *se = *cur; SpawnEntry *se = *cur;
if(!entity_list.LimitCheckType(se->NPCType, se->npc_spawn_limit)) if (!entity_list.LimitCheckType(se->NPCType, se->npc_spawn_limit)) {
continue; continue;
}
totalchance += se->chance; totalchance += se->chance;
possible.push_back(se); possible.push_back(se);
} }
if(totalchance == 0) if (totalchance == 0) {
return 0; return 0;
}
int32 roll = 0; int32 roll = 0;
roll = zone->random.Int(0, totalchance-1); roll = zone->random.Int(0, totalchance - 1);
cur = possible.begin(); cur = possible.begin();
end = possible.end(); end = possible.end();
for(; cur != end; ++cur) { for (; cur != end; ++cur) {
SpawnEntry *se = *cur; SpawnEntry *se = *cur;
if (roll < se->chance) { if (roll < se->chance) {
npcType = se->NPCType; npcType = se->NPCType;
break; break;
} else { }
else {
roll -= se->chance; roll -= se->chance;
} }
} }
return npcType; return npcType;
} }
void SpawnGroup::AddSpawnEntry( SpawnEntry* newEntry ) { void SpawnGroup::AddSpawnEntry(SpawnEntry *newEntry)
list_.push_back( newEntry ); {
list_.push_back(newEntry);
} }
SpawnGroup::~SpawnGroup() { SpawnGroup::~SpawnGroup()
std::list<SpawnEntry*>::iterator cur,end; {
std::list<SpawnEntry *>::iterator cur, end;
cur = list_.begin(); cur = list_.begin();
end = list_.end(); end = list_.end();
for(; cur != end; ++cur) { for (; cur != end; ++cur) {
SpawnEntry* tmp = *cur; SpawnEntry *tmp = *cur;
safe_delete(tmp); safe_delete(tmp);
} }
list_.clear(); list_.clear();
} }
SpawnGroupList::~SpawnGroupList() { SpawnGroupList::~SpawnGroupList()
std::map<uint32, SpawnGroup*>::iterator cur,end; {
cur = groups.begin(); std::map<uint32, SpawnGroup *>::iterator cur, end;
end = groups.end(); cur = m_spawn_groups.begin();
for(; cur != end; ++cur) { end = m_spawn_groups.end();
SpawnGroup* tmp = cur->second; for (; cur != end; ++cur) {
SpawnGroup *tmp = cur->second;
safe_delete(tmp); safe_delete(tmp);
} }
groups.clear(); m_spawn_groups.clear();
} }
void SpawnGroupList::AddSpawnGroup(SpawnGroup* newGroup) { void SpawnGroupList::AddSpawnGroup(SpawnGroup *new_group)
if(newGroup == nullptr) {
if (new_group == nullptr) {
return; return;
groups[newGroup->id] = newGroup; }
m_spawn_groups[new_group->id] = new_group;
} }
SpawnGroup* SpawnGroupList::GetSpawnGroup(uint32 in_id) { SpawnGroup *SpawnGroupList::GetSpawnGroup(uint32 in_id)
if(groups.count(in_id) != 1) {
if (m_spawn_groups.count(in_id) != 1) {
return nullptr; return nullptr;
return(groups[in_id]); }
return (m_spawn_groups[in_id]);
} }
bool SpawnGroupList::RemoveSpawnGroup(uint32 in_id) { bool SpawnGroupList::RemoveSpawnGroup(uint32 in_id)
if(groups.count(in_id) != 1) {
return(false); if (m_spawn_groups.count(in_id) != 1) {
return (false);
}
groups.erase(in_id); m_spawn_groups.erase(in_id);
return(true);
return (true);
}
void SpawnGroupList::ReloadSpawnGroups()
{
ClearSpawnGroups();
database.LoadSpawnGroups(zone->GetShortName(), zone->GetInstanceVersion(), &zone->spawn_group_list);
}
void SpawnGroupList::ClearSpawnGroups()
{
m_spawn_groups.clear();
} }
bool ZoneDatabase::LoadSpawnGroups(const char *zone_name, uint16 version, SpawnGroupList *spawn_group_list) bool ZoneDatabase::LoadSpawnGroups(const char *zone_name, uint16 version, SpawnGroupList *spawn_group_list)
{ {
std::string query = StringFormat("SELECT DISTINCT(spawngroupID), spawngroup.name, spawngroup.spawn_limit, " std::string query = fmt::format(
"spawngroup.dist, spawngroup.max_x, spawngroup.min_x, " SQL(
"spawngroup.max_y, spawngroup.min_y, spawngroup.delay, " SELECT
"spawngroup.despawn, spawngroup.despawn_timer, spawngroup.mindelay " DISTINCT(spawngroupID),
"FROM spawn2, spawngroup WHERE spawn2.spawngroupID = spawngroup.ID " spawngroup.name,
"AND spawn2.version = %u and zone = '%s'", spawngroup.spawn_limit,
version, zone_name); spawngroup.dist,
spawngroup.max_x,
spawngroup.min_x,
spawngroup.max_y,
spawngroup.min_y,
spawngroup.delay,
spawngroup.despawn,
spawngroup.despawn_timer,
spawngroup.mindelay
FROM
spawn2,
spawngroup
WHERE
spawn2.spawngroupID = spawngroup.ID
AND
spawn2.version = {} and zone = '{}'
),
version,
zone_name
);
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) { if (!results.Success()) {
return false; return false;
} }
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
auto newSpawnGroup = new SpawnGroup(atoi(row[0]), row[1], atoi(row[2]), atof(row[3]), atof(row[4]), auto new_spawn_group = new SpawnGroup(
atof(row[5]), atof(row[6]), atof(row[7]), atoi(row[8]), atoi(row[0]),
atoi(row[9]), atoi(row[10]), atoi(row[11])); row[1],
spawn_group_list->AddSpawnGroup(newSpawnGroup); atoi(row[2]),
atof(row[3]),
atof(row[4]),
atof(row[5]),
atof(row[6]),
atof(row[7]),
atoi(row[8]),
atoi(row[9]),
atoi(row[10]),
atoi(row[11])
);
spawn_group_list->AddSpawnGroup(new_spawn_group);
} }
query = StringFormat("SELECT DISTINCT spawnentry.spawngroupID, npcid, chance, " query = fmt::format(
"npc_types.spawn_limit AS sl " SQL(
"FROM spawnentry, spawn2, npc_types " SELECT
"WHERE spawnentry.npcID=npc_types.id " DISTINCT
"AND spawnentry.spawngroupID = spawn2.spawngroupID " spawnentry.spawngroupID,
"AND zone = '%s'", npcid,
zone_name); chance,
npc_types.spawn_limit
AS sl
FROM
spawnentry,
spawn2,
npc_types
WHERE
spawnentry.npcID = npc_types.id
AND
spawnentry.spawngroupID = spawn2.spawngroupID
AND
zone = '{}'),
zone_name
);
results = QueryDatabase(query); results = QueryDatabase(query);
if (!results.Success()) { if (!results.Success()) {
Log(Logs::General, Logs::Error, "Error2 in PopulateZoneLists query '%'", query.c_str());
return false; return false;
} }
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
auto newSpawnEntry = new SpawnEntry(atoi(row[1]), atoi(row[2]), row[3] ? atoi(row[3]) : 0); auto new_spawn_entry = new SpawnEntry(
SpawnGroup *sg = spawn_group_list->GetSpawnGroup(atoi(row[0])); atoi(row[1]),
atoi(row[2]),
(row[3] ? atoi(row[3]) : 0)
);
if (!sg) { SpawnGroup *spawn_group = spawn_group_list->GetSpawnGroup(atoi(row[0]));
safe_delete(newSpawnEntry);
if (!spawn_group) {
safe_delete(new_spawn_entry);
continue; continue;
} }
sg->AddSpawnEntry(newSpawnEntry); spawn_group->AddSpawnEntry(new_spawn_entry);
} }
return true; return true;
} }
bool ZoneDatabase::LoadSpawnGroupsByID(int spawngroupid, SpawnGroupList *spawn_group_list) /**
* @param spawn_group_id
* @param spawn_group_list
* @return
*/
bool ZoneDatabase::LoadSpawnGroupsByID(int spawn_group_id, SpawnGroupList *spawn_group_list)
{ {
std::string query = StringFormat("SELECT DISTINCT(spawngroup.id), spawngroup.name, spawngroup.spawn_limit, " std::string query = fmt::format(
"spawngroup.dist, spawngroup.max_x, spawngroup.min_x, " SQL(
"spawngroup.max_y, spawngroup.min_y, spawngroup.delay, " SELECT DISTINCT
"spawngroup.despawn, spawngroup.despawn_timer, spawngroup.mindelay " (spawngroup.id),
"FROM spawngroup WHERE spawngroup.ID = '%i'", spawngroup.name,
spawngroupid); spawngroup.spawn_limit,
spawngroup.dist,
spawngroup.max_x,
spawngroup.min_x,
spawngroup.max_y,
spawngroup.min_y,
spawngroup.delay,
spawngroup.despawn,
spawngroup.despawn_timer,
spawngroup.mindelay
FROM
spawngroup
WHERE
spawngroup.ID = '{}'
),
spawn_group_id
);
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) { if (!results.Success()) {
Log(Logs::General, Logs::Error, "Error2 in PopulateZoneLists query %s", query.c_str());
return false; return false;
} }
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
auto newSpawnGroup = new SpawnGroup(atoi(row[0]), row[1], atoi(row[2]), atof(row[3]), atof(row[4]), auto new_spawn_group = new SpawnGroup(
atof(row[5]), atof(row[6]), atof(row[7]), atoi(row[8]), atoi(row[0]),
atoi(row[9]), atoi(row[10]), atoi(row[11])); row[1],
spawn_group_list->AddSpawnGroup(newSpawnGroup); atoi(row[2]),
atof(row[3]),
atof(row[4]),
atof(row[5]),
atof(row[6]),
atof(row[7]),
atoi(row[8]),
atoi(row[9]),
atoi(row[10]),
atoi(row[11])
);
spawn_group_list->AddSpawnGroup(new_spawn_group);
} }
query = StringFormat("SELECT DISTINCT(spawnentry.spawngroupID), spawnentry.npcid, " query = fmt::format(
"spawnentry.chance, spawngroup.spawn_limit FROM spawnentry, spawngroup " SQL(
"WHERE spawnentry.spawngroupID = '%i' AND spawngroup.spawn_limit = '0' " SELECT DISTINCT
"ORDER BY chance", (spawnentry.spawngroupID),
spawngroupid); spawnentry.npcid,
spawnentry.chance,
spawngroup.spawn_limit
FROM
spawnentry,
spawngroup
WHERE
spawnentry.spawngroupID = '{}'
AND spawngroup.spawn_limit = '0'
ORDER BY chance),
spawn_group_id
);
results = QueryDatabase(query); results = QueryDatabase(query);
if (!results.Success()) { if (!results.Success()) {
Log(Logs::General, Logs::Error, "Error3 in PopulateZoneLists query '%s'", query.c_str());
return false; return false;
} }
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
auto newSpawnEntry = new SpawnEntry(atoi(row[1]), atoi(row[2]), row[3] ? atoi(row[3]) : 0); auto new_spawn_entry = new SpawnEntry(
SpawnGroup *sg = spawn_group_list->GetSpawnGroup(atoi(row[0])); atoi(row[1]),
if (!sg) { atoi(row[2]),
safe_delete(newSpawnEntry); (row[3] ? atoi(row[3]) : 0)
);
SpawnGroup *spawn_group = spawn_group_list->GetSpawnGroup(atoi(row[0]));
if (!spawn_group) {
safe_delete(new_spawn_entry);
continue; continue;
} }
sg->AddSpawnEntry(newSpawnEntry); spawn_group->AddSpawnEntry(new_spawn_entry);
} }
return true; return true;

View File

@ -23,50 +23,63 @@
#include <map> #include <map>
#include <list> #include <list>
class SpawnEntry class SpawnEntry {
{
public: public:
SpawnEntry(uint32 in_NPCType, int in_chance, uint8 in_npc_spawn_limit ); SpawnEntry(uint32 in_NPCType, int in_chance, uint8 in_npc_spawn_limit);
~SpawnEntry() { } ~SpawnEntry() {}
uint32 NPCType; uint32 NPCType;
int chance; int chance;
//this is a cached value from npc_types, for speed //this is a cached value from npc_types, for speed
uint8 npc_spawn_limit; //max # of this entry which can be spawned in this zone uint8 npc_spawn_limit; //max # of this entry which can be spawned in this zone
}; };
class SpawnGroup class SpawnGroup {
{
public: public:
SpawnGroup(uint32 in_id, char* name, int in_group_spawn_limit, float dist, float maxx, float minx, float maxy, float miny, int delay_in, int despawn_in, uint32 despawn_timer_in, int min_delay_in ); SpawnGroup(
uint32 in_id,
char *name,
int in_group_spawn_limit,
float dist,
float maxx,
float minx,
float maxy,
float miny,
int delay_in,
int despawn_in,
uint32 despawn_timer_in,
int min_delay_in
);
~SpawnGroup(); ~SpawnGroup();
uint32 GetNPCType(); uint32 GetNPCType();
void AddSpawnEntry( SpawnEntry* newEntry ); void AddSpawnEntry(SpawnEntry *newEntry);
uint32 id; uint32 id;
float roamdist; float roamdist;
float roambox[4]; float roambox[4];
int min_delay; int min_delay;
int delay; int delay;
int despawn; int despawn;
uint32 despawn_timer; uint32 despawn_timer;
private: private:
char name_[120]; char name_[120];
std::list<SpawnEntry*> list_; std::list<SpawnEntry *> list_;
uint8 group_spawn_limit; //max # of this entry which can be spawned by this group uint8 group_spawn_limit; //max # of this entry which can be spawned by this group
}; };
class SpawnGroupList class SpawnGroupList {
{
public: public:
SpawnGroupList() { } SpawnGroupList() {}
~SpawnGroupList(); ~SpawnGroupList();
void AddSpawnGroup(SpawnGroup* newGroup); void AddSpawnGroup(SpawnGroup *new_group);
SpawnGroup* GetSpawnGroup(uint32 id); SpawnGroup *GetSpawnGroup(uint32 id);
bool RemoveSpawnGroup(uint32 in_id); bool RemoveSpawnGroup(uint32 in_id);
void ClearSpawnGroups();
void ReloadSpawnGroups();
private: private:
//LinkedList<SpawnGroup*> list_; //LinkedList<SpawnGroup*> list_;
std::map<uint32, SpawnGroup*> groups; std::map<uint32, SpawnGroup *> m_spawn_groups;
}; };
#endif #endif

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); MessageString(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); MessageString(Chat::Red, BACKSTAB_WEAPON);
return; return;
} }
} }
@ -551,7 +551,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
if (bIsBehind || bCanFrontalBS || (IsNPC() && CanFacestab())) { // Player is behind other OR can do Frontal Backstab if (bIsBehind || bCanFrontalBS || (IsNPC() && CanFacestab())) { // Player is behind other OR can do Frontal Backstab
if (bCanFrontalBS && IsClient()) // I don't think there is any message ... if (bCanFrontalBS && IsClient()) // I don't think there is any message ...
CastToClient()->Message(0,"Your fierce attack is executed with such grace, your target did not see it coming!"); CastToClient()->Message(Chat::White,"Your fierce attack is executed with such grace, your target did not see it coming!");
RogueBackstab(other,false,ReuseTime); RogueBackstab(other,false,ReuseTime);
if (level > 54) { if (level > 54) {
@ -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. MessageString(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. MessageString(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. MessageString(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. MessageString(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()->MessageString(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); MessageString(Chat::SpellFailure, FAILED_TAUNT);
return; return;
} }
@ -1953,12 +1953,12 @@ 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->SayString(SUCCESSFUL_TAUNT, GetCleanName());
} else { } else {
Message_StringID(MT_SpellFailure, FAILED_TAUNT); MessageString(Chat::SpellFailure, FAILED_TAUNT);
} }
} else { } else {
Message_StringID(MT_SpellFailure, FAILED_TAUNT); MessageString(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); MessageString(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,8 +2033,9 @@ 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.MessageCloseString(
GetName()); this, false, 200, Chat::MeleeCrit, FATAL_BOW_SHOT,
GetName());
return HeadShot_Dmg; return HeadShot_Dmg;
} }
} }
@ -2078,8 +2079,9 @@ int Mob::TryAssassinate(Mob *defender, EQEmu::skills::SkillType skillInUse)
if (Assassinate_Dmg && Assassinate_Level && (defender->GetLevel() <= Assassinate_Level)) { if (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.MessageCloseString(
GetName()); this, false, 200, Chat::MeleeCrit, ASSASSINATES,
GetName());
return Assassinate_Dmg; return Assassinate_Dmg;
} }
} }

View File

@ -387,7 +387,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
TryTriggerOnValueAmount(false, true); TryTriggerOnValueAmount(false, true);
#ifdef SPELL_EFFECT_SPAM #ifdef SPELL_EFFECT_SPAM
if (caster) if (caster)
caster->Message(0, "You have gained %+i mana!", effect_value); caster->Message(Chat::White, "You have gained %+i mana!", effect_value);
#endif #endif
} }
} }
@ -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()->MessageString(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->MessageString(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); MessageString(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);
} }
@ -745,19 +745,19 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
WipeHateList(); WipeHateList();
if (IsClient() && caster->IsClient()) { if (IsClient() && caster->IsClient()) {
caster->Message(0, "Unable to cast charm on a fellow player."); caster->Message(Chat::White, "Unable to cast charm on a fellow player.");
BuffFadeByEffect(SE_Charm); BuffFadeByEffect(SE_Charm);
break; break;
} else if(IsCorpse()) { } else if(IsCorpse()) {
caster->Message(0, "Unable to cast charm on a corpse."); caster->Message(Chat::White, "Unable to cast charm on a corpse.");
BuffFadeByEffect(SE_Charm); BuffFadeByEffect(SE_Charm);
break; break;
} else if(caster->GetPet() != nullptr && caster->IsClient()) { } else if(caster->GetPet() != nullptr && caster->IsClient()) {
caster->Message(0, "You cannot charm something when you already have a pet."); caster->Message(Chat::White, "You cannot charm something when you already have a pet.");
BuffFadeByEffect(SE_Charm); BuffFadeByEffect(SE_Charm);
break; break;
} else if(GetOwner()) { } else if(GetOwner()) {
caster->Message(0, "You cannot charm someone else's pet!"); caster->Message(Chat::White, "You cannot charm someone else's pet!");
BuffFadeByEffect(SE_Charm); BuffFadeByEffect(SE_Charm);
break; break;
} }
@ -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); MessageString(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); MessageString(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); MessageString(Chat::SpellFailure, CANNOT_BIND);
break; break;
} }
if(!zone->IsCity()) if(!zone->IsCity())
{ {
if(caster != this) if(caster != this)
{ {
Message_StringID(MT_SpellFailure, CANNOT_BIND); MessageString(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->MessageString(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->MessageString(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->MessageString(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->MessageString(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); MessageString(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->MessageString(Chat::Shout, IMMUNE_STUN);
} }
else else
{ {
@ -1627,7 +1627,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
if (zone->random.Int(0, 99) > spells[spell_id].base[i]) { if (zone->random.Int(0, 99) > spells[spell_id].base[i]) {
CastToClient()->SetFeigned(false); CastToClient()->SetFeigned(false);
entity_list.MessageClose_StringID(this, false, 200, 10, STRING_FEIGNFAILED, GetName()); entity_list.MessageCloseString(this, false, 200, 10, STRING_FEIGNFAILED, GetName());
} else { } else {
CastToClient()->SetFeigned(true); CastToClient()->SetFeigned(true);
} }
@ -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, MessageString(Chat::Spells,
SENTINEL_TRIG_YOU); SENTINEL_TRIG_YOU);
} }
else else
{ {
caster->Message_StringID(MT_Spells, caster->MessageString(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()); MessageString(Chat::LightBlue, SUMMONING_CORPSE, TargetClient->CastToMob()->GetCleanName());
else else
Message_StringID(4, SUMMONING_CORPSE_OTHER, TargetClient->CastToMob()->GetCleanName()); MessageString(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); MessageString(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->MessageString(Chat::SpellFailure,
SPELL_LEVEL_REQ, level); SPELL_LEVEL_REQ, level);
} }
} }
else { else {
Message_StringID(4, TARGET_NOT_FOUND); MessageString(Chat::LightBlue, TARGET_NOT_FOUND);
Log(Logs::General, Logs::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id); 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,13 @@ 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); // only for beneficial spells like Call of the Hero
// This clear probably isn't actually needed, but need to investigate more
if (IsBeneficialSpell(spell_id))
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 +2728,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); MessageString(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 +3575,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 +3646,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); MessageString(Chat::Spells, INVIS_BEGIN_BREAK);
} }
break; break;
} }
@ -4047,7 +4050,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->MessageString(Chat::SpellWornOff, SPELL_WORN_OFF_OF,
spells[buffs[slot].spellid].name, GetCleanName()); spells[buffs[slot].spellid].name, GetCleanName());
} }
} }
@ -5406,7 +5409,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id)
default: default:
break; break;
} }
Message_StringID(MT_Spells, string_id, UsedItem->Name); MessageString(Chat::Spells, string_id, UsedItem->Name);
} }
} }
@ -5814,9 +5817,15 @@ 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.MessageCloseString(
this,
false,
200,
Chat::MeleeCrit,
DIVINE_INTERVENTION,
GetCleanName());
else else
entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, DEATH_PACT, GetCleanName()); entity_list.MessageCloseString(this, false, 200, Chat::MeleeCrit, DEATH_PACT, GetCleanName());
SendHPUpdate(); SendHPUpdate();
BuffFadeBySlot(buffSlot); BuffFadeBySlot(buffSlot);
@ -5847,9 +5856,15 @@ 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.MessageCloseString(
this,
false,
200,
Chat::MeleeCrit,
DIVINE_INTERVENTION,
GetCleanName());
else else
entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, DEATH_PACT, GetCleanName()); entity_list.MessageCloseString(this, false, 200, Chat::MeleeCrit, DEATH_PACT, GetCleanName());
SendHPUpdate(); SendHPUpdate();
BuffFadeBySlot(buffSlot); BuffFadeBySlot(buffSlot);
@ -6802,11 +6817,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); MessageString(Chat::SpellFailure,FD_CAST_ON_NO_BREAK);
return; return;
} }
SetFeigned(false); SetFeigned(false);
Message_StringID(MT_SpellFailure,FD_CAST_ON); MessageString(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); MessageString(Chat::Red, SILENCED_STRING);
if(IsAmnesiad() && IsDiscipline(spell_id)) if(IsAmnesiad() && IsDiscipline(spell_id))
Message_StringID(13, MELEE_SILENCE); MessageString(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); MessageString(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); MessageString(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); MessageString(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); MessageString(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); MessageString(Chat::Red, MUST_EQUIP_ITEM);
} }
return(false); return(false);
} }
@ -298,7 +298,8 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
if(IsClient()) { if(IsClient()) {
char temp[64]; char temp[64];
sprintf(temp, "%d", spell_id); sprintf(temp, "%d", spell_id);
parse->EventPlayer(EVENT_CAST_BEGIN, CastToClient(), temp, 0); if (parse->EventPlayer(EVENT_CAST_BEGIN, CastToClient(), temp, 0) != 0)
return false;
} else if(IsNPC()) { } else if(IsNPC()) {
char temp[64]; char temp[64];
sprintf(temp, "%d", spell_id); sprintf(temp, "%d", spell_id);
@ -369,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); MessageString(Chat::SpellFailure, fizzle_msg);
/* Song Failure Messages */ /**
entity_list.FilteredMessageClose_StringID( * Song Failure message
this, /* Sender */ */
true, /* Skip Sender */ entity_list.FilteredMessageCloseString(
RuleI(Range, SpellMessages), this,
MT_SpellFailure, /* Type: 289 */ true,
(IsClient() ? FilterPCSpells : FilterNPCSpells), /* FilterType: 8 or 9 depending on client/npc */ RuleI(Range, SpellMessages),
(fizzle_msg == MISS_NOTE ? MISSED_NOTE_OTHER : SPELL_FIZZLE_OTHER), Chat::SpellFailure,
(IsClient() ? FilterPCSpells : FilterNPCSpells),
(fizzle_msg == MISS_NOTE ? MISSED_NOTE_OTHER : SPELL_FIZZLE_OTHER),
/* /*
MessageFormat: You miss a note, bringing your song to a close! (if missed note) MessageFormat: 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);
@ -425,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); MessageString(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
@ -458,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); MessageString(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
@ -515,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); MessageString(Chat::Spells, BEGINS_TO_GLOW, item->GetItem()->Name);
} }
if (!DoCastingChecks()) { if (!DoCastingChecks()) {
@ -572,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); MessageString(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); MessageString(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;
} }
} }
@ -677,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 MessageString(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);
@ -687,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); MessageString(Chat::Red,NO_INSTRUMENT_SKILL);
} }
else else
CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15); CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15);
@ -697,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); MessageString(Chat::Red,NO_INSTRUMENT_SKILL);
} }
else else
CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15); CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15);
@ -707,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); MessageString(Chat::Red,NO_INSTRUMENT_SKILL);
} }
else else
CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15); CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15);
@ -858,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()->MessageString(Chat::SpellFailure, ABILITY_FAILED);
CastToClient()->ResetAlternateAdvancementTimer(casting_spell_aa_id); CastToClient()->ResetAlternateAdvancementTimer(casting_spell_aa_id);
} }
@ -937,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->MessageString(Chat::SpellFailure, ABILITY_FAILED);
c->ResetAlternateAdvancementTimer(casting_spell_aa_id); c->ResetAlternateAdvancementTimer(casting_spell_aa_id);
} }
@ -966,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); MessageString(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;
@ -980,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); MessageString(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;
@ -1002,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;
} }
@ -1012,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); MessageString(Chat::Red,ALREADY_CASTING);
InterruptSpell(); InterruptSpell();
return; return;
} }
@ -1130,8 +1133,14 @@ 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); MessageString(Chat::Spells, REGAIN_AND_CONTINUE);
entity_list.MessageClose_StringID(this, true, RuleI(Range, SpellMessages), MT_Spells, OTHER_REGAIN_CAST, this->GetCleanName()); entity_list.MessageCloseString(
this,
true,
RuleI(Range, SpellMessages),
Chat::Spells,
OTHER_REGAIN_CAST,
this->GetCleanName());
} }
} }
@ -1167,7 +1176,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->MessageString(Chat::Red, SONG_NEEDS_DRUM); // send an error message if missing
} }
break; break;
@ -1175,7 +1184,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->MessageString(Chat::Red, SONG_NEEDS_WIND);
} }
break; break;
@ -1183,7 +1192,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->MessageString(Chat::Red, SONG_NEEDS_STRINGS);
} }
break; break;
@ -1191,7 +1200,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->MessageString(Chat::Red, SONG_NEEDS_BRASS);
} }
break; break;
@ -1202,7 +1211,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
if(!HasInstrument) { // if the instrument is missing, log it and interrupt the song if(!HasInstrument) { // if the instrument is missing, log it and interrupt the song
Log(Logs::Detail, Logs::Spells, "Song %d: Canceled. Missing required instrument %d", spell_id, component); Log(Logs::Detail, Logs::Spells, "Song %d: Canceled. Missing required instrument %d", spell_id, component);
if(c->GetGM()) if(c->GetGM())
c->Message(0, "Your GM status allows you to finish casting even though you're missing a required instrument."); c->Message(Chat::White, "Your GM status allows you to finish casting even though you're missing a required instrument.");
else { else {
InterruptSpell(); InterruptSpell();
return; return;
@ -1219,13 +1228,13 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
{ {
if (!missingreags) if (!missingreags)
{ {
c->Message_StringID(13, MISSING_SPELL_COMP); c->MessageString(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->MessageString(Chat::Red, MISSING_SPELL_COMP_ITEM, item->Name);
Log(Logs::Detail, Logs::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component); Log(Logs::Detail, Logs::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component);
} }
else { else {
@ -1239,7 +1248,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
if (missingreags) { if (missingreags) {
if(c->GetGM()) if(c->GetGM())
c->Message(0, "Your GM status allows you to finish casting even though you're missing required components."); c->Message(Chat::White, "Your GM status allows you to finish casting even though you're missing required components.");
else { else {
InterruptSpell(); InterruptSpell();
return; return;
@ -1269,7 +1278,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?");
} }
} }
} }
@ -1321,7 +1330,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); MessageString(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;
@ -1352,7 +1361,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;
} }
@ -1499,7 +1508,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); MessageString(Chat::Red,SPELL_NEED_TAR);
return false; return false;
} }
@ -1509,7 +1518,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 MessageString(Chat::Red, SPELL_NO_EFFECT); // Unsure correct string
return false; return false;
} }
} }
@ -1517,9 +1526,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); MessageString(Chat::Red, NO_ABILITY_IN_COMBAT);
else else
Message_StringID(13, NO_CAST_IN_COMBAT); MessageString(Chat::Red, NO_CAST_IN_COMBAT);
return false; return false;
} }
@ -1532,7 +1541,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 MessageString(Chat::Red, SPELL_NO_EFFECT); // Unsure correct string
return false; return false;
} }
} }
@ -1540,9 +1549,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); MessageString(Chat::Red, NO_ABILITY_OUT_OF_COMBAT);
else else
Message_StringID(13, NO_CAST_OUT_OF_COMBAT); MessageString(Chat::Red, NO_CAST_OUT_OF_COMBAT);
return false; return false;
} }
@ -1579,9 +1588,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); MessageString(Chat::Red,SPELL_NEED_TAR);
else else
Message_StringID(13,CANNOT_AFFECT_NPC); MessageString(Chat::Red,CANNOT_AFFECT_NPC);
return false; return false;
} }
CastAction = SingleTarget; CastAction = SingleTarget;
@ -1593,7 +1602,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); MessageString(Chat::Red,SPELL_NEED_TAR);
return false; return false;
} }
CastAction = SingleTarget; CastAction = SingleTarget;
@ -1608,7 +1617,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (summoned pet)", 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); MessageString(Chat::Red, SPELL_NEED_TAR);
return false; return false;
} }
@ -1632,9 +1641,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); MessageString(Chat::Red,SPELL_NEED_TAR);
else else
Message_StringID(13,CANNOT_AFFECT_NPC); MessageString(Chat::Red,CANNOT_AFFECT_NPC);
return false; return false;
} }
CastAction = SingleTarget; CastAction = SingleTarget;
@ -1649,7 +1658,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); MessageString(Chat::Red,SPELL_NEED_TAR);
return false; return false;
} }
else else
@ -1657,14 +1666,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); MessageString(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); MessageString(Chat::Red,SPELL_NEED_TAR);
return false; return false;
} }
} }
@ -1673,7 +1682,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); MessageString(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;
@ -1689,7 +1698,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); MessageString(Chat::Red, message);
return false; return false;
} }
CastAction = SingleTarget; CastAction = SingleTarget;
@ -1701,7 +1710,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); MessageString(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;
@ -1772,7 +1781,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); MessageString(Chat::Red,SPELL_NEED_TAR);
return false; return false;
} }
ae_center = spell_target; ae_center = spell_target;
@ -1797,7 +1806,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
} }
if (spell_target && spell_target->IsPet() && spells[spell_id].targettype == ST_GroupNoPets){ if (spell_target && spell_target->IsPet() && spells[spell_id].targettype == ST_GroupNoPets){
Message_StringID(13,NO_CAST_ON_PET); MessageString(Chat::Red,NO_CAST_ON_PET);
return false; return false;
} }
@ -1809,7 +1818,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); MessageString(Chat::Red,SPELL_NEED_TAR);
return false; return false;
} }
@ -1926,14 +1935,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); MessageString(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); MessageString(Chat::Red, TARGET_GROUP_MEMBER);
return false; return false;
} }
@ -2027,7 +2036,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); MessageString(Chat::Red, CAST_OUTDOORS);
return false; return false;
} }
} }
@ -2036,7 +2045,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;
} }
} }
@ -2047,11 +2056,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;
} }
@ -2109,14 +2118,14 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
if(!spells[spell_id].npc_no_los && spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target) && !IsHarmonySpell(spell_id) && spells[spell_id].targettype != ST_TargetOptional) 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); MessageString(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); MessageString(Chat::Red, TARGET_NO_MANA);
return false; return false;
} }
} }
@ -2140,13 +2149,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); MessageString(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); MessageString(Chat::Red, TARGET_TOO_CLOSE);
return(false); return(false);
} }
@ -2161,13 +2170,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); MessageString(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); MessageString(Chat::Red, TARGET_TOO_CLOSE);
return(false); return(false);
} }
@ -2517,7 +2526,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); MessageString(Chat::Red, CANT_SEE_TARGET);
return(false); return(false);
} }
@ -2532,7 +2541,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); MessageString(Chat::Red, TARGET_OUT_OF_RANGE);
return(false); return(false);
} }
} }
@ -2891,7 +2900,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); MessageString(Chat::SpellFailure, SCREECH_BUFF_BLOCK, sp2.name);
return -1; return -1;
} }
} }
@ -3212,7 +3221,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;
} }
@ -3413,7 +3422,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;
} }
@ -3422,7 +3431,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
if(IsDetrimentalSpell(spell_id) && !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id)) { if(IsDetrimentalSpell(spell_id) && !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id)) {
if(!IsClient() || !CastToClient()->GetGM()) { if(!IsClient() || !CastToClient()->GetGM()) {
Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); MessageString(Chat::SpellFailure, SPELL_NO_HOLD);
return false; return false;
} }
} }
@ -3587,7 +3596,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->MessageString(Chat::SpellFailure, ALREADY_INVIS, GetCleanName());
safe_delete(action_packet); safe_delete(action_packet);
return false; return false;
} }
@ -3597,7 +3606,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->MessageString(Chat::SpellFailure, ALREADY_INVIS, GetCleanName());
safe_delete(action_packet); safe_delete(action_packet);
return false; return false;
} }
@ -3607,7 +3616,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->MessageString(Chat::SpellFailure, ALREADY_INVIS, GetCleanName());
safe_delete(action_packet); safe_delete(action_packet);
return false; return false;
} }
@ -3687,7 +3696,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
Log(Logs::Detail, Logs::Spells, "Beneficial ae bard song %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); 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); MessageString(Chat::SpellFailure, SPELL_NO_HOLD);
} }
safe_delete(action_packet); safe_delete(action_packet);
return false; return false;
@ -3697,7 +3706,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
else if ( !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id)) // Detrimental spells - PVP check 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->MessageString(Chat::SpellFailure, YOU_ARE_PROTECTED, GetCleanName());
safe_delete(action_packet); safe_delete(action_packet);
return false; return false;
} }
@ -3734,7 +3743,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); MessageString(Chat::SpellFailure, SPELL_WOULDNT_HOLD);
safe_delete(action_packet); safe_delete(action_packet);
return false; return false;
} }
@ -3783,18 +3792,18 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
if (reflect_chance) { if (reflect_chance) {
if (RuleB(Spells, ReflectMessagesClose)) { if (RuleB(Spells, ReflectMessagesClose)) {
entity_list.MessageClose_StringID( entity_list.MessageCloseString(
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()); MessageString(Chat::Spells, SPELL_REFLECT, GetCleanName(), spelltar->GetCleanName());
} }
CheckNumHitsRemaining(NumHit::ReflectSpell); CheckNumHitsRemaining(NumHit::ReflectSpell);
@ -3826,12 +3835,12 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
Log(Logs::Detail, Logs::Spells, "Spell %d was completely resisted by %s", spell_id, spelltar->GetName()); 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); MessageString(Chat::SpellFailure, PHYSICAL_RESIST_FAIL,spells[spell_id].name);
spelltar->Message_StringID(MT_SpellFailure, YOU_RESIST, spells[spell_id].name); spelltar->MessageString(Chat::SpellFailure, YOU_RESIST, spells[spell_id].name);
} }
else { else {
Message_StringID(MT_SpellFailure, TARGET_RESISTED, spells[spell_id].name); MessageString(Chat::SpellFailure, TARGET_RESISTED, spells[spell_id].name);
spelltar->Message_StringID(MT_SpellFailure, YOU_RESIST, spells[spell_id].name); spelltar->MessageString(Chat::SpellFailure, YOU_RESIST, spells[spell_id].name);
} }
if (spelltar->IsAIControlled()) { if (spelltar->IsAIControlled()) {
@ -3896,7 +3905,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
{ {
Log(Logs::Detail, Logs::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); 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); MessageString(Chat::SpellFailure, SPELL_TOO_POWERFUL);
safe_delete(action_packet); safe_delete(action_packet);
return false; return false;
} }
@ -3908,7 +3917,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
// spell. It's most likely a buff that can't stack. // 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); MessageString(Chat::SpellFailure, SPELL_NO_HOLD);
safe_delete(action_packet); safe_delete(action_packet);
return false; return false;
} }
@ -3988,14 +3997,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->MessageString(Chat::White, CORPSE_TOO_OLD);
return; return;
} }
*/ */
@ -4223,7 +4232,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->MessageString(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);
@ -4241,7 +4250,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->MessageString(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;
} }
@ -4251,7 +4260,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->MessageString(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);
@ -4267,7 +4276,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->MessageString(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);
@ -4278,13 +4287,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->MessageString(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->MessageString(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);
@ -4295,9 +4304,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->MessageString(Chat::Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up
return true; return true;
} }
} }
@ -4307,7 +4316,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->MessageString(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);
@ -4320,7 +4329,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;
} }
@ -4333,7 +4342,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) 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->MessageString(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;
} }
@ -4348,7 +4357,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->MessageString(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);
@ -4364,7 +4373,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->MessageString(Chat::SpellFailure, CANT_DRAIN_SELF);
return true; return true;
} }
} }
@ -4374,7 +4383,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->MessageString(Chat::SpellFailure, CANNOT_SAC_SELF);
return true; return true;
} }
} }
@ -4992,7 +5001,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->SayString(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->SayString(c, Chat::Yellow, MAX_ACTIVE_TASKS, c->GetName()); // check color, I think this might be only for (Shared) Tasks, w/e -- think should be yellow
} }
return; 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->SayString(c, Chat::Yellow, MAX_ACTIVE_TASKS, c->GetName()); // check color, I think this might be only for (Shared) Tasks, w/e -- think should be yellow
} }
return; return;
@ -1266,18 +1266,18 @@ void TaskManager::ExplainTask(Client*c, int TaskID) {
if(!c) return; if(!c) return;
if((TaskID<=0) || (TaskID>=MAXTASKS)) { if((TaskID<=0) || (TaskID>=MAXTASKS)) {
c->Message(0, "TaskID out-of-range."); c->Message(Chat::White, "TaskID out-of-range.");
return; return;
} }
if(Tasks[TaskID] == nullptr) { if(Tasks[TaskID] == nullptr) {
c->Message(0, "Task does not exist."); c->Message(Chat::White, "Task does not exist.");
return; return;
} }
char Explanation[1000], *ptr; char Explanation[1000], *ptr;
c->Message(0, "Task %4i: Title: %s", TaskID, Tasks[TaskID]->Description.c_str()); c->Message(Chat::White, "Task %4i: Title: %s", TaskID, Tasks[TaskID]->Description.c_str());
c->Message(0, "%3i Activities", Tasks[TaskID]->ActivityCount); c->Message(Chat::White, "%3i Activities", Tasks[TaskID]->ActivityCount);
ptr = Explanation; ptr = Explanation;
for(int i=0; i<Tasks[TaskID]->ActivityCount; i++) { for(int i=0; i<Tasks[TaskID]->ActivityCount; i++) {
@ -1936,7 +1936,7 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation *Task, int T
// Send the updated task/activity list to the client // Send the updated task/activity list to the client
taskmanager->SendSingleActiveTaskToClient(c, *info, TaskComplete, false); taskmanager->SendSingleActiveTaskToClient(c, *info, TaskComplete, false);
// Inform the client the task has been updated, both by a chat message // Inform the client the task has been updated, both by a chat message
c->Message(0, "Your task '%s' has been updated.", Task->Title.c_str()); c->Message(Chat::White, "Your task '%s' has been updated.", Task->Title.c_str());
if(Task->Activity[ActivityID].GoalMethod != METHODQUEST) { if(Task->Activity[ActivityID].GoalMethod != METHODQUEST) {
if (!ignore_quest_update){ if (!ignore_quest_update){
@ -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) {
@ -2306,12 +2306,12 @@ void ClientTaskState::ResetTaskActivity(Client *c, int TaskID, int ActivityID)
void ClientTaskState::ShowClientTasks(Client *c) void ClientTaskState::ShowClientTasks(Client *c)
{ {
c->Message(0, "Task Information:"); c->Message(Chat::White, "Task Information:");
if (ActiveTask.TaskID != TASKSLOTEMPTY) { if (ActiveTask.TaskID != TASKSLOTEMPTY) {
c->Message(0, "Task: %i %s", ActiveTask.TaskID, taskmanager->Tasks[ActiveTask.TaskID]->Title.c_str()); c->Message(Chat::White, "Task: %i %s", ActiveTask.TaskID, taskmanager->Tasks[ActiveTask.TaskID]->Title.c_str());
c->Message(0, " Description: [%s]\n", taskmanager->Tasks[ActiveTask.TaskID]->Description.c_str()); c->Message(Chat::White, " Description: [%s]\n", taskmanager->Tasks[ActiveTask.TaskID]->Description.c_str());
for (int j = 0; j < taskmanager->GetActivityCount(ActiveTask.TaskID); j++) { for (int j = 0; j < taskmanager->GetActivityCount(ActiveTask.TaskID); j++) {
c->Message(0, " Activity: %2d, DoneCount: %2d, Status: %d (0=Hidden, 1=Active, 2=Complete)", c->Message(Chat::White, " Activity: %2d, DoneCount: %2d, Status: %d (0=Hidden, 1=Active, 2=Complete)",
ActiveTask.Activity[j].ActivityID, ActiveTask.Activity[j].DoneCount, ActiveTask.Activity[j].ActivityID, ActiveTask.Activity[j].DoneCount,
ActiveTask.Activity[j].State); ActiveTask.Activity[j].State);
} }
@ -2321,11 +2321,11 @@ void ClientTaskState::ShowClientTasks(Client *c)
if (ActiveQuests[i].TaskID == TASKSLOTEMPTY) if (ActiveQuests[i].TaskID == TASKSLOTEMPTY)
continue; continue;
c->Message(0, "Quest: %i %s", ActiveQuests[i].TaskID, c->Message(Chat::White, "Quest: %i %s", ActiveQuests[i].TaskID,
taskmanager->Tasks[ActiveQuests[i].TaskID]->Title.c_str()); taskmanager->Tasks[ActiveQuests[i].TaskID]->Title.c_str());
c->Message(0, " Description: [%s]\n", taskmanager->Tasks[ActiveQuests[i].TaskID]->Description.c_str()); c->Message(Chat::White, " Description: [%s]\n", taskmanager->Tasks[ActiveQuests[i].TaskID]->Description.c_str());
for (int j = 0; j < taskmanager->GetActivityCount(ActiveQuests[i].TaskID); j++) { for (int j = 0; j < taskmanager->GetActivityCount(ActiveQuests[i].TaskID); j++) {
c->Message(0, " Activity: %2d, DoneCount: %2d, Status: %d (0=Hidden, 1=Active, 2=Complete)", c->Message(Chat::White, " Activity: %2d, DoneCount: %2d, Status: %d (0=Hidden, 1=Active, 2=Complete)",
ActiveQuests[i].Activity[j].ActivityID, ActiveQuests[i].Activity[j].DoneCount, ActiveQuests[i].Activity[j].ActivityID, ActiveQuests[i].Activity[j].DoneCount,
ActiveQuests[i].Activity[j].State); ActiveQuests[i].Activity[j].State);
} }
@ -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;
} }
@ -3309,14 +3309,14 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID, bool enfor
ActiveTaskCount++; ActiveTaskCount++;
taskmanager->SendSingleActiveTaskToClient(c, *active_slot, false, true); taskmanager->SendSingleActiveTaskToClient(c, *active_slot, false, true);
c->Message(0, "You have been assigned the task '%s'.", taskmanager->Tasks[TaskID]->Title.c_str()); c->Message(Chat::White, "You have been assigned the task '%s'.", taskmanager->Tasks[TaskID]->Title.c_str());
std::string buf = std::to_string(TaskID); std::string buf = std::to_string(TaskID);
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->MessageString(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->MessageString(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->MessageString(Chat::LightBlue, TRANSFORM_COMPLETE, inst->GetItem()->Name);
} }
else if (inst) { else if (inst) {
user->Message_StringID(4, DETRANSFORM_FAILED, inst->GetItem()->Name); user->MessageString(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->MessageString(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->MessageString(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->MessageString(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->MessageString(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->MessageString(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); MessageString(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()); MessageString(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); MessageString(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]); MessageString(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;
} }
@ -112,7 +112,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) {
// (it just didn't handle partial stack move actions) // (it just didn't handle partial stack move actions)
if (stack_size > 0) { if (stack_size > 0) {
if (!inst->IsStackable() || !inst2 || !inst2->GetItem() || (inst->GetID() != inst2->GetID()) || (stack_size > inst->GetCharges())) { if (!inst->IsStackable() || !inst2 || !inst2->GetItem() || (inst->GetID() != inst2->GetID()) || (stack_size > inst->GetCharges())) {
client->Kick(); client->Kick("Error stacking item in trade");
return; return;
} }
@ -138,7 +138,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) {
} }
else { else {
if (inst2 && inst2->GetID()) { if (inst2 && inst2->GetID()) {
client->Kick(); client->Kick("Attempting to add null item to trade");
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); MessageString(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);
} }
@ -249,9 +249,9 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh
if (Msg){ if (Msg){
GM->Message(0, "######### Melee Mitigation Report: Start [Detail Level %i]#########", Msg); GM->Message(Chat::White, "######### Melee Mitigation Report: Start [Detail Level %i]#########", Msg);
GM->Message(0, "#ATTACKER: %s", attacker->GetCleanName()); GM->Message(Chat::White, "#ATTACKER: %s", attacker->GetCleanName());
GM->Message(0, "#DEFENDER: %s", defender->GetCleanName()); GM->Message(Chat::White, "#DEFENDER: %s", defender->GetCleanName());
} }
if (RuleB(Combat, UseIntervalAC)) { if (RuleB(Combat, UseIntervalAC)) {
@ -264,16 +264,16 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh
float weight = 0.0; float weight = 0.0;
if (Msg >= 2){ if (Msg >= 2){
GM->Message(0, " "); GM->Message(Chat::White, " ");
GM->Message(0, "### Calculate Mitigation Rating ###"); GM->Message(Chat::White, "### Calculate Mitigation Rating ###");
if (aabonuses.CombatStability) if (aabonuses.CombatStability)
GM->Message(0, "# %i #### DEFENDER SE_CombatStability(259) AA Bonus", aabonuses.CombatStability); GM->Message(Chat::White, "# %i #### DEFENDER SE_CombatStability(259) AA Bonus", aabonuses.CombatStability);
if (spellbonuses.CombatStability) if (spellbonuses.CombatStability)
GM->Message(0, "# %i #### DEFENDER SE_CombatStability(259) Spell Bonus", spellbonuses.CombatStability); GM->Message(Chat::White, "# %i #### DEFENDER SE_CombatStability(259) Spell Bonus", spellbonuses.CombatStability);
if (itembonuses.CombatStability) if (itembonuses.CombatStability)
GM->Message(0, "# %i #### DEFENDER SE_CombatStability(259) Worn Bonus", itembonuses.CombatStability); GM->Message(Chat::White, "# %i #### DEFENDER SE_CombatStability(259) Worn Bonus", itembonuses.CombatStability);
GM->Message(0, "# %.2f #### DEFENDER Base Soft Cap", softcap); GM->Message(Chat::White, "# %.2f #### DEFENDER Base Soft Cap", softcap);
} }
float monkweight = RuleI(Combat, MonkACBonusWeight); float monkweight = RuleI(Combat, MonkACBonusWeight);
@ -287,11 +287,11 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh
armor = ac_override; armor = ac_override;
if (Msg >=2 ){ if (Msg >=2 ){
GM->Message(0, "# %i #### DEFENDER AC Equiped/Worn Bonus", itembonuses.AC); GM->Message(Chat::White, "# %i #### DEFENDER AC Equiped/Worn Bonus", itembonuses.AC);
GM->Message(0, "# %i #### DEFENDER SE_ArmorClass(1) AA Bonus", aabonuses.AC); GM->Message(Chat::White, "# %i #### DEFENDER SE_ArmorClass(1) AA Bonus", aabonuses.AC);
GM->Message(0, "# %i #### DEFENDER SE_ArmorClass(1) Spell Bonus", spellbonuses.AC); GM->Message(Chat::White, "# %i #### DEFENDER SE_ArmorClass(1) Spell Bonus", spellbonuses.AC);
GM->Message(0, "# %i #### DEFENDER Shield AC", shield_ac); GM->Message(Chat::White, "# %i #### DEFENDER Shield AC", shield_ac);
GM->Message(0, "# %i #### DEFENDER Total Client Armor - NO shield", armor); GM->Message(Chat::White, "# %i #### DEFENDER Total Client Armor - NO shield", armor);
} }
} else if (IsNPC()) { } else if (IsNPC()) {
@ -301,9 +301,9 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh
armor = ac_override; armor = ac_override;
if (Msg >=2 ){ if (Msg >=2 ){
GM->Message(0, "# %i #### DEFENDER AC Equiped/Worn Bonus", itembonuses.AC); GM->Message(Chat::White, "# %i #### DEFENDER AC Equiped/Worn Bonus", itembonuses.AC);
GM->Message(0, "# %i #### DEFENDER SE_ArmorClass(1) Spell Bonus", spellbonuses.AC); GM->Message(Chat::White, "# %i #### DEFENDER SE_ArmorClass(1) Spell Bonus", spellbonuses.AC);
GM->Message(0, "# %i #### DEFENDER NPC AC Stat", CastToNPC()->GetRawAC()); GM->Message(Chat::White, "# %i #### DEFENDER NPC AC Stat", CastToNPC()->GetRawAC());
} }
int PetACBonus = 0; int PetACBonus = 0;
@ -311,7 +311,7 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh
if (!IsPet()){ if (!IsPet()){
armor = (armor / RuleR(Combat, NPCACFactor)); armor = (armor / RuleR(Combat, NPCACFactor));
if (Msg >=2 ) if (Msg >=2 )
GM->Message(0, "# %i #### DEFENDER NPC Armor after RuleR(Combat, NPCACFactor) %.2f", armor, RuleR(Combat, NPCACFactor)); GM->Message(Chat::White, "# %i #### DEFENDER NPC Armor after RuleR(Combat, NPCACFactor) %.2f", armor, RuleR(Combat, NPCACFactor));
} }
Mob *owner = nullptr; Mob *owner = nullptr;
@ -325,18 +325,18 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh
if (Msg >=2 ){ if (Msg >=2 ){
if (owner->aabonuses.PetMeleeMitigation) if (owner->aabonuses.PetMeleeMitigation)
GM->Message(0, "# %i #### DEFENDER Pet Owner SE_PetMeleeMitigation(379) AA Bonus", owner->aabonuses.PetMeleeMitigation); GM->Message(Chat::White, "# %i #### DEFENDER Pet Owner SE_PetMeleeMitigation(379) AA Bonus", owner->aabonuses.PetMeleeMitigation);
if (owner->spellbonuses.PetMeleeMitigation) if (owner->spellbonuses.PetMeleeMitigation)
GM->Message(0, "# %i #### DEFENDER Pet Owner SE_PetMeleeMitigation(379) Spell Bonus",owner->spellbonuses.PetMeleeMitigation); GM->Message(Chat::White, "# %i #### DEFENDER Pet Owner SE_PetMeleeMitigation(379) Spell Bonus",owner->spellbonuses.PetMeleeMitigation);
if (owner->itembonuses.PetMeleeMitigation) if (owner->itembonuses.PetMeleeMitigation)
GM->Message(0, "# %i #### DEFENDER Pet Owner SE_PetMeleeMitigation(379) Worn Bonus", owner->itembonuses.PetMeleeMitigation); GM->Message(Chat::White, "# %i #### DEFENDER Pet Owner SE_PetMeleeMitigation(379) Worn Bonus", owner->itembonuses.PetMeleeMitigation);
} }
} }
armor += spellbonuses.AC + itembonuses.AC + PetACBonus + 1; armor += spellbonuses.AC + itembonuses.AC + PetACBonus + 1;
if (Msg >= 2) if (Msg >= 2)
GM->Message(0, "# %i #### DEFENDER NPC Total Base Armor",armor); GM->Message(Chat::White, "# %i #### DEFENDER NPC Total Base Armor",armor);
} }
if (opts) { if (opts) {
@ -405,38 +405,38 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh
armor = softcap + softcap_armor; armor = softcap + softcap_armor;
if (Msg >= 2) if (Msg >= 2)
GM->Message(0, "# %i #### DEFENDER Final Armor [Soft Cap %i Soft Cap Armor %i]",armor, softcap,softcap_armor); GM->Message(Chat::White, "# %i #### DEFENDER Final Armor [Soft Cap %i Soft Cap Armor %i]",armor, softcap,softcap_armor);
} }
int tmp_armor = armor; int tmp_armor = armor;
if (GetClass() == WIZARD || GetClass() == MAGICIAN || if (GetClass() == WIZARD || GetClass() == MAGICIAN ||
GetClass() == NECROMANCER || GetClass() == ENCHANTER){ GetClass() == NECROMANCER || GetClass() == ENCHANTER){
mitigation_rating = ((GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) / 4.0) + armor + 1; mitigation_rating = ((GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) / 4.0) + armor + 1;
if (Msg >= 2) if (Msg >= 2)
GM->Message(0, "# + %.2f #### DEFENDER Armor Bonus [Defense Skill %i Heroic Agi %i]", mitigation_rating - tmp_armor, GetSkill(EQEmu::skills::SkillDefense), itembonuses.HeroicAGI); GM->Message(Chat::White, "# + %.2f #### DEFENDER Armor Bonus [Defense Skill %i Heroic Agi %i]", mitigation_rating - tmp_armor, GetSkill(EQEmu::skills::SkillDefense), itembonuses.HeroicAGI);
} }
else{ else{
mitigation_rating = ((GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) / 3.0) + (armor * 1.333333) + 1; mitigation_rating = ((GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) / 3.0) + (armor * 1.333333) + 1;
if (Msg >= 2) if (Msg >= 2)
GM->Message(0, "# + %.2f #### DEFENDER Armor Bonus [Defense Skill %i Heroic Agi %i]", mitigation_rating - tmp_armor, GetSkill(EQEmu::skills::SkillDefense), itembonuses.HeroicAGI); GM->Message(Chat::White, "# + %.2f #### DEFENDER Armor Bonus [Defense Skill %i Heroic Agi %i]", mitigation_rating - tmp_armor, GetSkill(EQEmu::skills::SkillDefense), itembonuses.HeroicAGI);
} }
mitigation_rating *= 0.847; mitigation_rating *= 0.847;
if (Msg >= 1) if (Msg >= 1)
GM->Message(0, "# %.2f #### DEFENDER Final Mitigation Rating", mitigation_rating); GM->Message(Chat::White, "# %.2f #### DEFENDER Final Mitigation Rating", mitigation_rating);
if (Msg >= 2){ if (Msg >= 2){
GM->Message(0, " "); GM->Message(Chat::White, " ");
GM->Message(0, "### Mitigation Bonus Effects ###"); GM->Message(Chat::White, "### Mitigation Bonus Effects ###");
if (itembonuses.MeleeMitigation) if (itembonuses.MeleeMitigation)
GM->Message(0, "# %i #### DEFENDER Item Mod2 Shielding", itembonuses.MeleeMitigation); GM->Message(Chat::White, "# %i #### DEFENDER Item Mod2 Shielding", itembonuses.MeleeMitigation);
if (aabonuses.MeleeMitigationEffect) if (aabonuses.MeleeMitigationEffect)
GM->Message(0, "# %i #### DEFENDER SE_MeleeMitigation(168) AA Bonus", aabonuses.MeleeMitigationEffect); GM->Message(Chat::White, "# %i #### DEFENDER SE_MeleeMitigation(168) AA Bonus", aabonuses.MeleeMitigationEffect);
if (spellbonuses.MeleeMitigationEffect) if (spellbonuses.MeleeMitigationEffect)
GM->Message(0, "# %i #### DEFENDER SE_MeleeMitigation(168) Spell Bonus", spellbonuses.MeleeMitigationEffect); GM->Message(Chat::White, "# %i #### DEFENDER SE_MeleeMitigation(168) Spell Bonus", spellbonuses.MeleeMitigationEffect);
if (itembonuses.MeleeMitigationEffect) if (itembonuses.MeleeMitigationEffect)
GM->Message(0, "# %i #### DEFENDER SE_MeleeMitigation(168) Worn Bonus", itembonuses.MeleeMitigationEffect); GM->Message(Chat::White, "# %i #### DEFENDER SE_MeleeMitigation(168) Worn Bonus", itembonuses.MeleeMitigationEffect);
} }
mitigation_rating = mod_mitigation_rating(mitigation_rating, attacker); mitigation_rating = mod_mitigation_rating(mitigation_rating, attacker);
@ -458,31 +458,31 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh
attack_rating = attacker->mod_attack_rating(attack_rating, this); attack_rating = attacker->mod_attack_rating(attack_rating, this);
if (Msg >= 2){ if (Msg >= 2){
GM->Message(0, " "); GM->Message(Chat::White, " ");
GM->Message(0, "### Calculate Attack Rating ###"); GM->Message(Chat::White, "### Calculate Attack Rating ###");
if (attacker->IsClient()){ if (attacker->IsClient()){
GM->Message(0, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK); GM->Message(Chat::White, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK);
GM->Message(0, "# %i #### ATTACKER SE_ATK(2) AA Bonus", attacker->aabonuses.ATK); GM->Message(Chat::White, "# %i #### ATTACKER SE_ATK(2) AA Bonus", attacker->aabonuses.ATK);
GM->Message(0, "# %i #### ATTACKER SE_ATK(2) spell Bonus", attacker->spellbonuses.ATK); GM->Message(Chat::White, "# %i #### ATTACKER SE_ATK(2) spell Bonus", attacker->spellbonuses.ATK);
GM->Message(0, "# %i #### ATTACKER Leadership Bonus", attacker->CastToClient()->GroupLeadershipAAOffenseEnhancement()); GM->Message(Chat::White, "# %i #### ATTACKER Leadership Bonus", attacker->CastToClient()->GroupLeadershipAAOffenseEnhancement());
GM->Message(0, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK); GM->Message(Chat::White, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK);
GM->Message(0, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK); GM->Message(Chat::White, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK);
GM->Message(0, "# %.2f #### ATTACKER Strength Stat ATK Bonus [Stat Amt: %i]", ((attacker->GetSTR()-66) * 0.9),attacker->GetSTR()); GM->Message(Chat::White, "# %.2f #### ATTACKER Strength Stat ATK Bonus [Stat Amt: %i]", ((attacker->GetSTR()-66) * 0.9),attacker->GetSTR());
GM->Message(0, "# %.2f #### ATTACKER Offensive Skill ATK Bonus [Stat Amt: %i]", (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345), attacker->GetSkill(EQEmu::skills::SkillOffense)); GM->Message(Chat::White, "# %.2f #### ATTACKER Offensive Skill ATK Bonus [Stat Amt: %i]", (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345), attacker->GetSkill(EQEmu::skills::SkillOffense));
} }
else{ else{
GM->Message(0, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK); GM->Message(Chat::White, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK);
GM->Message(0, "# %i #### ATTACKER SE_ATK(2) spell Bonus", attacker->spellbonuses.ATK); GM->Message(Chat::White, "# %i #### ATTACKER SE_ATK(2) spell Bonus", attacker->spellbonuses.ATK);
GM->Message(0, "# %i #### ATTACKER NPC ATK Stat", attacker->CastToNPC()->ATK); GM->Message(Chat::White, "# %i #### ATTACKER NPC ATK Stat", attacker->CastToNPC()->ATK);
GM->Message(0, "# %.2f #### ATTACKER Strength Stat ATK Bonus [Stat Amt: %i]", ((attacker->GetSTR()-66) * 0.9),attacker->GetSTR()); GM->Message(Chat::White, "# %.2f #### ATTACKER Strength Stat ATK Bonus [Stat Amt: %i]", ((attacker->GetSTR()-66) * 0.9),attacker->GetSTR());
GM->Message(0, "# %.2f #### ATTACKER Offensive Skill ATK Bonus [Stat Amt: %i]", (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345), attacker->GetSkill(EQEmu::skills::SkillOffense)); GM->Message(Chat::White, "# %.2f #### ATTACKER Offensive Skill ATK Bonus [Stat Amt: %i]", (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345), attacker->GetSkill(EQEmu::skills::SkillOffense));
} }
} }
if (Msg >= 1){ if (Msg >= 1){
GM->Message(0, "# %.2f #### ATTACKER Final Attack Rating", attack_rating); GM->Message(Chat::White, "# %.2f #### ATTACKER Final Attack Rating", attack_rating);
GM->Message(0, "######### Melee Mitigation Report: Complete #########", Msg); GM->Message(Chat::White, "######### Melee Mitigation Report: Complete #########", Msg);
} }
@ -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

@ -57,7 +57,16 @@ void NPC::AI_SetRoambox(float max_distance, float roam_distance_variance, uint32
); );
} }
void NPC::AI_SetRoambox(float distance, float max_x, float min_x, float max_y, float min_y, uint32 delay, uint32 min_delay) { void NPC::AI_SetRoambox(
float distance,
float max_x,
float min_x,
float max_y,
float min_y,
uint32 delay,
uint32 min_delay
)
{
roambox_distance = distance; roambox_distance = distance;
roambox_max_x = max_x; roambox_max_x = max_x;
roambox_min_x = min_x; roambox_min_x = min_x;
@ -70,18 +79,18 @@ void NPC::AI_SetRoambox(float distance, float max_x, float min_x, float max_y, f
void NPC::DisplayWaypointInfo(Client *c) { void NPC::DisplayWaypointInfo(Client *c) {
c->Message(0, "Mob is on grid %d, in spawn group %d, on waypoint %d/%d", c->Message(Chat::White, "Mob is on grid %d, in spawn group %d, on waypoint %d/%d",
GetGrid(), GetGrid(),
GetSp2(), GetSpawnGroupId(),
GetCurWp(), GetCurWp(),
GetMaxWp()); GetMaxWp());
std::vector<wplist>::iterator cur, end; std::vector<wplist>::iterator cur, end;
cur = Waypoints.begin(); cur = Waypoints.begin();
end = Waypoints.end(); end = Waypoints.end();
for (; cur != end; ++cur) { for (; cur != end; ++cur) {
c->Message(0, "Waypoint %d: (%.2f,%.2f,%.2f,%.2f) pause %d", c->Message(Chat::White, "Waypoint %d: (%.2f,%.2f,%.2f,%.2f) pause %d",
cur->index, cur->index,
cur->x, cur->x,
cur->y, cur->y,
@ -895,7 +904,7 @@ void ZoneDatabase::AssignGrid(Client *client, int grid, int spawn2id) {
return; return;
} }
client->Message(0, "Grid assign: spawn2 id = %d updated", spawn2id); client->Message(Chat::White, "Grid assign: spawn2 id = %d updated", spawn2id);
} }

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->MessageString(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->MessageString(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);
@ -536,6 +536,13 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
SetZoneData(zone->GetZoneID(), zone->GetInstanceID()); SetZoneData(zone->GetZoneID(), zone->GetInstanceID());
if (szic->zoneid == zone->GetZoneID()) { if (szic->zoneid == zone->GetZoneID()) {
auto client = entity_list.GetClientByLSID(szic->lsid);
if (client) {
client->Kick("Dropped by world CLE subsystem");
client->Save();
}
zone->RemoveAuth(szic->lsid);
zone->AddAuth(szic); zone->AddAuth(szic);
// This packet also doubles as "incoming client" notification, lets not shut down before they get here // This packet also doubles as "incoming client" notification, lets not shut down before they get here
zone->StartShutdownTimer(AUTHENTICATION_TIMEOUT * 1000); zone->StartShutdownTimer(AUTHENTICATION_TIMEOUT * 1000);
@ -559,7 +566,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
auto client = entity_list.GetClientByLSID(drop->lsid); auto client = entity_list.GetClientByLSID(drop->lsid);
if (client) { if (client) {
client->Kick(); client->Kick("Dropped by world CLE subsystem");
client->Save(); client->Save();
} }
} }
@ -571,7 +578,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
printf("Zoning %s to %s(%u) - %u\n", client != nullptr ? client->GetCleanName() : "Unknown", szp->zone, database.GetZoneID(szp->zone), szp->instance_id); printf("Zoning %s to %s(%u) - %u\n", client != nullptr ? client->GetCleanName() : "Unknown", szp->zone, database.GetZoneID(szp->zone), szp->instance_id);
if (client != 0) { if (client != 0) {
if (strcasecmp(szp->adminname, szp->name) == 0) if (strcasecmp(szp->adminname, szp->name) == 0)
client->Message(0, "Zoning to: %s", szp->zone); client->Message(Chat::White, "Zoning to: %s", szp->zone);
else if (client->GetAnon() == 1 && client->Admin() > szp->adminrank) else if (client->GetAnon() == 1 && client->Admin() > szp->adminrank)
break; break;
else { else {
@ -776,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->MessageString(Chat::SpellWornOff, REZZ_ALREADY_PENDING);
break; break;
} }
@ -903,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;
} }
@ -1478,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->MessageString(Chat::White, s->message_string_id);
} }
break; break;
} }
@ -1722,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->MessageString(Chat::Red, 5141);
} }
break; break;
} }
@ -1744,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

@ -55,6 +55,7 @@
#include "zone_config.h" #include "zone_config.h"
#include "mob_movement_manager.h" #include "mob_movement_manager.h"
#include "npc_scale_manager.h" #include "npc_scale_manager.h"
#include "../common/data_verification.h"
#include <time.h> #include <time.h>
#include <ctime> #include <ctime>
@ -864,6 +865,8 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name)
m_last_ucss_update = 0; m_last_ucss_update = 0;
mMovementManager = &MobMovementManager::Get(); mMovementManager = &MobMovementManager::Get();
SetNpcPositionUpdateDistance(0);
} }
Zone::~Zone() { Zone::~Zone() {
@ -1194,9 +1197,9 @@ uint32 Zone::CountAuth() {
bool Zone::Process() { bool Zone::Process() {
spawn_conditions.Process(); spawn_conditions.Process();
if(spawn2_timer.Check()) { if (spawn2_timer.Check()) {
LinkedListIterator<Spawn2*> iterator(spawn2_list); LinkedListIterator<Spawn2 *> iterator(spawn2_list);
EQEmu::InventoryProfile::CleanDirty(); EQEmu::InventoryProfile::CleanDirty();
@ -1212,10 +1215,15 @@ bool Zone::Process() {
} }
} }
if(adv_data && !did_adventure_actions) if (adv_data && !did_adventure_actions) {
DoAdventureActions(); DoAdventureActions();
}
if (GetNpcPositionUpdateDistance() == 0) {
CalculateNpcUpdateDistanceSpread();
}
} }
if(initgrids_timer.Check()) { if(initgrids_timer.Check()) {
//delayed grid loading stuff. //delayed grid loading stuff.
initgrids_timer.Disable(); initgrids_timer.Disable();
@ -1477,6 +1485,8 @@ bool Zone::Depop(bool StartSpawnTimer) {
// clear spell cache // clear spell cache
database.ClearNPCSpells(); database.ClearNPCSpells();
zone->spawn_group_list.ReloadSpawnGroups();
return true; return true;
} }
@ -1762,14 +1772,14 @@ void Zone::SpawnStatus(Mob* client) {
while(iterator.MoreElements()) while(iterator.MoreElements())
{ {
if (iterator.GetData()->timer.GetRemainingTime() == 0xFFFFFFFF) if (iterator.GetData()->timer.GetRemainingTime() == 0xFFFFFFFF)
client->Message(0, " %d: %1.1f, %1.1f, %1.1f: disabled", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ()); client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: disabled", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ());
else else
client->Message(0, " %d: %1.1f, %1.1f, %1.1f: %1.2f", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ(), (float)iterator.GetData()->timer.GetRemainingTime() / 1000); client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: %1.2f", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ(), (float)iterator.GetData()->timer.GetRemainingTime() / 1000);
x++; x++;
iterator.Advance(); iterator.Advance();
} }
client->Message(0, "%i spawns listed.", x); client->Message(Chat::White, "%i spawns listed.", x);
} }
void Zone::ShowEnabledSpawnStatus(Mob* client) void Zone::ShowEnabledSpawnStatus(Mob* client)
@ -1784,7 +1794,7 @@ void Zone::ShowEnabledSpawnStatus(Mob* client)
{ {
if (iterator.GetData()->timer.GetRemainingTime() != 0xFFFFFFFF) if (iterator.GetData()->timer.GetRemainingTime() != 0xFFFFFFFF)
{ {
client->Message(0, " %d: %1.1f, %1.1f, %1.1f: %1.2f", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ(), (float)iterator.GetData()->timer.GetRemainingTime() / 1000); client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: %1.2f", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ(), (float)iterator.GetData()->timer.GetRemainingTime() / 1000);
iEnabledCount++; iEnabledCount++;
} }
@ -1792,7 +1802,7 @@ void Zone::ShowEnabledSpawnStatus(Mob* client)
iterator.Advance(); iterator.Advance();
} }
client->Message(0, "%i of %i spawns listed.", iEnabledCount, x); client->Message(Chat::White, "%i of %i spawns listed.", iEnabledCount, x);
} }
void Zone::ShowDisabledSpawnStatus(Mob* client) void Zone::ShowDisabledSpawnStatus(Mob* client)
@ -1807,7 +1817,7 @@ void Zone::ShowDisabledSpawnStatus(Mob* client)
{ {
if (iterator.GetData()->timer.GetRemainingTime() == 0xFFFFFFFF) if (iterator.GetData()->timer.GetRemainingTime() == 0xFFFFFFFF)
{ {
client->Message(0, " %d: %1.1f, %1.1f, %1.1f: disabled", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ()); client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: disabled", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ());
iDisabledCount++; iDisabledCount++;
} }
@ -1815,7 +1825,7 @@ void Zone::ShowDisabledSpawnStatus(Mob* client)
iterator.Advance(); iterator.Advance();
} }
client->Message(0, "%i of %i spawns listed.", iDisabledCount, x); client->Message(Chat::White, "%i of %i spawns listed.", iDisabledCount, x);
} }
void Zone::ShowSpawnStatusByID(Mob* client, uint32 spawnid) void Zone::ShowSpawnStatusByID(Mob* client, uint32 spawnid)
@ -1831,9 +1841,9 @@ void Zone::ShowSpawnStatusByID(Mob* client, uint32 spawnid)
if (iterator.GetData()->GetID() == spawnid) if (iterator.GetData()->GetID() == spawnid)
{ {
if (iterator.GetData()->timer.GetRemainingTime() == 0xFFFFFFFF) if (iterator.GetData()->timer.GetRemainingTime() == 0xFFFFFFFF)
client->Message(0, " %d: %1.1f, %1.1f, %1.1f: disabled", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ()); client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: disabled", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ());
else else
client->Message(0, " %d: %1.1f, %1.1f, %1.1f: %1.2f", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ(), (float)iterator.GetData()->timer.GetRemainingTime() / 1000); client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: %1.2f", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ(), (float)iterator.GetData()->timer.GetRemainingTime() / 1000);
iSpawnIDCount++; iSpawnIDCount++;
@ -1845,9 +1855,9 @@ void Zone::ShowSpawnStatusByID(Mob* client, uint32 spawnid)
} }
if(iSpawnIDCount > 0) if(iSpawnIDCount > 0)
client->Message(0, "%i of %i spawns listed.", iSpawnIDCount, x); client->Message(Chat::White, "%i of %i spawns listed.", iSpawnIDCount, x);
else else
client->Message(0, "No matching spawn id was found in this zone."); client->Message(Chat::White, "No matching spawn id was found in this zone.");
} }
bool ZoneDatabase::GetDecayTimes(npcDecayTimes_Struct *npcCorpseDecayTimes) bool ZoneDatabase::GetDecayTimes(npcDecayTimes_Struct *npcCorpseDecayTimes)
@ -2365,3 +2375,59 @@ void Zone::SetUCSServerAvailable(bool ucss_available, uint32 update_timestamp) {
if (m_last_ucss_update < update_timestamp) if (m_last_ucss_update < update_timestamp)
m_ucss_available = ucss_available; m_ucss_available = ucss_available;
} }
int Zone::GetNpcPositionUpdateDistance() const
{
return npc_position_update_distance;
}
void Zone::SetNpcPositionUpdateDistance(int in_npc_position_update_distance)
{
Zone::npc_position_update_distance = in_npc_position_update_distance;
}
void Zone::CalculateNpcUpdateDistanceSpread()
{
float max_x = 0;
float max_y = 0;
float min_x = 0;
float min_y = 0;
auto &mob_list = entity_list.GetMobList();
for (auto &it : mob_list) {
Mob *entity = it.second;
if (!entity->IsNPC()) {
continue;
}
if (entity->GetX() <= min_x) {
min_x = entity->GetX();
}
if (entity->GetY() <= min_y) {
min_y = entity->GetY();
}
if (entity->GetX() >= max_x) {
max_x = entity->GetX();
}
if (entity->GetY() >= max_y) {
max_y = entity->GetY();
}
}
int x_spread = int(abs(max_x - min_x));
int y_spread = int(abs(max_y - min_y));
int combined_spread = int(abs((x_spread + y_spread) / 2));
int update_distance = EQEmu::ClampLower(int(combined_spread / 4), int(zone->GetMaxMovementUpdateRange()));
SetNpcPositionUpdateDistance(update_distance);
Log(Logs::General, Logs::Debug,
"NPC update spread distance set to [%i] combined_spread [%i]",
update_distance,
combined_spread
);
}

View File

@ -126,6 +126,9 @@ public:
bool Process(); bool Process();
bool SaveZoneCFG(); bool SaveZoneCFG();
int GetNpcPositionUpdateDistance() const;
void SetNpcPositionUpdateDistance(int in_npc_position_update_distance);
char *adv_data; char *adv_data;
const char *GetSpellBlockedMessage(uint32 spell_id, const glm::vec3 &location); const char *GetSpellBlockedMessage(uint32 spell_id, const glm::vec3 &location);
@ -219,6 +222,7 @@ public:
void ChangeWeather(); void ChangeWeather();
void ClearBlockedSpells(); void ClearBlockedSpells();
void ClearNPCTypeCache(int id); void ClearNPCTypeCache(int id);
void CalculateNpcUpdateDistanceSpread();
void DelAggroMob() { aggroedmobs--; } void DelAggroMob() { aggroedmobs--; }
void DeleteQGlobal(std::string name, uint32 npcID, uint32 charID, uint32 zoneID); void DeleteQGlobal(std::string name, uint32 npcID, uint32 charID, uint32 zoneID);
void Despawn(uint32 spawngroupID); void Despawn(uint32 spawngroupID);
@ -290,7 +294,7 @@ public:
*/ */
find_replace(message, std::string("%"), std::string(".")); find_replace(message, std::string("%"), std::string("."));
if (message.find("\n") != std::string::npos) { if (message.find('\n') != std::string::npos) {
auto message_split = SplitString(message, '\n'); auto message_split = SplitString(message, '\n');
entity_list.MessageStatus( entity_list.MessageStatus(
0, 0,
@ -345,6 +349,7 @@ private:
glm::vec4 m_Graveyard; glm::vec4 m_Graveyard;
int default_ruleset; int default_ruleset;
int totalBS; int totalBS;
int npc_position_update_distance;
int32 aggroedmobs; int32 aggroedmobs;
uint8 zone_type; uint8 zone_type;
uint16 instanceversion; uint16 instanceversion;

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;
} }
@ -3544,10 +3544,10 @@ void ZoneDatabase::ListAllInstances(Client* client, uint32 charid)
char name[64]; char name[64];
database.GetCharName(charid, name); database.GetCharName(charid, name);
client->Message(0, "%s is part of the following instances:", name); client->Message(Chat::White, "%s is part of the following instances:", name);
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
client->Message(0, "%s - id: %lu, version: %lu", database.GetZoneName(atoi(row[1])), client->Message(Chat::White, "%s - id: %lu, version: %lu", database.GetZoneName(atoi(row[1])),
(unsigned long)atoi(row[0]), (unsigned long)atoi(row[2])); (unsigned long)atoi(row[0]), (unsigned long)atoi(row[2]));
} }
} }

View File

@ -409,7 +409,7 @@ public:
/* Spawns and Spawn Points */ /* Spawns and Spawn Points */
bool LoadSpawnGroups(const char* zone_name, uint16 version, SpawnGroupList* spawn_group_list); bool LoadSpawnGroups(const char* zone_name, uint16 version, SpawnGroupList* spawn_group_list);
bool LoadSpawnGroupsByID(int spawngroupid, SpawnGroupList* spawn_group_list); bool LoadSpawnGroupsByID(int spawn_group_id, SpawnGroupList* spawn_group_list);
bool PopulateZoneSpawnList(uint32 zoneid, LinkedList<Spawn2*> &spawn2_list, int16 version, uint32 repopdelay = 0); bool PopulateZoneSpawnList(uint32 zoneid, LinkedList<Spawn2*> &spawn2_list, int16 version, uint32 repopdelay = 0);
bool PopulateZoneSpawnListClose(uint32 zoneid, LinkedList<Spawn2*> &spawn2_list, int16 version, const glm::vec4& client_position, uint32 repop_distance); bool PopulateZoneSpawnListClose(uint32 zoneid, LinkedList<Spawn2*> &spawn2_list, int16 version, const glm::vec4& client_position, uint32 repop_distance);
Spawn2* LoadSpawn2(LinkedList<Spawn2*> &spawn2_list, uint32 spawn2id, uint32 timeleft); Spawn2* LoadSpawn2(LinkedList<Spawn2*> &spawn2_list, uint32 spawn2id, uint32 timeleft);

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.MessageCloseString(this, true, RuleI(Range, SpellMessages), Chat::Spells, GATES, GetCleanName());
Mob::Gate(bindnum); Mob::Gate(bindnum);
} }
@ -814,7 +814,7 @@ bool Client::HasZoneFlag(uint32 zone_id) const {
void Client::SendZoneFlagInfo(Client *to) const { void Client::SendZoneFlagInfo(Client *to) const {
if(zone_flags.empty()) { if(zone_flags.empty()) {
to->Message(0, "%s has no zone flags.", GetName()); to->Message(Chat::White, "%s has no zone flags.", GetName());
return; return;
} }
@ -823,7 +823,7 @@ void Client::SendZoneFlagInfo(Client *to) const {
end = zone_flags.end(); end = zone_flags.end();
char empty[1] = { '\0' }; char empty[1] = { '\0' };
to->Message(0, "Flags for %s:", GetName()); to->Message(Chat::White, "Flags for %s:", GetName());
for(; cur != end; ++cur) { for(; cur != end; ++cur) {
uint32 zoneid = *cur; uint32 zoneid = *cur;
@ -843,7 +843,7 @@ void Client::SendZoneFlagInfo(Client *to) const {
strcpy(flag_name, "(ERROR GETTING NAME)"); strcpy(flag_name, "(ERROR GETTING NAME)");
} }
to->Message(0, "Has Flag %s for zone %s (%d,%s)", flag_name, long_name, zoneid, short_name); to->Message(Chat::White, "Has Flag %s for zone %s (%d,%s)", flag_name, long_name, zoneid, short_name);
if(long_name != empty) if(long_name != empty)
delete[] long_name; delete[] long_name;
} }