Hey people!
I'm coming with a cute add-on for your BcStorm emulator!
It's a add-on for you cms and client.
You have to script the settings page on you own to set the preferred speech bubble style! (Make this page only available for vip users)
First you have to do something in you database.
Add in the table users a field called: speech_bubble_prefer with type = int and length = 5 (for sure)
Go to you emulator source. Go to RoomUser.cs
We're going to replace a hole internal void.
Search for the void:
Replace the hole void with:PHP Code:internal void Chat(GameClient Session, string Message, bool Shout, int TextColor = 0)
And you're done!PHP Code:internal void Chat(GameClient Session, string Message, bool Shout, int TextColor = 0)
{
if (TextColor > 0 && !Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_vip") || TextColor > 22)
{
TextColor = 0;
Session.SendNotif("You must be vip to use this chat bubble styles.");
}
if (((Session == null) || (Session.GetHabbo().Rank >= 5)) || !this.GetRoom().RoomMuted)
{
this.Unidle();
if (!this.IsPet && !this.IsBot)
{
ServerMessage message;
Habbo habbo = this.GetClient().GetHabbo();
if (TextColor == 0)
{
if (!habbo.GetSubscriptionManager().HasSubscription("habbo_vip"))
{
if (habbo.Rank > 5)
{
TextColor = 2;
}
else
{
TextColor = 0;
}
}
else
{
using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
{
adapter.setQuery("SELECT speech_bubble_prefer FROM users WHERE username = '" + habbo.Username + "'");
DataRow row = adapter.getRow();
if ((int)row[0] == 0)
{
if (habbo.Rank > 5)
{
TextColor = 2;
}
else
{
TextColor = 0;
}
}
else
{
TextColor = (int)row["speech_bubble_prefer"];
}
}
}
}
if (habbo.Muted)
{
this.GetClient().SendNotif("Jij bent gemuted.");
return;
}
if ((Message.StartsWith(":") && (Session != null)) && ChatCommandRegister.IsChatCommand(Message.Split(new char[] { ' ' })[0].ToLower().Substring(1)))
{
ChatCommandHandler handler = new ChatCommandHandler(Message.Split(new char[] { ' ' }), Session);
if (handler.WasExecuted())
{
Logging.LogMessage(string.Format("User {0} issued command {1}", this.GetUsername(), Message));
if (Session.GetHabbo().Rank > 5)
{
ButterflyEnvironment.GetGame().GetModerationTool().LogStaffEntry(Session.GetHabbo().Username, string.Empty, "Chat command", string.Format("Issued chat command {0}", Message));
}
return;
}
}
uint rank = 1;
Message = LanguageLocale.FilterSwearwords(Message);
if ((Session != null) && (Session.GetHabbo() != null))
{
rank = Session.GetHabbo().Rank;
}
TimeSpan span = (TimeSpan)(DateTime.Now - habbo.spamFloodTime);
if ((span.TotalSeconds > habbo.spamProtectionTime) && habbo.spamProtectionBol)
{
this.FloodCount = 0;
habbo.spamProtectionBol = false;
habbo.spamProtectionAbuse = 0;
}
else if (span.TotalSeconds > 4.0)
{
this.FloodCount = 0;
}
if ((span.TotalSeconds < habbo.spamProtectionTime) && habbo.spamProtectionBol)
{
message = new ServerMessage(Outgoing.FloodFilter);
int i = habbo.spamProtectionTime - span.Seconds;
message.AppendInt32(i);
this.GetClient().SendMessage(message);
if (ButterflyEnvironment.spamBans)
{
habbo.spamProtectionAbuse++;
GameClient clientByUsername = ButterflyEnvironment.GetGame().GetClientManager().GetClientByUsername(Session.GetHabbo().Username);
if (habbo.spamProtectionAbuse >= ButterflyEnvironment.spamBans_limit)
{
ButterflyEnvironment.GetGame().GetBanManager().BanUser(clientByUsername, "SPAM*ABUSE", 800.0, LanguageLocale.GetValue("flood.banmessage"), false);
}
else
{
clientByUsername.SendNotif(LanguageLocale.GetValue("flood.pleasewait").Replace("%secs%", Convert.ToString(i)));
}
}
return;
}
if (((span.TotalSeconds < 4.0) && (this.FloodCount > 5)) && (rank < 5))
{
message = new ServerMessage(Outgoing.FloodFilter);
habbo.spamProtectionCount++;
if ((habbo.spamProtectionCount % 2) == 0)
{
habbo.spamProtectionTime = 10 * habbo.spamProtectionCount;
}
else
{
habbo.spamProtectionTime = 10 * (habbo.spamProtectionCount - 1);
}
habbo.spamProtectionBol = true;
message.AppendInt32((int)(habbo.spamProtectionTime - span.Seconds));
this.GetClient().SendMessage(message);
return;
}
habbo.spamFloodTime = DateTime.Now;
this.FloodCount++;
if (!this.IsBot)
{
ChatMessage message2 = new ChatMessage(Session.GetHabbo().Id, Session.GetHabbo().Username, this.mRoom.RoomId, this.mRoom.Name, this.mRoom.IsPublic, Message, DateTime.Now);
Session.GetHabbo().GetChatMessageManager().AddMessage(message2);
this.mRoom.GetChatMessageManager().AddMessage(message2);
}
}
InvokedChatMessage message3 = new InvokedChatMessage(this, Message, Shout, TextColor);
this.GetRoom().QueueChatMessage(message3);
}
}
Little list of the added functions in it:
- If you aren't vip you can't use chat bubble styles (for people who are having these by accident)
- If your TextColor is 0, you have no vip and your rank is above the 5, you'll get TextColor 2. If your rank is below the 5 you'll get TextColor 0.
- If your TextColor is 0, you have vip, your chosen TextColor is 0 and your rank is above the 5. You'll get 2. If your rank is below the 5 you'll get TextColor 0.
- If you TextColor is 0, you have vip, your chosen TextColor isn't 0. You'll get your chosen TextColor.
This little thing is very easy to edit.
You'll get more add-on's! Even I will look for some fixes :)


![[BcStorm][Add-On] Preferred speech bubble](http://ragezone.com/hyper728.png)


