public void OnGet()
 {
     if (Type == null)
     {
         Type = new TalkType();
     }
 }
Пример #2
0
    void PlayAnim(TalkType type)
    {
        if (_anim == null)
        {
            _anim = GetComponent <Animator>();
        }
        if (_anim == null)
        {
            return;
        }
        string stateName = "";

        switch (type)
        {
        case TalkType.AskForDrink:
            stateName = "Toss";
            break;

        case TalkType.Positive:
            stateName = "Taken";
            break;

        case TalkType.Negative:
        case TalkType.PissedOff:
            stateName = "Refused";
            break;
        }
        if (string.IsNullOrEmpty(stateName))
        {
            return;
        }
        _anim.Play(stateName, 0);
    }
Пример #3
0
        private void parseSay(NetworkMessage msg)
        {
            TalkType type      = (TalkType)msg.ReadByte();
            string   privateTo = "";
            short    channelId = 0;

            switch (type)
            {
            case TalkType.PrivateChannel:
            case TalkType.PrivateChannelRed:
            case TalkType.RuleViolationAnswer:
                privateTo = msg.ReadString();
                break;

            case TalkType.ChannelYellow:
            case TalkType.ChannelRed:
            case TalkType.ChannelRedAnonymous:
                channelId = msg.ReadShort();
                break;

            default:
                break;
            }

            string message = msg.ReadString();

            if (message.Length > 255)
            {
                return;
            }

            Game.CreatureSpeak(Player, type, message, privateTo, channelId);
        }
Пример #4
0
        public async Task GetLocalTalkListAsync(int pageSize, int position)
        {
            TalkType type = TalkType.All;

            switch (position)
            {
            case 0:
                type = TalkType.All;
                break;

            case 1:
                type = TalkType.RecentComment;
                break;

            case 2:
                type = TalkType.All;
                break;

            case 3:
                type = TalkType.All;
                break;
            }
            var list = await SqliteDatabase.Instance().GetTalkList(pageSize, type);

            talkView.GetLocalTalkSuccess(list);
        }
Пример #5
0
 /// <summary>
 /// Player talks in the channel
 /// </summary>
 /// <param name="player"></param>
 /// <param name="type"></param>
 /// <param name="message"></param>
 public void PlayerTalk(Player player, TalkType type, string message)
 {
     if (hasPlayerJoined(player))
     {
         foreach (Player viewer in viewers)
         {
             viewer.Connection.SendMessageToChannel(player, type, message, (short)Id);
         }
     }
 }
