Пример #1
0
 public EmoteInfo(int id, string code, EmoteType type, int set = -1)
 {
     Id       = id.ToString();
     Code     = code;
     Type     = type;
     EmoteSet = set;
 }
Пример #2
0
 public EmoteInfo(string id, string code, EmoteType type, int set = -1)
 {
     Id       = id;
     Code     = code;
     Type     = type;
     EmoteSet = set;
 }
Пример #3
0
 public void HandleEmote(EmoteType emoteType)
 {
     if (Sound.UnitSoundByEmoteType.TryGetValue(emoteType, out UnitSounds soundType))
     {
         PlayOneShot(soundType);
     }
 }
Пример #4
0
        public async Task SetEmote(EmoteType type, IEmote emote)
        {
            var showcaseData = Context.server.GetMemory().GetData <ShowcaseSystem, ShowcaseServerData>();
            var dict         = showcaseData.emotes ??= new Dictionary <EmoteType, string>();

            dict[type] = emote?.ToString();
        }
Пример #5
0
 public EmoteInfo(int id, string code, EmoteType type, int set = -1)
 {
     Id = id.ToString();
     Code = code;
     Type = type;
     EmoteSet = set;
 }
Пример #6
0
 public EmoteInfo(string id, string code, EmoteType type, int set = -1)
 {
     Id = id;
     Code = code;
     Type = type;
     EmoteSet = set;
 }
Пример #7
0
        public static Dictionary <EmoteField, string> ParseFieldDictionary(EmoteType type, Dictionary <string, string> dict)
        {
            var fieldDict = new Dictionary <EmoteField, string>();

            foreach (var kvp in dict)
            {
                var key = kvp.Key;
                var val = kvp.Value;

                if (key.Equals(string.Empty))
                {
                    ParseOptionalFields(type, val, fieldDict);
                    continue;
                }

                var field = GetField(key);

                if (field == null)
                {
                    Console.WriteLine($"Emote_Line.ParseFieldDictionary: unknown emote field \"{key}\"");
                    continue;
                }

                fieldDict.Add(field.Value, val);
            }
            return(fieldDict);
        }
Пример #8
0
 public DialogueChunk(string inDialogue, CharacterType inCharacter = CharacterType.Scout, EmoteType inEmote = EmoteType.None, bool inLoopEmote = false)
 {
     dialogue  = inDialogue;
     character = inCharacter;
     emote     = inEmote;
     loopEmote = inLoopEmote;
 }
 public EmoteEntry(EmoteType type, string path, string stringKey, InitSpellFunc func)
 {
     this.m_emoteType           = type;
     this.m_emoteSoundSpellPath = path;
     this.m_emoteGameStringKey  = stringKey;
     this.m_initSpellFunc       = func;
 }
Пример #10
0
        /// <summary>
        /// Returns the list of EmoteSet categories an Emote type
        /// can possibly branch to
        /// </summary>
        public static List <EmoteCategory> GetValidBranches(EmoteType type)
        {
            switch (type)
            {
            case EmoteType.Goto:

                return(Branch.GotoSet);

            case EmoteType.InqAttributeStat:
            case EmoteType.InqBoolStat:
            case EmoteType.InqContractsFull:
            case EmoteType.InqFloatStat:
            case EmoteType.InqIntStat:
            case EmoteType.InqInt64Stat:
            case EmoteType.InqNumCharacterTitles:
            case EmoteType.InqOwnsItems:
            case EmoteType.InqPackSpace:
            case EmoteType.InqRawAttributeStat:
            case EmoteType.InqRawSecondaryAttributeStat:
            case EmoteType.InqRawSkillStat:
            case EmoteType.InqSecondaryAttributeStat:
            case EmoteType.InqSkillSpecialized:
            case EmoteType.InqSkillStat:
            case EmoteType.InqSkillTrained:
            case EmoteType.InqStringStat:
            case EmoteType.InqYesNo:

                return(Branch.Test);

            case EmoteType.InqQuest:
            case EmoteType.InqQuestBitsOff:
            case EmoteType.InqQuestBitsOn:
            case EmoteType.InqQuestSolves:
            case EmoteType.InqMyQuest:
            case EmoteType.InqMyQuestBitsOff:
            case EmoteType.InqMyQuestBitsOn:
            case EmoteType.InqMyQuestSolves:
            case EmoteType.UpdateMyQuest:
            case EmoteType.UpdateQuest:

                return(Branch.Quest);

            case EmoteType.InqEvent:

                return(Branch.Event);

            case EmoteType.InqFellowNum:

                return(Branch.TestFellow);

            case EmoteType.InqFellowQuest:
            case EmoteType.UpdateFellowQuest:

                return(Branch.QuestFellow);

            default:

                return(null);
            }
        }
