Example #1
0
        public GameObjectInfo(ObjectGUID guid, gameobject gameObject, gameobject_template template)
            : base(guid)
        {
            DisplayID   = template.displayId;
            Flags       = (int)template.flags;
            TypeID      = template.type;
            State       = gameObject.state;
            X           = gameObject.position_x;
            Y           = gameObject.position_y;
            Z           = gameObject.position_z;
            Rotation0   = gameObject.rotation0;
            Rotation1   = gameObject.rotation1;
            Orientation = gameObject.orientation;

            if (gameObject.rotation2 == 0 && gameObject.rotation3 == 0)
            {
                gameObject.rotation2 = (float)Math.Sin(gameObject.orientation / 2);
                gameObject.rotation3 = (float)Math.Cos(gameObject.orientation / 2);
            }

            Rotation2 = gameObject.rotation2;
            Rotation3 = gameObject.rotation3;

            Type |= (int)TypeMask.TYPEMASK_GAMEOBJECT;
        }
Example #2
0
        public void AddGameObjectEntity(gameobject gameObject)
        {
            var guid             = new ObjectGUID((ulong)gameObject.guid, TypeID.TYPEID_GAMEOBJECT);
            var template         = vanillaWorld.WorldDatabase.GetRepository <gameobject_template>().SingleOrDefault(t => t.entry == gameObject.id);
            var gameObjectEntity = new GameObjectEntity(guid, gameObject, template);

            GameObjectEntities.Add(gameObjectEntity);
            gameObjectEntity.Setup();
        }
Example #3
0
        private void Form1_KeyPress(object sender, KeyPressEventArgs e)
        {
            switch (e.KeyChar)
            {
            case 'w':
                var raven = new gameobject(Properties.Resources.thecrow, 20, 20, painter, 1, 1024);
                everyone.Add(raven);
                break;

            default:
                break;
            }
        }
Example #4
0
 public GameObjectEntity(ObjectGUID objectGUID, gameobject databaseGameObject, gameobject_template template)
     : base(objectGUID)
 {
     this.Template   = template;
     this.GameObject = databaseGameObject;
 }