Exemplo n.º 1
0
        private void ChangeCharacter()
        {
            if (raceInfo == null)
            {
                return;
            }

            WowDatabase _wowDatabase = Engine.Instance.WowDatabase;
            string      path         = _wowDatabase.GetCharacterPath(raceInfo.ShortName, female, ModelEditorService.Instance.IsCharacterHD);
            M2SceneNode node         = ModelSceneService.Instance.SetMainM2SceneNode(path, false);

            if (node == null && ModelEditorService.Instance.IsCharacterHD)
            {
                path = _wowDatabase.GetCharacterPath(raceInfo.ShortName, female, false);
                node = ModelSceneService.Instance.SetMainM2SceneNode(path, false);
            }
            UpdateMaxCharFeature();
            UpdateCurrentCharFeature();
            UpdateStartOutfitClasses();
            SelectClass(classShortName, true);

            Player player = Client.Instance.GetPlayer();

            if (EngineService.Instance.IsGameMode && node != null && (node.Type == M2Type.MT_CHARACTER || node.Type == M2Type.MT_CREATRUE))
            {
                player.SetM2AsTarget(node, 15, (float)(Math.PI / 6.0f));
            }
            else
            {
                player.SetM2AsTarget(null, 15, (float)(Math.PI / 6.0f));
            }
        }
        private bool LoadCharacter()
        {
            string      shortname    = Engine.Instance.WowDatabase.GetRaceName(raceId);
            WowDatabase _wowDatabase = Engine.Instance.WowDatabase;
            string      path         = _wowDatabase.GetCharacterPath(shortname, female, true);
            M2SceneNode node         = ModelSceneService.Instance.SetMainM2SceneNode(path, false);

            if (node == null)
            {
                path = _wowDatabase.GetCharacterPath(shortname, female, true);
                node = ModelSceneService.Instance.SetMainM2SceneNode(path, false);
            }

            if (node != null)
            {
                node.M2Instance.CharFeature = charFeature;
            }

            Player player = Client.Instance.GetPlayer();

            if (EngineService.Instance.IsGameMode && node != null &&
                (node.Type == M2Type.MT_CHARACTER || node.Type == M2Type.MT_CREATRUE))
            {
                player.SetM2AsTarget(node, 15, (float)(Math.PI / 6.0f));
            }
            else
            {
                player.SetM2AsTarget(null, 15, (float)(Math.PI / 6.0f));
            }

            return(node != null);
        }
        private void ChangeCharacter()
        {
            if (raceInfo == null)
            {
                return;
            }

            WowDatabase _wowDatabase = Engine.Instance.WowDatabase;
            string      path         = _wowDatabase.GetCharacterPath(raceInfo.ShortName, female);
            M2SceneNode node         = ModelSceneService.Instance.SetMainM2SceneNode(path, false);

            UpdateStartOutfitClasses();
            UpdateMaxCharFeature();
            UpdateCurrentCharFeature();
        }
Exemplo n.º 4
0
        private bool LoadCharacter()
        {
            string      shortname    = Engine.Instance.WowDatabase.GetRaceName(charInfo.Race);
            WowDatabase _wowDatabase = Engine.Instance.WowDatabase;
            string      path         = _wowDatabase.GetCharacterPath(shortname, charInfo.Gender != 0, true);
            M2SceneNode node         = ModelSceneService.Instance.SetMainM2SceneNode(path, false);

            if (node == null)
            {
                path = _wowDatabase.GetCharacterPath(shortname, charInfo.Gender != 0, false);
                node = ModelSceneService.Instance.SetMainM2SceneNode(path, false);
            }

            if (node != null)
            {
                SCharFeature charFeature = new SCharFeature();
                charFeature.skinColor  = charInfo.SkinColor;
                charFeature.hairColor  = charInfo.HairColor;
                charFeature.hairStyle  = charInfo.HairStyle;
                charFeature.faceType   = charInfo.FaceType;
                charFeature.facialHair = charInfo.FacialHair;

                node.M2Instance.CharFeature = charFeature;
            }

            //items
            if (node != null)
            {
                M2Appearance appearance = node.M2Appearance;
                if (appearance != null)
                {
                    appearance.TakeItem(charInfo.Head);
                    appearance.TakeItem(charInfo.Shoulder);
                    appearance.TakeItem(charInfo.Boots);
                    appearance.TakeItem(charInfo.Belt);
                    appearance.TakeItem(charInfo.Shirt);
                    appearance.TakeItem(charInfo.Pants);
                    appearance.TakeItem(charInfo.Chest);
                    appearance.TakeItem(charInfo.Bracers);
                    appearance.TakeItem(charInfo.Gloves);
                    appearance.TakeItem(charInfo.HandRight);
                    appearance.TakeItem(charInfo.HandLeft);
                    appearance.TakeItem(charInfo.Cape);
                    appearance.TakeItem(charInfo.Tabard);
                }

                ModelEditorService.Instance.ShowModelPart(node);
                ModelEditorService.Instance.ShowEditPart(node);
                ModelEditorService.Instance.SetWireFrame(node);
                ModelEditorService.Instance.SheathM2NodeWeapon(node);

                node.UpdateCharacter();

                //update property
                ShellService.Instance.PropertyContent.UpdateCharacterNode(node);

                if (ShellService.Instance.EquipmentsWindow.IsVisible)
                {
                    ShellService.Instance.EquipmentsWindow.Update();
                }

                if (ShellService.Instance.EquipmentSelectWindow.IsVisible)
                {
                    ShellService.Instance.EquipmentSelectWindow.Update();
                }
            }

            Player player = Client.Instance.GetPlayer();

            if (EngineService.Instance.IsGameMode && node != null &&
                (node.Type == M2Type.MT_CHARACTER || node.Type == M2Type.MT_CREATRUE))
            {
                player.SetM2AsTarget(node, 15, (float)(Math.PI / 6.0f));
            }
            else
            {
                player.SetM2AsTarget(null, 15, (float)(Math.PI / 6.0f));
            }

            return(node != null);
        }