Пример #11
0
 public void SendEmote(EmoteType EmoteType)
 {
     PacketOut packet = new PacketOut(WorldServerOpCode.CMSG_TEXT_EMOTE);
     packet.Write((UInt32)EmoteType);
     packet.Write((UInt32)0x00);
     packet.Write((UInt64)0x00);
     Send(packet);
 }
Пример #12
0
        /// <summary>
        /// checks the EmoteType attributes of the requested property to determine whether or not
        /// it should be shown
        /// </summary>
        public static bool IsPropertyVisible(string propertyName, EmoteType emoteType)
        {
            PropertyInfo property = typeof(Emote).GetProperty(propertyName);
            var          attribs  = property.GetCustomAttributes(typeof(EmoteTypeAttribute), false).Cast <EmoteTypeAttribute>().ToList();

            // because the lists are long and could get unwieldy, we'll allow for multiple on the same property
            return(attribs.Any(a => a.TypeList.Contains(emoteType)));
        }
Пример #13
0
    IEnumerator showEmoteLoop(EmoteType emote)
    {
        animator.SetTrigger(emoteDictionary[emote]);
        //Debug.Log("wait anim " + animator.GetCurrentAnimatorStateInfo(0).length);
        yield return(new WaitForSeconds(0.3f));

        showEmoteLoop(emote);
    }
Пример #14
0
        public void SendEmote(EmoteType EmoteType)
        {
            PacketOut packet = new PacketOut(WorldServerOpCode.CMSG_TEXT_EMOTE);

            packet.Write((UInt32)EmoteType);
            packet.Write((UInt32)0x00);
            packet.Write((UInt64)0x00);
            Send(packet);
        }
Пример #15
0
 public static void SendEmote(WorldObject obj, EmoteType emote)
 {
     using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.SMSG_EMOTE, 12))
     {
         packet.WriteUInt((uint)emote);
         packet.Write(obj.EntityId);
         obj.SendPacketToArea(packet, true, false, Locale.Any, new float?());
     }
 }
Пример #16
0
        public static void SendEmote(WorldObject obj, EmoteType emote)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_EMOTE, 12))
            {
                packet.WriteUInt((uint)emote);
                packet.Write(obj.EntityId);

                obj.SendPacketToArea(packet, true);
            }
        }
Пример #17
0
        public Emote(EmoteType type)
        {
            Type = type;

            ValidBranches = GetValidBranches(type);

            if (ValidBranches != null)
            {
                Branches = new List <EmoteSet>();
            }
        }
Пример #18
0
        public void DoEmote(EmoteType emoteType)
        {
            if (!Player.ExistsIn(World))
            {
                return;
            }

            PlayerEmoteRequestEvent emoteRequest = PlayerEmoteRequestEvent.Create(Bolt.GlobalTargets.OnlyServer);

            emoteRequest.EmoteType = (int)emoteType;
            emoteRequest.Send();
        }
