void _npcSelect_Npc_Selected(object sender, Npc npc) { string path = Engine.Instance.WowDatabase.GetNpcPath(npc.ModelDisplayId, ModelEditorService.Instance.IsNpcHD); M2SceneNode node = ModelSceneService.Instance.SetMainM2SceneNode(path, true); if (node == null && ModelEditorService.Instance.IsNpcHD) { string path2 = Engine.Instance.WowDatabase.GetNpcPath(npc.ModelDisplayId, false); node = ModelSceneService.Instance.SetMainM2SceneNode(path2, true); } if (node != null) { ModelEditorService.Instance.ShowEditPart(node); ModelEditorService.Instance.SetWireFrame(node); ModelEditorService.Instance.SheathM2NodeWeapon(node); node.UpdateNpc(npc.ModelDisplayId); //update property if (node.Type == M2Type.MT_CHARACTER) { ShellService.Instance.PropertyContent.UpdateCharacterNode(node); if (ShellService.Instance.EquipmentsWindow.IsVisible) { ShellService.Instance.EquipmentsWindow.Update(); } if (ShellService.Instance.EquipmentSelectWindow.IsVisible) { ShellService.Instance.EquipmentSelectWindow.Update(); } } else { ShellService.Instance.PropertyContent.UpdateNpcNode(node); } } 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)); } }
void _npcSelect_Npc_Selected(object sender, Npc npc) { string path = Engine.Instance.WowDatabase.GetNpcPath(npc.ModelDisplayId); M2SceneNode node = ModelSceneService.Instance.SetMainM2SceneNode(path, true); if (node != null) { ModelEditorService.Instance.ShowEditPart(node); ModelEditorService.Instance.SetWireFrame(node); node.UpdateNpc(npc.ModelDisplayId); //update property if (node.Type == M2Type.MT_CHARACTER) { ShellService.Instance.PropertyContent.UpdateCharacterNode(node); ShellService.Instance.EquipmentsWindow.Update(); } else { ShellService.Instance.PropertyContent.UpdateNpcNode(node); } } }