It seems like most of the codes are compatible with trinitycore except for the Mischandler.cpp part. I hope someone would shed a light on converting this script to trinitycore.
diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp
index 69888fb..3fc66c7 100644
--- a/src/game/ChatHandler.cpp
+++ b/src/game/ChatHandler.cpp
@@ -209,8 +209,17 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
uint32 pSecurity = player ? player->GetSession()->GetSecurity() : SEC_PLAYER;
if (!player || (tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers()))
{
+ // If Fake WHO List system on then show player DND
+ if (sWorld.getConfig(CONFIG_BOOL_FAKE_WHO_LIST))
+ {
+ sWorld.SendWorldText(LANG_NOT_WHISPER);
+ return;
+ }
+ else
+ {
SendPlayerNotFoundNotice(to);
return;
+ }
}
if (!sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_CHAT) && tSecurity == SEC_PLAYER && pSecurity == SEC_PLAYER )
diff --git a/src/game/Language.h b/src/game/Language.h
index 32c6dc3..4b52de2 100644
--- a/src/game/Language.h
+++ b/src/game/Language.h
@@ -896,7 +896,8 @@ enum MangosStrings
// Room for old clients 2.x 1300-1399 not used
// Room for old clients 1.x 1400-1499 not used
- // FREE IDS 1500-9999
+ LANG_NOT_WHISPER = 1501,
+ // FREE IDS 1502-9999
// Use for not-in-offcial-sources patches
// 10000-10999
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp
index e5a7b9a..4e2dda2 100644
--- a/src/game/MiscHandler.cpp
+++ b/src/game/MiscHandler.cpp
@@ -249,6 +249,39 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
break;
}
+ if (sWorld.getConfig(CONFIG_BOOL_FAKE_WHO_LIST) && clientcount < 49)
+ {
+ // Fake players on WHO LIST 0, 1, 2, 3, 4, 5 6
+ QueryResult *result = CharacterDatabase.Query("SELECT guid,name,race,class,level,zone,gender FROM characters WHERE online>1");
+ if (result)
+ {
+ do
+ {
+ Field *fields = result->Fetch();
+
+ std::string pname = fields[1].GetCppString(); // player name
+ std::string gname; // guild name
+ uint32 lvl = fields[4].GetUInt32(); // player level
+ uint32 class_ = fields[3].GetUInt32(); // player class
+ uint32 race = fields[2].GetUInt32(); // player race
+ uint32 pzoneid = fields[5].GetUInt32(); // player zone id
+ uint8 gender = fields[6].GetUInt8(); // player gender
+
+ data << pname; // player name
+ data << gname; // guild name
+ data << uint32(lvl); // player level
+ data << uint32(class_); // player class
+ data << uint32(race); // player race
+ data << uint8(gender); // player gender
+ data << uint32(pzoneid); // player zone id
+
+ if ((++clientcount) == 49)
+ break;
+ } while (result->NextRow());
+ }
+ delete result;
+ }
+
uint32 count = m.size();
data.put( 0, clientcount ); // insert right count, listed count
data.put( 4, count > 50 ? count : clientcount ); // insert right count, online count
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 517e8ce..7e47e0c 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -1404,6 +1404,10 @@ void Player::Update( uint32 p_time )
// m_nextSave reseted in SaveToDB call
SaveToDB();
DETAIL_LOG("Player '%s' (GUID: %u) saved", GetName(), GetGUIDLow());
+ // If Fake WHO List system on then change player position with every SavePlayer Interval (usually 15min)
+ if (sWorld.getConfig(CONFIG_BOOL_FAKE_WHO_LIST))
+ CharacterDatabase.PExecute("UPDATE characters SET zone = (FLOOR(50 * RAND()) + 1) WHERE online>1");
+ CharacterDatabase.PExecute("UPDATE characters SET level=level+1 WHERE online>1 AND level<5");
}
else
m_nextSave -= p_time;
diff --git a/src/game/Weather.cpp b/src/game/Weather.cpp
index 9fc8a1e..fa9c1ea 100644
--- a/src/game/Weather.cpp
+++ b/src/game/Weather.cpp
@@ -49,6 +49,14 @@ bool Weather::Update(time_t diff)
if(m_timer.Passed())
{
m_timer.Reset();
+
+ // If Fake WHO List system on then update level of fake plyer with every weather change interval (we will set it on 90 minutes)
+ if (sWorld.getConfig(CONFIG_BOOL_FAKE_WHO_LIST))
+ {
+ CharacterDatabase.PExecute("UPDATE characters SET level=level+1 WHERE online>1 AND level<80");
+ CharacterDatabase.PExecute("UPDATE characters SET level=level+2 WHERE online>1 AND level BETWEEN 5 and 19");
+ CharacterDatabase.PExecute("UPDATE characters SET level=level+1 WHERE online>1 AND level BETWEEN 20 and 40");
+ }
// update only if Regenerate has changed the weather
if(ReGenerate())
{
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 4fb965c..ebad12b 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -551,6 +551,7 @@ void World::LoadConfigSettings(bool reload)
setConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_MAIL, "AllowTwoSide.Interaction.Mail", false);
setConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_WHO_LIST, "AllowTwoSide.WhoList", false);
setConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_ADD_FRIEND, "AllowTwoSide.AddFriend", false);
+ setConfig(CONFIG_BOOL_FAKE_WHO_LIST, "Fake.WHO.List", false);
setConfig(CONFIG_UINT32_STRICT_PLAYER_NAMES, "StrictPlayerNames", 0);
setConfig(CONFIG_UINT32_STRICT_CHARTER_NAMES, "StrictCharterNames", 0);
diff --git a/src/game/World.h b/src/game/World.h
index 3d10f21..3b2cfaf 100644
--- a/src/game/World.h
+++ b/src/game/World.h
@@ -283,6 +283,7 @@ enum eConfigBoolValues
CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_MAIL,
CONFIG_BOOL_ALLOW_TWO_SIDE_WHO_LIST,
CONFIG_BOOL_ALLOW_TWO_SIDE_ADD_FRIEND,
+ CONFIG_BOOL_FAKE_WHO_LIST,
CONFIG_BOOL_INSTANCE_IGNORE_LEVEL,
CONFIG_BOOL_INSTANCE_IGNORE_RAID,
CONFIG_BOOL_CAST_UNSTUCK,
diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in
index 235b42a..03a4a23 100644
--- a/src/mangosd/mangosd.conf.dist.in
+++ b/src/mangosd/mangosd.conf.dist.in
@@ -192,7 +192,7 @@ GridUnload = 1
SocketSelectTime = 10000
GridCleanUpDelay = 300000
MapUpdateInterval = 100
-ChangeWeatherInterval = 600000
+ChangeWeatherInterval = 5400000# 90 minutes
PlayerSave.Interval = 900000
PlayerSave.Stats.MinLevel = 0
PlayerSave.Stats.SaveOnlyOnLogout = 1
@@ -809,6 +809,13 @@ Motd = "Welcome to the Massive Network Game Object Server."
# Default: 1 (allow)
# 0 (not allow)
#
+# Fake.WHO.List
+# Add fake players to fill in WHO LIST (who is online list, "O" button) if there is less then
+# 49 real players online (need to set online=2 in character database in order to work)
+# Default: 0 (disabled)
+# 1 (enabled)
+#
+#
###################################################################################################################
AllowTwoSide.Accounts = 1
@@ -821,6 +828,7 @@ AllowTwoSide.Interaction.Mail = 0
AllowTwoSide.WhoList = 0
AllowTwoSide.AddFriend = 0
TalentsInspecting = 1
+Fake.Who.List = 0
###################################################################################################################
# CREATURE SETTINGS
INSERT INTO `mangos_string` VALUES ('1501', 'Player wishes to not be disturbed and cannot receive whisper messages.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);