Пример #19
0
        public static string GetStatName(int?stat, EmoteType type)
        {
            if (stat == null)
            {
                return("");
            }

            switch (type)
            {
            case EmoteType.AwardLevelProportionalSkillXP:
            case EmoteType.AwardSkillPoints:
            case EmoteType.AwardSkillXP:

            case EmoteType.InqSkillStat:
            case EmoteType.InqRawSkillStat:
            case EmoteType.InqSkillTrained:
            case EmoteType.InqSkillSpecialized:
            case EmoteType.UntrainSkill:
                return($" /* {(Skill)stat} */");

            case EmoteType.DecrementIntStat:
            case EmoteType.IncrementIntStat:
            case EmoteType.InqIntStat:
            case EmoteType.SetIntStat:
                return($" /* {(PropertyInt)stat} */");

            case EmoteType.InqAttributeStat:
            case EmoteType.InqRawAttributeStat:
                return($" /* {(PropertyAttribute)stat} */");

            case EmoteType.InqBoolStat:
            case EmoteType.SetBoolStat:
                return($" /* {(PropertyBool)stat} */");

            case EmoteType.InqFloatStat:
            case EmoteType.SetFloatStat:
                return($" /* {(PropertyFloat)stat} */");

            case EmoteType.InqInt64Stat:
            case EmoteType.SetInt64Stat:
                return($" /* {(PropertyInt64)stat} */");

            case EmoteType.InqSecondaryAttributeStat:
            case EmoteType.InqRawSecondaryAttributeStat:
                return($" /* {(PropertyAttribute2nd)stat} */");

            case EmoteType.InqStringStat:
                return($" /* {(PropertyAttribute2nd)stat} */");

            default:
                return("");
            }
        }
Пример #20
0
        private void HandleEmoteUpdate()
        {
            EmoteType emoteType = Unit.EmoteType;

            if (emoteType.IsState() || emoteType == EmoteType.None)
            {
                DoEmote();
            }
            else if (emoteType.IsOneShot() && BoltNetwork.Frame - Unit.EmoteFrame <= UnitUtils.EmoteOneShotFrameThreshold)
            {
                DoEmote();
            }
        }
Пример #21
0
        public IEmote GetEmote(EmoteType emoteType, bool throwOnFail = true)
        {
            if (TryGetEmote(emoteType, out var emote))
            {
                return(emote);
            }

            if (!throwOnFail)
            {
                return(null);
            }

            throw new BotError($"Emote '{emoteType}' hasn't been set or is missing.");
        }
Пример #22
0
 public void showEmote(EmoteType emote, bool loop = false)
 {
     CancelInvoke();
     if (loop)
     {
         StartCoroutine(showEmoteLoop(emote));
         Invoke("showEmoteLoop2", 0.0f);
     }
     else
     {
         var animationState = animator.GetCurrentAnimatorStateInfo(0);
         animator.SetTrigger(emoteDictionary[emote]);
     }
 }
Пример #23
0
        public static string GetEmote(EmoteType emoteType)
        {
            Random r = new Random();

            switch (emoteType)
            {
            case EmoteType.Happy: return(happyEmotes[r.Next(happyEmotes.Count)]);

            case EmoteType.Love: return(loveEmotes[r.Next(loveEmotes.Count)]);

            case EmoteType.Sad: return(sadEmotes[r.Next(sadEmotes.Count)]);

            case EmoteType.Worried: return(worriedEmotes[r.Next(worriedEmotes.Count)]);
            }
            return(string.Empty);
        }
Пример #24
0
    public void HandleAction(Network.UserUI newData)
    {
        bool flag = false;

        if (newData.playerId.HasValue)
        {
            Player friendlySidePlayer = GameState.Get().GetFriendlySidePlayer();
            flag = (friendlySidePlayer != null) && (friendlySidePlayer.GetPlayerId() == newData.playerId.Value);
        }
        if (newData.mouseInfo != null)
        {
            if (flag)
            {
                this.friendlyWantedUI.held.ID   = newData.mouseInfo.HeldCardID;
                this.friendlyWantedUI.over.ID   = newData.mouseInfo.OverCardID;
                this.friendlyWantedUI.origin.ID = newData.mouseInfo.ArrowOriginID;
            }
            else
            {
                this.enemyWantedUI.held.ID   = newData.mouseInfo.HeldCardID;
                this.enemyWantedUI.over.ID   = newData.mouseInfo.OverCardID;
                this.enemyWantedUI.origin.ID = newData.mouseInfo.ArrowOriginID;
            }
            this.UpdateCardOver();
            this.UpdateCardHeld();
            this.MaybeDestroyArrow();
            this.MaybeCreateArrow();
            this.UpdateTargetArrow();
        }
        else if (newData.emoteInfo != null)
        {
            EmoteType emote = (EmoteType)newData.emoteInfo.Emote;
            if (flag)
            {
                GameState.Get().GetFriendlySidePlayer().GetHeroCard().PlayEmote(emote);
            }
            else if (((EnemyEmoteHandler.Get() != null) && !EnemyEmoteHandler.Get().IsSquelched()) && s_validUserEmotes.Contains(emote))
            {
                GameState.Get().GetOpposingSidePlayer().GetHeroCard().PlayEmote(emote);
            }
        }
    }
