Beispiel #1
0
        public void Execute(string commandName, CharacterInstance actor, string argument)
        {
            var command = _dbManager.GetEntity <CommandData>(commandName);

            if (command == null)
            {
                throw new EntryNotFoundException();
            }

            var attrib = command.DoFunction.Value.GetAttribute <CommandAttribute>(command.FunctionName);

            if (attrib != null)
            {
                if (CheckNpcAttribute(attrib, actor))
                {
                    return;
                }
            }

            command.DoFunction.Value.Invoke(actor, argument);
        }
        public static int LookupSkill(this IRepositoryManager repoManager, string name)
        {
            var skill = repoManager.GetEntity <SkillData>(name);

            if (skill == null)
            {
                var skills = repoManager.SKILLS.Values.Where(x => x.Name.StartsWithIgnoreCase(name));
                if (!skills.Any())
                {
                    repoManager.LogManager.Bug("Skill entry {0} not found", name);
                    return(-1);
                }

                skill = skills.First();
            }

            return((int)skill.ID);
        }
 public bool IsValidSpecFun(string name)
 {
     return(_dbManager.GetEntity <SpecialFunction>(name) != null &&
            SpecialFuncLookupTable.ContainsKey(name.ToLower()));
 }
 public static RoomTemplate LuaGetRoom(long id)
 {
     return(_dbManager.GetEntity <RoomTemplate>(id));
 }