Page 1 of 1

Text Emotes - Fix included

Posted: Wed Jan 14, 2015 5:52 pm
by chaoscode
Hi all,

Took a little work but I got it working. Also, allows for all the other channels to be supported when the server is ready.


Chris - Phyasoft.com

Re: Text Emotes

Posted: Wed Jan 14, 2015 8:03 pm
by chaoscode
Patch incomming.

Re: Text Emotes

Posted: Wed Jan 14, 2015 8:19 pm
by chaoscode
Okay here it is.

In Objects.cs rename the function Say to SendText as shown below

Code: Select all

        public virtual void SendText(string Msg, SystemData.ChatLogFilters Filter)
        {
            if (Msg == null || Msg.Length == 0)
                return;

            foreach (Player Plr in _PlayerRanged.ToArray())
            {
                if (Plr.GmLevel != 0 || GetPlayer().GmLevel != 0 || Program.Config.ChatBetweenRealms || Plr.Realm == GetPlayer().Realm)
                    Plr.SendMessage(this, Msg, Filter);
            }

            if (IsPlayer())
                GetPlayer().SendMessage(this, Msg, Filter);
        }      
Next in CommandMgr.cs add this line under PlayerSay as shown below

Code: Select all

#region Tchat

        static public void PlayerSay(Player Plr, string Text) { if (!Plr.IsDead) Plr.SendText(Text, SystemData.ChatLogFilters.CHATLOGFILTERS_SAY); }
        static public void PlayerEmote(Player Plr, string Text) { if (!Plr.IsDead) Plr.SendText(Text, SystemData.ChatLogFilters.CHATLOGFILTERS_EMOTE); }
        static public void PlayerWisp(Player Plr, string Text)

Next you want to edit CommandMgr.cs again and edit the line with "/emote" in it and change the first null to the name of the function that handles the /emote command as shown below

Code: Select all

  new CommandHandler("/duelcancel", null, null ),
            new CommandHandler("/duelsurrender", null, null ),
            new CommandHandler("/emote", PlayerEmote,null),
            new CommandHandler("::", null, null ),
            new CommandHandler("/emotelist", null, null ),
Finally update All the calls from .Say to .SendText

This also fixes ALL the other chat types, they just need to be addedin the CommandMgr.cs

Re: Text Emotes - Fix included

Posted: Wed Jan 14, 2015 11:38 pm
by Kragg
You mean if I typ /emote nods. it will say:

Manfred nods.

Re: Text Emotes - Fix included

Posted: Thu Jan 15, 2015 12:18 am
by chaoscode
Kragg wrote:You mean if I typ /emote nods. it will say:

Manfred nods.

Correct