Пример #25
0
        public static string GetAmountName(int?amount, EmoteType type)
        {
            if (amount == null)
            {
                return("");
            }

            switch (type)
            {
            case EmoteType.AddCharacterTitle:
                return($" /* {(CharacterTitle)amount} */");

            case EmoteType.AddContract:
            case EmoteType.RemoveContract:
                return($" /* {(ContractId)amount} */");

            default:
                return("");
            }
        }
Пример #26
0
        public static EmoteEntry GetEmoteEntry(PlayerMobile player, EmoteType emoteType)
        {
            EmoteEntry entry = null;

            if (player == null)
            {
                return(entry);
            }

            EnhancementsPersistance.CheckAndCreateEnhancementsAccountEntry(player);

            foreach (EmoteEntry playerEntry in player.m_EnhancementsAccountEntry.m_Emotes)
            {
                if (playerEntry.m_Emote == emoteType)
                {
                    return(playerEntry);
                }
            }

            return(entry);
        }
Пример #27
0
    public void ShowEmote(EmoteType type)
    {
        Material material = null;

        switch (type)
        {
        case EmoteType.Angry:
            material = EmoteAngry;
            break;

        case EmoteType.Buying:
            material = EmoteBuying;
            break;

        default:
            break;
        }

        MeshRenderer.material = material;
        Animator.SetTrigger("Show");
    }
Пример #28
0
        public static bool HasEmoteActive(PlayerMobile player, EmoteType emote)
        {
            if (player == null)
            {
                return(false);
            }

            EmoteEntry entry = GetEmoteEntry(player, emote);

            if (entry == null)
            {
                return(false);
            }

            if (entry.m_Unlocked)
            {
                return(true);
            }

            return(false);
        }
Пример #29
0
    public void Play_Emote(EmoteType emoteType)
    {
        if (play == true)
        {
            switch (emoteType)
            {
            case EmoteType.SLEEPING:

                break;

            case EmoteType.WAITING:

                break;

            case EmoteType.EXCLAMATION:
                AkSoundEngine.PostEvent("emo_shocked", gameObject);
                break;

            case EmoteType.ANGRY:
                AkSoundEngine.PostEvent("emo_angry", gameObject);
                break;

            case EmoteType.SHOCKED:
                AkSoundEngine.PostEvent("emo_shocked", gameObject);
                break;

            case EmoteType.CONFUSED:
                AkSoundEngine.PostEvent("emo_confused", gameObject);
                break;

            case EmoteType.DIZZY:

                break;

            case EmoteType.HAPPY:
                AkSoundEngine.PostEvent("emo_happy", gameObject);
                break;
            }
        }
    }
