Ejemplo n.º 1
0
        bool InstanceHasScript(WorldObject obj, string scriptName)
        {
            InstanceMap instance = obj.GetMap().ToInstanceMap();

            if (instance != null)
            {
                return(instance.GetScriptName() == scriptName);
            }

            return(false);
        }
Ejemplo n.º 2
0
        public static T GetInstanceAI <T>(WorldObject obj, string scriptName) where T : class
        {
            InstanceMap instance = obj.GetMap().ToInstanceMap();

            if (instance != null && instance.GetInstanceScript() != null)
            {
                if (instance.GetScriptName() == scriptName)
                {
                    return((T)Activator.CreateInstance(typeof(T), obj));
                }
            }

            return(null);
        }