Пример #6
0
 public static bool IsWhisper(this TalkType talkType)
 {
     if (talkType == TalkType.WHISPER)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Пример #7
0
    string FindTalk(TalkType type)
    {
        var candidates = talks[(int)type];

        if (candidates == null || candidates.list.Length == 0)
        {
            return("<color=red>(Blah Blah Blah)</color>");
        }

        return(candidates.list[Random.Range(0, candidates.list.Length)]);
    }
Пример #8
0
    void Say(TalkType type, System.Action onComplete)
    {
        PlayAnim(type);
        var content = FindTalk(type);

        if (bubble == null)
        {
            PrettyLog.Error("{0} has no bubble!", name);
            return;
        }
        bubble.Say(type, content, onComplete);
    }
Пример #9
0
        public void SendCreatureSay(Creature creature, TalkType type, string message)
        {
            if (!LoggedIn)
            {
                return;
            }

            NetworkMessage msg = new NetworkMessage();

            AddCreatureSpeak(msg, creature, type, message);
            Send(msg);
        }
Пример #10
0
        public void SendMessageToChannel(Creature creature, TalkType type, string message, short channelId, int time = 0)
        {
            if (!LoggedIn)
            {
                return;
            }

            NetworkMessage msg = new NetworkMessage();

            AddCreatureSpeak(msg, creature, type, message, channelId, time);
            Send(msg);
        }
Пример #11
0
        public void Say(string t, TalkType typ = TalkType.Async)
        {
            return;

            if (typ == TalkType.Block)
            {
                SS.Speak(t);
            }
            else
            {
                SS.SpeakAsync(t);
            }
        }
Пример #12
0
        /// <summary>
        /// Player speaks to another player in private
        /// </summary>
        /// <param name="player"></param>
        /// <param name="type"></param>
        /// <param name="message"></param>
        /// <param name="receiver"></param>
        public static void PlayerTalkTo(Player player, TalkType type, string message, string receiver)
        {
            Player toPlayer = getPlayer(receiver);

            if (toPlayer == null)
            {
                player.Connection.SendTextMessage((byte)MessageType.StatusSmall, "A player with this name is not online.");
                return;
            }

            toPlayer.Connection.SendCreatureSay(player, type, message);
            player.Connection.SendTextMessage((byte)MessageType.StatusSmall, String.Format("Message sent to {0}.", toPlayer.Name));
        }
Пример #13
0
        public bool Speak(TalkType chatType, string message, string character = null)
        {
            if (!m_client.ConnectedAndInitialized || !Initialized)
            {
                return(false);
            }

            Packet builder;

            switch (chatType)
            {
            case TalkType.Local:
                builder = new Packet(PacketFamily.Talk, PacketAction.Report);
                break;

            case TalkType.PM:
                builder = new Packet(PacketFamily.Talk, PacketAction.Tell);
                if (string.IsNullOrWhiteSpace(character))
                {
                    throw new ArgumentException("Unable to send a PM to invalid character!", "character");
                }
                builder.AddBreakString(character);
                break;

            case TalkType.Global:
                builder = new Packet(PacketFamily.Talk, PacketAction.Message);
                break;

            case TalkType.Guild:
                builder = new Packet(PacketFamily.Talk, PacketAction.Request);
                break;

            case TalkType.Party:
                builder = new Packet(PacketFamily.Talk, PacketAction.Open);
                break;

            case TalkType.Admin:
                builder = new Packet(PacketFamily.Talk, PacketAction.Admin);
                break;

            case TalkType.Announce:
                builder = new Packet(PacketFamily.Talk, PacketAction.Announce);
                break;

            default: throw new NotImplementedException();
            }

            builder.AddString(message);

            return(m_client.SendPacket(builder));
        }
Пример #14
0
        private void AddCreatureSpeak(NetworkMessage msg, Creature creature, TalkType type, string message, short channelId = 0, int time = 0 /* Used for RuleViolations */)
        {
            msg.WriteByte(0xAA);
            // Here should be statement GUID, but Tibia 7.6 didn't had it :P
            if (type != TalkType.ChannelRedAnonymous)
            {
                if (type != TalkType.RuleViolationAnswer)
                {
                    msg.WriteString(creature.Name);
                }
                else
                {
                    // This is handled in Rule Violations channel
                    msg.WriteString("Gamemaster");
                }
            }
            else
            {
                msg.WriteString("");
            }

            msg.WriteByte((byte)type);

            switch (type)
            {
            case TalkType.Say:
            case TalkType.Whisper:
            case TalkType.Yell:
            case TalkType.MonsterSay:
            case TalkType.MonsterYell:
                AddPosition(msg, creature.Position);
                break;

            case TalkType.ChannelYellow:
            case TalkType.ChannelRed:
            case TalkType.ChannelRedAnonymous:
            case TalkType.ChannelOrange:
                msg.WriteShort(channelId);
                break;

            case TalkType.RuleViolationChannel:
                msg.WriteInt(time);
                break;

            default:
                break;
            }

            msg.WriteString(message);
        }
Пример #15
0
        public void Say(String text, TalkType type)
        {
            MainText.Text     = text;
            TalkPanel.Visible = true;
            if (type == TalkType.Pet)
            {
                curState       = GhostState.Pet;
                ghostbox.Image = Properties.Resources.stickPet;
            }
            else
            {
                ghostbox.Image = Properties.Resources.stickTalk;
            }

            if (type == TalkType.Ask)
            {
                curState            = GhostState.Ask;
                OptionPanel.Visible = true;
            }
            else
            {
                OptionPanel.Visible = false;
            }

            if (type == TalkType.Normal)
            {
                curState = GhostState.Speak;
            }
            if (type == TalkType.FormMenu)
            {
                curState = GhostState.Ask;
                if (Form2.ShowDialog(this) == DialogResult.OK)
                {
                    if (Form2.remind.IsTime())
                    {
                        Say("Hey, you put in something that already happened! Try that again.", TalkType.FormMenu);
                    }
                    else
                    {
                        alarms.Add(Form2.remind);
                        Say("Okay, got it.", TalkType.Normal);
                    }
                }
                else
                {
                    Say("Oh, okay then.", TalkType.Normal);
                }
            }
        }
Пример #16
0
        /// <summary>
        /// Private message.
        /// </summary>
        public ShowTextOutgoingPacket(uint statmentId, string sender, ushort level, TalkType talkType, string message)
        {
            this.option = 1;


            this.StatmentId = statmentId;

            this.Sender = sender;

            this.Level = level;

            this.TalkType = talkType;

            this.Message = message;
        }
Пример #17
0
        /// <summary>
        /// sends all different types of Talk packets to server based on which chat type we're doing
        /// </summary>
        /// <param name="chatType">Which type of chat message is being sent</param>
        /// <param name="message">The message being sent</param>
        /// <param name="character">The character (required for TalkType.PM)</param>
        /// <returns></returns>
        public static bool Speak(TalkType chatType, string message, string character = null)
        {
            EOClient client = (EOClient)World.Instance.Client;

            if (!client.ConnectedAndInitialized)
            {
                return(false);
            }

            Packet builder;

            switch (chatType)
            {
            case TalkType.Local:
                builder = new Packet(PacketFamily.Talk, PacketAction.Report);
                break;

            case TalkType.PM:
                builder = new Packet(PacketFamily.Talk, PacketAction.Tell);
                if (string.IsNullOrWhiteSpace(character))
                {
                    return(false);
                }
                builder.AddBreakString(character);
                break;

            case TalkType.Global:
                builder = new Packet(PacketFamily.Talk, PacketAction.Message);
                break;

            case TalkType.Guild:
                builder = new Packet(PacketFamily.Talk, PacketAction.Request);
                break;

            case TalkType.Party:
                builder = new Packet(PacketFamily.Talk, PacketAction.Open);
                break;

            default: throw new NotImplementedException();
            }

            builder.AddString(message);

            return(client.SendPacket(builder));
        }
Пример #18
0
        public void TryTalkWithCD(TalkType talkType, int CD)
        {
            int talkInt = (int)talkType;

            if (TalkCDs[talkInt] > 0 || universalTalkCD > 0)
            {
                return;
            }

            TalkCounters[talkInt] = (TalkCounters[talkInt] + 1) % MaxThingsToSay[talkInt];
            TalkCDs[talkInt]      = CD;
            universalTalkCD       = 0;

            if (Projectile.owner == Main.myPlayer && ModContent.GetInstance <SoulConfig>().DeviChatter)
            {
                if (!Main.player[Projectile.owner].dead && !Main.player[Projectile.owner].ghost)
                {
                    EmoteBubble.MakeLocalPlayerEmote(EmoteID.EmotionLove);
                }
                SoundEngine.PlaySound(SoundID.LucyTheAxeTalk, Projectile.Center);

                string key       = Enum.GetName(talkType);
                int    actualSay = TalkCounters[talkInt] + 1;
                string text      = Language.GetTextValue($"Mods.FargowiltasSouls.DeviChatter.{key}{actualSay}");

                Vector2 pos = Vector2.Lerp(Main.MouseWorld, Projectile.Center, 0.5f);
                pos = Vector2.Lerp(pos, Main.player[Projectile.owner].Center, 0.5f);

                PopupText.NewText(new AdvancedPopupRequest()
                {
                    Text             = text,
                    DurationInFrames = 420,
                    Velocity         = 7 * -Vector2.UnitY,
                    Color            = Color.HotPink * 1.15f
                }, pos);

                //FargoSoulsUtil.HeartDust(
                //    Projectile.Center,
                //    addedVel: 0.5f * new Vector2(7 * Projectile.direction, -7),
                //    spreadModifier: 0.5f,
                //    scaleModifier: 0.5f
                //);
            }
        }
Пример #19
0
        /// <summary>
        /// <seealso cref="Talk"/>を生成します。
        /// </summary>
        /// <param name="startDate"></param>
        /// <param name="nowDate"></param>
        /// <param name="line"></param>
        /// <returns></returns>
        private Talk CreateTalk(DateTime startDate, DateTime nowDate, string line)
        {
            var splits = line.Split(new[] { '\t' }, StringSplitOptions.RemoveEmptyEntries);

            if (splits.Length < 3)
            {
                return(null);
            }

            var dateText = splits[0];
            var userName = splits[1];
            var message  = splits[2];

            CreateUser(startDate, userName);
            DateTime talkTime = GetTalkTime(nowDate, dateText);
            TalkType talkType = TalkType.Message;

            if (message == "[写真]")
            {
                talkType = TalkType.Picture;
                message  = string.Empty;
            }

            if (message == "[スタンプ]")
            {
                talkType = TalkType.Stamp;
                message  = string.Empty;
            }

            var talk = new Talk
            {
                Message  = message,
                Time     = talkTime,
                User     = Users[userName],
                TalkType = talkType
            };

            return(talk);
        }
Пример #20
0
		public bool Speak(TalkType chatType, string message, string character = null)
		{
			if (!m_client.ConnectedAndInitialized || !Initialized)
				return false;

			Packet builder;
			switch (chatType)
			{
				case TalkType.Local:
					builder = new Packet(PacketFamily.Talk, PacketAction.Report);
					break;
				case TalkType.PM:
					builder = new Packet(PacketFamily.Talk, PacketAction.Tell);
					if (string.IsNullOrWhiteSpace(character))
						throw new ArgumentException("Unable to send a PM to invalid character!", "character");
					builder.AddBreakString(character);
					break;
				case TalkType.Global:
					builder = new Packet(PacketFamily.Talk, PacketAction.Message);
					break;
				case TalkType.Guild:
					builder = new Packet(PacketFamily.Talk, PacketAction.Request);
					break;
				case TalkType.Party:
					builder = new Packet(PacketFamily.Talk, PacketAction.Open);
					break;
				case TalkType.Admin:
					builder = new Packet(PacketFamily.Talk, PacketAction.Admin);
					break;
				case TalkType.Announce:
					builder = new Packet(PacketFamily.Talk, PacketAction.Announce);
					break;
				default: throw new NotImplementedException();
			}

			builder.AddString(message);

			return m_client.SendPacket(builder);
		}
Пример #21
0
        private void _chatByPlayerName(TalkType type, string name, string msg)
        {
            switch (type)
            {
            //invalid types
            case TalkType.Local:
            case TalkType.Party:
                break;

            case TalkType.PM:
                m_game.Hud.AddChat(ChatTabs.Local, name, msg, ChatType.Note, ChatColor.PM);
                ChatTabs tab = m_game.Hud.GetPrivateChatTab(name);
                m_game.Hud.AddChat(tab, name, msg, ChatType.Note);
                break;

            case TalkType.Global: m_game.Hud.AddChat(ChatTabs.Global, name, msg, ChatType.GlobalAnnounce); break;

            case TalkType.Guild: m_game.Hud.AddChat(ChatTabs.Group, name, msg); break;

            case TalkType.Server:
                m_game.Hud.AddChat(ChatTabs.Local, World.GetString(DATCONST2.STRING_SERVER), msg, ChatType.Exclamation, ChatColor.Server);
                m_game.Hud.AddChat(ChatTabs.Global, World.GetString(DATCONST2.STRING_SERVER), msg, ChatType.Exclamation, ChatColor.ServerGlobal);
                m_game.Hud.AddChat(ChatTabs.System, "", msg, ChatType.Exclamation, ChatColor.Server);
                break;

            case TalkType.Admin:
                m_game.Hud.AddChat(ChatTabs.Group, name, msg, ChatType.HGM, ChatColor.Admin);
                break;

            case TalkType.Announce:
                World.Instance.ActiveMapRenderer.MakeSpeechBubble(null, msg, false);
                m_game.Hud.AddChat(ChatTabs.Local, name, msg, ChatType.GlobalAnnounce, ChatColor.ServerGlobal);
                m_game.Hud.AddChat(ChatTabs.Global, name, msg, ChatType.GlobalAnnounce, ChatColor.ServerGlobal);
                m_game.Hud.AddChat(ChatTabs.Group, name, msg, ChatType.GlobalAnnounce, ChatColor.ServerGlobal);
                break;
            }
        }
Пример #22
0
    public void Say(TalkType type, string content, System.Action onComplete)
    {
        if (_hidingCoroutine != null)
        {
            StopCoroutine(_hidingCoroutine);
        }
        if (type == TalkType.None)
        {
            gameObject.SetActive(false);
            return;
        }

        txtContent.text = content;
        var color = talkTypeColors[(int)type];

        if (color == Color.clear)
        {
            color = Color.white;
        }
        imgBubble.color = color;

        gameObject.SetActive(true);
        _hidingCoroutine = StartCoroutine(SayCo(onComplete));
    }
Пример #23
0
 public static string Disagree(TalkType talkType, int day, int id)
 {
     string[] split = { Topic.DISAGREE.ToString(), talkType.ToString(), "day" + day, "ID:" + id };
     return WordAttachment(split);
 }
Пример #24
0
 private void _chatByPlayerID(TalkType type, int id, string message)
 {
     World.Instance.ActiveMapRenderer.RenderChatMessage(type, id, message, type == TalkType.Party ? ChatType.PlayerPartyDark : ChatType.SpeechBubble);
 }
Пример #25
0
 public async Task <List <TalkModel> > GetTalkList(int pageSize, TalkType type)
 {
     return(await Table <TalkModel>().Where(s => s.TalkType == type).OrderByDescending(a => a.DateAdded).Skip(0).Take(pageSize).ToListAsync());
 }
Пример #26
0
		public void RenderChatMessage(TalkType messageType, int playerID, string message, ChatType chatType = ChatType.None)
		{
			//convert the messageType into a valid ChatTab to pass everything on to
			ChatTabs tab;
			switch (messageType)
			{
				case TalkType.NPC:
				case TalkType.Local: tab = ChatTabs.Local; break;
				case TalkType.Party: tab = ChatTabs.Group; break;
				default: throw new ArgumentOutOfRangeException("messageType", "Unsupported message type for chat rendering");
			}

			DrawableGameComponent dgc;
			string playerName = null;
			if (messageType == TalkType.NPC)
			{
				lock(_npcListLock)
					dgc = npcList.Find(_npc => _npc.Index == playerID);
				if (dgc != null)
					playerName = ((NPC) dgc).Data.Name;
			}
			else
			{
				lock (_rendererListLock)
				{
					dgc = otherRenderers.Find(_rend => _rend.Character.ID == playerID);
					if (dgc != null)
						playerName = ((CharacterRenderer) dgc).Character.Name;
				}
			}

			if (playerName == null) return;

			if(playerName.Length > 1)
				playerName = char.ToUpper(playerName[0]) + playerName.Substring(1);

			if (EOGame.Instance.Hud == null)
				return;

			message = EOChatRenderer.Filter(message, false);

			if (message != null)
			{
				EOGame.Instance.Hud.AddChat(tab, playerName, message, chatType);
				if (messageType == TalkType.Party)
				{
					//party chat also adds to local with the PM color
					EOGame.Instance.Hud.AddChat(ChatTabs.Local, playerName, message, chatType, ChatColor.PM);
				}
				MakeSpeechBubble(dgc, message, messageType == TalkType.Party);
			}
		}
Пример #27
0
 public void Add(TalkType newType)
 {
     db.Add(newType);
 }
 private void _chatByPlayerID(TalkType type, int id, string message)
 {
     World.Instance.ActiveMapRenderer.RenderChatMessage(type, id, message, type == TalkType.Party ? ChatType.PlayerPartyDark : ChatType.SpeechBubble);
 }
 public static string Disagree(TalkType talkType, int day, int id)
 {
     string[] split = { Topic.DISAGREE.ToString(), talkType.ToString(), "day" + day, "ID:" + id };
     return(WordAttachment(split));
 }
Пример #30
0
        public async Task GetServiceTalkListAsync(int pageIndex, int pageSize, int position)
        {
            TalkType type     = TalkType.All;
            string   talkType = "all";

            switch (position)
            {
            case 0:
                type     = TalkType.All;
                talkType = "all";
                break;

            case 1:
                type = TalkType.RecentComment;
                //talkType = "all";
                break;

            case 2:
                type     = TalkType.All;
                talkType = "all";
                break;

            case 3:
                type     = TalkType.All;
                talkType = "all";
                break;
            }
            switch (type)
            {
            case TalkType.All:
                string url = string.Format(Constant.TALK_ALL_LIST, talkType, pageIndex, pageSize);
                await HttpClientUtil.GetAsync <List <TalkModel> >(url, null,
                                                                  async (list) => {
                    talkView.GetServiceTalkSuccess(list);
                    list.ForEach(f => f.TalkType = type);
                    await SqliteDatabase.Instance().UpdateTalkList(list);
                },
                                                                  (error) => {
                    talkView.GetServiceTalkFail(error);
                });

                break;

            case TalkType.RecentComment:
                string urlRecnetComment = string.Format(Constant.TAKL_RECENT_LIST, "RecentComment", pageIndex, 30);
                await HttpClientUtil.GetTalkRecentAsync(urlRecnetComment,
                                                        async (list) =>
                {
                    talkView.GetServiceTalkSuccess(list);
                    list.ForEach(f => f.TalkType = type);
                    await SqliteDatabase.Instance().UpdateTalkList(list);
                    list.ForEach(f => f.TalkType = type);
                },
                                                        (error) =>
                {
                    talkView.GetServiceTalkFail(error);
                });

                break;
            }
        }
Пример #31
0
        /// <summary>
        /// Triggered when any creature speaks
        /// We're basically using "Creature" since this function will handle NPCs and monsters speaking
        /// </summary>
        /// <param name="creature"></param>
        /// <param name="type"></param>
        /// <param name="message"></param>
        /// <param name="privateTo"></param>
        /// <param name="channelId"></param>
        public static void CreatureSpeak(Creature creature, TalkType type, string message, string privateTo, short channelId = 0)
        {
            Task.Factory.StartNew(() =>
            {
                HashSet <Creature> spectators = new HashSet <Creature>();
                switch (type)
                {
                case TalkType.Say:
                    GetCreatureSpectators(spectators, creature.Position, false,
                                          Map.maxClientViewportX, Map.maxClientViewportX, Map.maxClientViewportY, Map.maxClientViewportY);
                    foreach (Creature c in spectators)
                    {
                        if (c is Player)
                        {
                            Player player = (Player)c;
                            player.Connection.SendCreatureSay(creature, type, message);
                        }

                        c.onCreatureSpeak(creature, type, message);
                    }
                    break;

                case TalkType.Whisper:
                    GetCreatureSpectators(spectators, creature.Position, false,
                                          Map.maxClientViewportX, Map.maxClientViewportX, Map.maxClientViewportY, Map.maxClientViewportY);
                    foreach (Creature c in spectators)
                    {
                        if (c is Player)
                        {
                            Player player = (Player)c;
                            if (Position.AreInRange(player.Position, creature.Position))
                            {
                                player.Connection.SendCreatureSay(creature, type, message);
                            }
                            else
                            {
                                player.Connection.SendCreatureSay(creature, type, "pspsps");
                            }
                        }

                        c.onCreatureSpeak(creature, type, message);
                    }
                    break;

                case TalkType.Yell:
                    // TODO: Yelling exhaustion, 30 seconds
                    GetCreatureSpectators(spectators, creature.Position, false,
                                          18, 18, 14, 14);
                    foreach (Creature c in spectators)
                    {
                        if (c is Player)
                        {
                            Player player = (Player)c;
                            player.Connection.SendCreatureSay(creature, type, message.ToUpper());
                        }
                    }
                    break;

                case TalkType.PrivateChannel:
                case TalkType.PrivateChannelRed:
                case TalkType.RuleViolationAnswer:
                    PlayerTalkTo((Player)creature, type, message, privateTo);
                    break;

                case TalkType.ChannelYellow:
                case TalkType.ChannelRed:
                case TalkType.ChannelRedAnonymous:
                    if (!Channels.PlayerTalkToChannel((Player)creature, (ChannelID)channelId, message, type))
                    {
                        // Re-send in default as we weren't able to talk to the given channel
                        CreatureSpeak(creature, TalkType.Say, message, "");
                    }
                    break;

                case TalkType.Broadcast:
                    PlayerBroadcastMessage((Player)creature, message);
                    break;

                case TalkType.RuleViolationContinue:
                    RuleViolations.PlayerContinueRuleViolationReport((Player)creature, message);
                    break;

                case TalkType.RuleViolationChannel:     // Rule Violation Reporting
                    RuleViolations.PlayerReportRuleViolation((Player)creature, message);
                    break;

                default:
                    break;
                }
            });
        }
 private void _chatByPlayerName(TalkType type, string name, string msg)
 {
     switch (type)
     {
         //invalid types
         case TalkType.Local:
         case TalkType.Party:
             break;
         case TalkType.PM:
             m_game.Hud.AddChat(ChatTabs.Local, name, msg, ChatType.Note, ChatColor.PM);
             ChatTabs tab = m_game.Hud.GetPrivateChatTab(name);
             m_game.Hud.AddChat(tab, name, msg, ChatType.Note);
             break;
         case TalkType.Global: m_game.Hud.AddChat(ChatTabs.Global, name, msg, ChatType.GlobalAnnounce); break;
         case TalkType.Guild: m_game.Hud.AddChat(ChatTabs.Group, name, msg); break;
         case TalkType.Server:
             m_game.Hud.AddChat(ChatTabs.Local, World.GetString(DATCONST2.STRING_SERVER), msg, ChatType.Exclamation, ChatColor.Server);
             m_game.Hud.AddChat(ChatTabs.Global, World.GetString(DATCONST2.STRING_SERVER), msg, ChatType.Exclamation, ChatColor.ServerGlobal);
             m_game.Hud.AddChat(ChatTabs.System, "", msg, ChatType.Exclamation, ChatColor.Server);
             break;
         case TalkType.Admin:
             m_game.Hud.AddChat(ChatTabs.Group, name, msg, ChatType.HGM, ChatColor.Admin);
             break;
         case TalkType.Announce:
             World.Instance.ActiveMapRenderer.MakeSpeechBubble(null, msg, false);
             m_game.Hud.AddChat(ChatTabs.Local, name, msg, ChatType.GlobalAnnounce, ChatColor.ServerGlobal);
             m_game.Hud.AddChat(ChatTabs.Global, name, msg, ChatType.GlobalAnnounce, ChatColor.ServerGlobal);
             m_game.Hud.AddChat(ChatTabs.Group, name, msg, ChatType.GlobalAnnounce, ChatColor.ServerGlobal);
             break;
     }
 }
Пример #33
0
        /// <summary>
        /// Player talks to the given channel
        /// </summary>
        /// <param name="player"></param>
        /// <param name="id"></param>
        /// <param name="message"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public static bool PlayerTalkToChannel(Player player, ChannelID id, string message, TalkType type)
        {
            Channel channel = Channels.getChannelById(id);

            if (channel != null)
            {
                if (type != TalkType.RuleViolationAnswer)
                {
                    type = TalkType.ChannelYellow;
                }

                channel.PlayerTalk(player, type, message);
                return(true);
            }

            return(false);
        }
Пример #34
0
        public void Update(TalkType updatedType)
        {
            var entity = db.Attach(updatedType);

            entity.State = EntityState.Modified;
        }
Пример #35
0
 /// <summary>
 /// Event called when a creature speaks
 /// </summary>
 /// <param name="creature"></param>
 /// <param name="type"></param>
 /// <param name="message"></param>
 public virtual bool onCreatureSpeak(Creature creature, TalkType type, string message)
 {
     return(true);
 }