예제 #1
0
        private static MonsterType RefreshMonsterType(bool addToDictionary)
        {
            SNORecordMonster monsterInfo = c_diaObject.CommonData.MonsterInfo;
            MonsterType      monsterType;

            if (monsterInfo != null)
            {
                // Force Jondar as an undead, since Diablo 3 sticks him as a permanent ally
                if (CurrentCacheObject.ActorSNO == 86624)
                {
                    monsterType = MonsterType.Undead;
                }
                else
                {
                    monsterType = monsterInfo.MonsterType;
                }
                // Is this going to be a new dictionary entry, or updating one already existing?
                if (addToDictionary)
                {
                    CacheData.MonsterTypes.Add(CurrentCacheObject.ActorSNO, monsterType);
                }
                else
                {
                    CacheData.MonsterTypes[CurrentCacheObject.ActorSNO] = monsterType;
                }
            }
            else
            {
                monsterType = MonsterType.Undead;
            }
            return(monsterType);
        }
예제 #2
0
        private static MonsterType RefreshMonsterType(ACD tempCommonData, MonsterType monsterType, bool bAddToDictionary)
        {
            SNORecordMonster monsterInfo = tempCommonData.MonsterInfo;

            if (monsterInfo != null)
            {
                // Force Jondar as an undead, since Diablo 3 sticks him as a permanent ally
                if (c_ActorSNO == 86624)
                {
                    monsterType = MonsterType.Undead;
                }
                else
                {
                    monsterType = monsterInfo.MonsterType;
                }
                // Is this going to be a new dictionary entry, or updating one already existing?
                if (bAddToDictionary)
                {
                    dictionaryStoredMonsterTypes.Add(c_ActorSNO, monsterType);
                }
                else
                {
                    dictionaryStoredMonsterTypes[c_ActorSNO] = monsterType;
                }
            }
            else
            {
                monsterType = MonsterType.Undead;
            }
            return(monsterType);
        }
예제 #3
0
        private static void RefreshMonsterSize()
        {
            SNORecordMonster monsterInfo = CurrentCacheObject.Unit.MonsterInfo;

            if (monsterInfo != null)
            {
                c_unit_MonsterSize = monsterInfo.MonsterSize;
                CacheData.MonsterSizes.Add(CurrentCacheObject.ActorSNO, c_unit_MonsterSize);
            }
            else
            {
                c_unit_MonsterSize = MonsterSize.Unknown;
            }
        }
예제 #4
0
        private static void RefreshMonsterSize()
        {
            SNORecordMonster monsterInfo = c_diaUnit.MonsterInfo;

            if (monsterInfo != null)
            {
                c_unit_MonsterSize = monsterInfo.MonsterSize;
                dictionaryStoredMonsterSizes.Add(c_ActorSNO, c_unit_MonsterSize);
            }
            else
            {
                c_unit_MonsterSize = MonsterSize.Unknown;
            }
        }
예제 #5
0
        /// <summary> Gets a monster type for the provided unit. </summary>
        /// <param name="unit"> The unit. </param>
        /// <returns> The monster type. </returns>
        private MonsterType GetMonsterType(DiaUnit unit)
        {
            int actorSNO = unit.ActorSNO;

            MonsterType type;

            if (!MonsterTypeCache.TryGetValue(actorSNO, out type))
            {
                SNORecordMonster monsterInfo = unit.MonsterInfo;
                if (monsterInfo != null)
                {
                    type = monsterInfo.MonsterType;
                }

                MonsterTypeCache.Add(actorSNO, type);
            }

            return(type);
        }
예제 #6
0
        private MonsterSize GetMonsterSize(DiaUnit unit)
        {
            int         actorSNO = unit.ActorSNO;
            MonsterSize size;

            if (MonsterSizeCache.TryGetValue(actorSNO, out size))
            {
                return(size);
            }

            SNORecordMonster monsterInfo = unit.MonsterInfo;

            if (monsterInfo != null)
            {
                size = monsterInfo.MonsterSize;
            }

            MonsterSizeCache.Add(actorSNO, size);
            return(size);
        }