Пример #30
0
        public static Emote BuildEmote(EmoteType type, Dictionary <string, string> dict, float?delay = null)
        {
            var emote = Factory.Create(type);

            emote.Delay = delay;

            var kvps = ParseFieldDictionary(type, dict);

            foreach (var kvp in kvps)
            {
                if (!FieldTypes.ContainsKey(kvp.Key))
                {
                    Console.WriteLine($"Emote_Line.BuildEmote({kvp.Key}) - skipping");
                    continue;
                }

                var val = kvp.Value;

                switch (kvp.Key)
                {
                case EmoteField.Delay:
                    emote.Delay = Parser.TryParseFloat(val);
                    break;

                case EmoteField.Extent:
                    emote.Extent = Parser.TryParseFloat(val);
                    break;

                case EmoteField.Motion:
                    emote.Motion = Parser.TryParseMotionCommand(val);
                    break;

                case EmoteField.Message:
                    emote.Message = val;
                    break;

                case EmoteField.TestString:
                    emote.TestString = val;
                    break;

                case EmoteField.Min:
                    emote.Min = Parser.TryParseInt(val);
                    break;

                case EmoteField.Max:
                    emote.Max = Parser.TryParseInt(val);
                    break;

                case EmoteField.Min64:
                    emote.Min64 = Parser.TryParseInt64(val);
                    break;

                case EmoteField.Max64:
                    emote.Max64 = Parser.TryParseInt64(val);
                    break;

                case EmoteField.MinFloat:
                    emote.MinFloat = Parser.TryParseFloat(val);
                    break;

                case EmoteField.MaxFloat:
                    emote.MaxFloat = Parser.TryParseFloat(val);
                    break;

                case EmoteField.Stat:
                    emote.Stat = Parser.TryParseInt(val);
                    break;

                case EmoteField.Display:
                    emote.Display = Parser.TryParseBool(val);
                    break;

                case EmoteField.Amount:
                    emote.Amount = Parser.TryParseInt(val);
                    break;

                case EmoteField.Amount64:
                    emote.Amount64 = Parser.TryParseInt64(val);
                    break;

                case EmoteField.HeroXP64:
                    emote.HeroXP64 = Parser.TryParseInt64(val);
                    break;

                case EmoteField.Percent:
                    emote.Percent = Parser.TryParseDouble(val);
                    break;

                case EmoteField.SpellId:
                    emote.SpellId = Parser.TryParseSpellId(val);
                    break;

                case EmoteField.WealthRating:
                    emote.WealthRating = Parser.TryParseInt(val);
                    break;

                case EmoteField.TreasureClass:
                    emote.TreasureClass = Parser.TryParseInt(val);
                    break;

                case EmoteField.TreasureType:
                    emote.TreasureType = Parser.TryParseInt(val);
                    break;

                case EmoteField.PScript:
                    emote.PScript = Parser.TryParsePlayScript(val);
                    break;

                case EmoteField.Sound:
                    emote.Sound = Parser.TryParseSound(val);
                    break;

                case EmoteField.DestinationType:
                    emote.DestinationType = Parser.TryParseDestinationType(val);
                    break;

                case EmoteField.WeenieClassId:
                    emote.WeenieClassId = Parser.TryParseUInt(val);
                    break;

                case EmoteField.StackSize:
                    emote.StackSize = Parser.TryParseInt(val);
                    break;

                case EmoteField.Palette:
                    emote.Palette = Parser.TryParseInt(val);
                    break;

                case EmoteField.Shade:
                    emote.Shade = Parser.TryParseFloat(val);
                    break;

                case EmoteField.TryToBond:
                    emote.TryToBond = Parser.TryParseBool(val);
                    break;

                case EmoteField.ObjCellId:
                    emote.ObjCellId = Parser.TryParseUInt(val);
                    break;

                case EmoteField.OriginX:
                    emote.OriginX = Parser.TryParseFloat(val);
                    break;

                case EmoteField.OriginY:
                    emote.OriginY = Parser.TryParseFloat(val);
                    break;

                case EmoteField.OriginZ:
                    emote.OriginZ = Parser.TryParseFloat(val);
                    break;

                case EmoteField.AnglesW:
                    emote.AnglesW = Parser.TryParseFloat(val);
                    break;

                case EmoteField.AnglesX:
                    emote.AnglesX = Parser.TryParseFloat(val);
                    break;

                case EmoteField.AnglesY:
                    emote.AnglesY = Parser.TryParseFloat(val);
                    break;

                case EmoteField.AnglesZ:
                    emote.AnglesZ = Parser.TryParseFloat(val);
                    break;
                }
            }

            emote.Message = emote.GetMessageKey();

            return(emote);
        }
Пример #31
0
		/// <summary>
		/// Makes this Unit show an animation
		/// </summary>
		public void Emote(EmoteType emote)
		{
			EmoteHandler.SendEmote(this, emote);
		}
Пример #32
0
        public int MobileId;	// optional target

        public Emote(EmoteType emoteId, int mobileId)
        {
            EmoteId = emoteId;
            MobileId = mobileId;
        }
Пример #33
0
 public void PlayEmoteResponse(EmoteType emoteType, CardSoundSpell emoteSpell)
 {
     object[] objArray1 = new object[] { emoteType, emoteSpell };
     base.method_8("PlayEmoteResponse", objArray1);
 }
Пример #34
0
 public EmoteEntry(EmoteType emote, bool unlocked)
 {
     m_Emote    = emote;
     m_Unlocked = unlocked;
 }
Пример #35
0
        public static EmoteDetail GetEmoteDetail(EmoteType emoteType)
        {
            EmoteDetail detail = new EmoteDetail();

            detail.m_EmoteType = emoteType;

            #region Emote Details

            switch (emoteType)
            {
            case EmoteType.Anger:
                detail.m_EmoteName = "Anger";
                detail.m_Hue       = 2116;
                break;

            case EmoteType.Belch:
                detail.m_EmoteName = "Belch";
                detail.m_Hue       = 2206;
                break;

            case EmoteType.Clap:
                detail.m_EmoteName = "Clap";
                detail.m_Hue       = 2212;
                break;

            case EmoteType.Confused:
                detail.m_EmoteName = "Confused";
                detail.m_Hue       = 2592;
                break;

            case EmoteType.Cough:
                detail.m_EmoteName = "Cough";
                detail.m_Hue       = 2415;
                break;

            case EmoteType.Cry:
                detail.m_EmoteName = "Cry";
                detail.m_Hue       = 2603;
                break;

            case EmoteType.Fart:
                detail.m_EmoteName = "Fart";
                detail.m_Hue       = 2208;
                break;

            case EmoteType.Greet:
                detail.m_EmoteName = "Greet";
                detail.m_Hue       = 2606;
                break;

            case EmoteType.Groan:
                detail.m_EmoteName = "Groan";
                detail.m_Hue       = 2415;
                break;

            case EmoteType.Hiccup:
                detail.m_EmoteName = "Hiccup";
                detail.m_Hue       = 53;
                break;

            case EmoteType.Hurt:
                detail.m_EmoteName = "Hurt";
                detail.m_Hue       = 1256;
                break;

            case EmoteType.Kiss:
                detail.m_EmoteName = "Kiss";
                detail.m_Hue       = 2606;
                break;

            case EmoteType.Laugh:
                detail.m_EmoteName = "Laugh";
                detail.m_Hue       = 2603;
                break;

            case EmoteType.No:
                detail.m_EmoteName = "No";
                detail.m_Hue       = 2116;
                break;

            case EmoteType.Oops:
                detail.m_EmoteName = "Oops";
                detail.m_Hue       = 2553;
                break;

            case EmoteType.Puke:
                detail.m_EmoteName = "Puke";
                detail.m_Hue       = 2208;
                break;

            case EmoteType.Shush:
                detail.m_EmoteName = "Shush";
                detail.m_Hue       = 2530;
                break;

            case EmoteType.Sick:
                detail.m_EmoteName = "Sick";
                detail.m_Hue       = 2208;
                break;

            case EmoteType.Sleep:
                detail.m_EmoteName = "Sleep";
                detail.m_Hue       = 2535;
                break;

            case EmoteType.Spit:
                detail.m_EmoteName = "Spit";
                detail.m_Hue       = 2603;
                break;

            case EmoteType.Surprise:
                detail.m_EmoteName = "Surprise";
                detail.m_Hue       = 2592;
                break;

            case EmoteType.Whistle:
                detail.m_EmoteName = "Whistle";
                detail.m_Hue       = 2660;
                break;

            case EmoteType.Yell:
                detail.m_EmoteName = "Yell";
                detail.m_Hue       = 53;
                break;

            case EmoteType.Yes:
                detail.m_EmoteName = "Yes";
                detail.m_Hue       = 2599;
                break;
            }

            #endregion

            return(detail);
        }
Пример #36
0
        public static string GetName(this EmoteType prop)
        {
            var description = EnumHelper.GetAttributeOfType <DisplayAttribute>(prop);

            return(description?.Name ?? prop.ToString() ?? "");
        }