├── .gitignore ├── .gitmodules ├── ACViewer.sln ├── ACViewer ├── ACE.Server │ ├── Entity │ │ ├── AttributeFormula.cs │ │ ├── GeneratorProfile.cs │ │ ├── HeldItem.cs │ │ ├── HouseCell.cs │ │ ├── IPlayer.cs │ │ ├── LandblockMesh.cs │ │ ├── Line2.cs │ │ ├── Mesh.cs │ │ ├── ModelMesh.cs │ │ ├── ModelPolygon.cs │ │ ├── Polygon.cs │ │ ├── PositionExtensions.cs │ │ ├── ProjectileSpellType.cs │ │ ├── Spell.cs │ │ ├── SpellFormula.cs │ │ ├── SpellProperties.cs │ │ ├── StaticMesh.cs │ │ ├── StaticMeshCache.cs │ │ ├── Timers.cs │ │ ├── Triangle.cs │ │ └── WorldObjectInfo.cs │ ├── Factories │ │ └── WorldObjectFactory.cs │ ├── LICENSE │ ├── Managers │ │ ├── EventManager.cs │ │ ├── GuidManager.cs │ │ └── RecipeManager.cs │ └── WorldObjects │ │ ├── Admin.cs │ │ ├── AdvocateFane.cs │ │ ├── AdvocateItem.cs │ │ ├── Allegiance.cs │ │ ├── Ammunition.cs │ │ ├── AttributeTransferDevice.cs │ │ ├── AugmentationDevice.cs │ │ ├── Bindstone.cs │ │ ├── Book.cs │ │ ├── Caster.cs │ │ ├── Chest.cs │ │ ├── Clothing.cs │ │ ├── Coin.cs │ │ ├── CombatPet.cs │ │ ├── Container.cs │ │ ├── Container_Properties.cs │ │ ├── Corpse.cs │ │ ├── Cow.cs │ │ ├── CraftTool.cs │ │ ├── Creature.cs │ │ ├── Creature_Attributes.cs │ │ ├── Creature_Combat.cs │ │ ├── Creature_Equipment.cs │ │ ├── Creature_Properties.cs │ │ ├── Creature_Skills.cs │ │ ├── Creature_Vitals.cs │ │ ├── Door.cs │ │ ├── Entity │ │ ├── CreatureAttribute.cs │ │ ├── CreatureSkill.cs │ │ └── CreatureVital.cs │ │ ├── Food.cs │ │ ├── Game.cs │ │ ├── GamePiece.cs │ │ ├── Gem.cs │ │ ├── GenericObject.cs │ │ ├── Healer.cs │ │ ├── Hook.cs │ │ ├── Hooker.cs │ │ ├── Hotspot.cs │ │ ├── House.cs │ │ ├── HousePortal.cs │ │ ├── Key.cs │ │ ├── Lifestone.cs │ │ ├── LightSource.cs │ │ ├── Lockpick.cs │ │ ├── ManaStone.cs │ │ ├── MeleeWeapon.cs │ │ ├── Missile.cs │ │ ├── MissileLauncher.cs │ │ ├── Monster.cs │ │ ├── Monster_Awareness.cs │ │ ├── Monster_Combat.cs │ │ ├── Monster_Inventory.cs │ │ ├── Monster_Properties.cs │ │ ├── PKModifier.cs │ │ ├── Pet.cs │ │ ├── PetDevice.cs │ │ ├── Player.cs │ │ ├── Player_Combat.cs │ │ ├── Player_Commerce.cs │ │ ├── Player_Database.cs │ │ ├── Player_Properties.cs │ │ ├── Player_Skills.cs │ │ ├── Player_Spells.cs │ │ ├── Portal.cs │ │ ├── Portal_Properties.cs │ │ ├── PressurePlate.cs │ │ ├── Scroll.cs │ │ ├── Sentinel.cs │ │ ├── SkillAlterationDevice.cs │ │ ├── SlumLord.cs │ │ ├── SpellComponent.cs │ │ ├── SpellProjectile.cs │ │ ├── Stackable.cs │ │ ├── Storage.cs │ │ ├── Switch.cs │ │ ├── Vendor.cs │ │ ├── WorldObject.cs │ │ ├── WorldObject_Database.cs │ │ ├── WorldObject_Equipment.cs │ │ ├── WorldObject_Generators.cs │ │ ├── WorldObject_Links.cs │ │ ├── WorldObject_Networking.cs │ │ ├── WorldObject_Properties.cs │ │ ├── WorldObject_Tick.cs │ │ ├── WorldObject_Use.cs │ │ └── WorldObject_Weapon.cs ├── ACViewer.csproj ├── ActionCommand.cs ├── App.config ├── AssemblyInfo.cs ├── Config │ ├── BackgroundColors.cs │ ├── Config.cs │ ├── ConfigManager.cs │ ├── Database.cs │ ├── MapViewerOptions.cs │ ├── Mouse.cs │ ├── Toggles.cs │ └── WindowPos.cs ├── Content │ ├── Content.mgcb │ ├── Fonts │ │ ├── Consolas.spritefont │ │ ├── Consolas.xnb │ │ └── password.ttf │ ├── Images │ │ ├── highres-color.png │ │ └── highres.png │ ├── build.bat │ ├── build_debug.bat │ ├── texture.fx │ ├── texture.mgfxo │ ├── texture_clamp.fx │ └── texture_clamp.mgfxo ├── Data │ ├── DIDTable.cs │ ├── DIDTables.cs │ ├── DIDTables.txt │ ├── Locations.txt │ ├── LootArmor.txt │ ├── LootArmorList.cs │ ├── LootItem.cs │ ├── TeleportLocationType.cs │ └── TeleportRow.cs ├── Entity │ ├── AmbientSoundDesc.cs │ ├── AmbientSoundTableDesc.cs │ ├── AnimData.cs │ ├── AnimPartChange.cs │ ├── AnimationFrame.cs │ ├── AnimationHook.cs │ ├── AnimationHooks │ │ ├── AttackHook.cs │ │ ├── CallPESHook.cs │ │ ├── CreateParticleHook.cs │ │ ├── DefaultScriptPartHook.cs │ │ ├── DestroyParticleHook.cs │ │ ├── DiffuseHook.cs │ │ ├── DiffusePartHook.cs │ │ ├── EtherealHook.cs │ │ ├── LuminousHook.cs │ │ ├── LuminousPartHook.cs │ │ ├── NoDrawHook.cs │ │ ├── ReplaceObjectHook.cs │ │ ├── ScaleHook.cs │ │ ├── SetLightHook.cs │ │ ├── SetOmegaHook.cs │ │ ├── SoundHook.cs │ │ ├── SoundTableHook.cs │ │ ├── SoundTweakedHook.cs │ │ ├── StopParticleHook.cs │ │ ├── TextureVelocityHook.cs │ │ ├── TextureVelocityPartHook.cs │ │ ├── TransparentHook.cs │ │ └── TransparentPartHook.cs │ ├── AttackCone.cs │ ├── BSPLeaf.cs │ ├── BSPNode.cs │ ├── BSPPortal.cs │ ├── BSPTree.cs │ ├── BldPortal.cs │ ├── BuildInfo.cs │ ├── CellPortal.cs │ ├── CellStruct.cs │ ├── ChatEmoteData.cs │ ├── ClothingBaseEffect.cs │ ├── ClothingObjectEffect.cs │ ├── ClothingSubPalette.cs │ ├── ClothingSubPaletteEffect.cs │ ├── ClothingSubPaletteRange.cs │ ├── ClothingTextureEffect.cs │ ├── Color.cs │ ├── CombatManeuver.cs │ ├── Contract.cs │ ├── CylSphere.cs │ ├── DayGroup.cs │ ├── EyeStripCG.cs │ ├── FaceStripCG.cs │ ├── FileType.cs │ ├── Frame.cs │ ├── GameTime.cs │ ├── GearCG.cs │ ├── Generator.cs │ ├── GfxObjInfo.cs │ ├── HairStyleCG.cs │ ├── HeritageGroupCG.cs │ ├── LandDefs.cs │ ├── LandSurf.cs │ ├── LightInfo.cs │ ├── LocationType.cs │ ├── MotionData.cs │ ├── NameFilterLanguageData.cs │ ├── ObjDesc.cs │ ├── ObjectDesc.cs │ ├── PhysicsScriptData.cs │ ├── PhysicsScriptTableData.cs │ ├── PlacementType.cs │ ├── Plane.cs │ ├── Polygon.cs │ ├── PortalPoly.cs │ ├── Position.cs │ ├── RegionMisc.cs │ ├── RoadAlphaMap.cs │ ├── SceneDesc.cs │ ├── SceneType.cs │ ├── ScriptMod.cs │ ├── Season.cs │ ├── SexCG.cs │ ├── SkillBase.cs │ ├── SkillCG.cs │ ├── SkillFormula.cs │ ├── SkyDesc.cs │ ├── SkyObject.cs │ ├── SkyObjectReplace.cs │ ├── SkyTimeOfDay.cs │ ├── SoundData.cs │ ├── SoundDesc.cs │ ├── SoundTableData.cs │ ├── SpellBase.cs │ ├── SpellComponentBase.cs │ ├── SpellSet.cs │ ├── SpellSetTier.cs │ ├── Sphere.cs │ ├── Stab.cs │ ├── StarterArea.cs │ ├── StringTableData.cs │ ├── SubPalette.cs │ ├── TMTerrainDesc.cs │ ├── TemplateCG.cs │ ├── TerrainAlphaMap.cs │ ├── TerrainDesc.cs │ ├── TerrainTex.cs │ ├── TerrainType.cs │ ├── TexMerge.cs │ ├── TextureMapChange.cs │ ├── TimeOfDay.cs │ ├── TreeNode.cs │ ├── UV.cs │ ├── Vertex.cs │ └── VertexArray.cs ├── Enum │ ├── DatType.cs │ ├── Facing.cs │ ├── GeneratorTickMode.cs │ ├── MapViewerMode.cs │ ├── ModelType.cs │ ├── PickType.cs │ ├── ProfilerSection.cs │ └── ViewMode.cs ├── Extensions │ ├── ColorDialogEx.cs │ ├── ColorExtensions.cs │ ├── CommandHandler.cs │ ├── FloatExtensions.cs │ ├── FrameExtensions.cs │ ├── MathExtensions.cs │ ├── MatrixExtensions.cs │ ├── MouseEx.cs │ ├── PositionExtensions.cs │ ├── QuaternionExtensions.cs │ ├── SWVertexExtensions.cs │ ├── TextBoxExtensions.cs │ ├── TextureExtensions.cs │ ├── Vector2Extensions.cs │ ├── Vector3Extensions.cs │ ├── VertexArrayExtensions.cs │ └── VertexExtensions.cs ├── FileExport.cs ├── FileTypes │ ├── Animation.cs │ ├── BadData.cs │ ├── CellLandblock.cs │ ├── CharGen.cs │ ├── ChatPoseTable.cs │ ├── ClothingTable.cs │ ├── CombatTable.cs │ ├── ContractTable.cs │ ├── DegradeInfo.cs │ ├── DidMapper.cs │ ├── DualDidMapper.cs │ ├── EnumMapper.cs │ ├── EnvCell.cs │ ├── Environment.cs │ ├── GeneratorTable.cs │ ├── GfxObj.cs │ ├── LandblockInfo.cs │ ├── MotionTable.cs │ ├── NameFilterTable.cs │ ├── ObjDesc.cs │ ├── Palette.cs │ ├── PaletteSet.cs │ ├── ParticleEmitterInfo.cs │ ├── PhysicsScript.cs │ ├── PhysicsScriptTable.cs │ ├── Region.cs │ ├── Scene.cs │ ├── SecondaryAttributeTable.cs │ ├── Setup.cs │ ├── SkillTable.cs │ ├── Sound.cs │ ├── SoundTable.cs │ ├── SpellComponentsTable.cs │ ├── SpellTable.cs │ ├── StringTable.cs │ ├── Surface.cs │ ├── SurfaceTexture.cs │ ├── TabooTable.cs │ ├── Texture.cs │ ├── WorldObject.cs │ └── XpTable.cs ├── GameView.cs ├── History.cs ├── Icons │ ├── Checkmark_16x.png │ ├── HelpApplication_16x.png │ ├── OpenFile_16x.png │ ├── Question_16x.png │ ├── Search_16x.png │ ├── Settings_16x.png │ ├── Settings_16x_inverted.png │ ├── StatusCriticalError_16x.png │ ├── about.png │ ├── armor.png │ ├── export-file.png │ ├── help.png │ ├── plume.png │ ├── portal.png │ └── question-mark.png ├── Image.cs ├── MapViewer.cs ├── Mapper.cs ├── Model │ ├── BoundingBox.cs │ ├── Face.cs │ ├── GfxObj.cs │ ├── GfxObjCache.cs │ ├── GfxObjInstance.cs │ ├── InstanceBufferStats.cs │ ├── JumpMeter.cs │ ├── LandVertex.cs │ ├── MaterialIdx.cs │ ├── Mesh.cs │ ├── ObjDesc.cs │ ├── PaletteChanges.cs │ ├── PartChange.cs │ ├── ParticleDeclaration.cs │ ├── PickResult.cs │ ├── Polygon.cs │ ├── Setup.cs │ ├── SetupCache.cs │ ├── SetupInstance.cs │ ├── VertexInstance.cs │ ├── VertexInstanceEnv.cs │ ├── VertexPositionNormalTextures.cs │ └── VertexUV.cs ├── ModelViewer.cs ├── ParticleViewer.cs ├── Physics │ ├── Animation │ │ ├── AFrame.cs │ │ ├── ActionNode.cs │ │ ├── AnimData.cs │ │ ├── AnimNode.cs │ │ ├── AnimSequenceNode.cs │ │ ├── Animation.cs │ │ ├── InterpolationNode.cs │ │ ├── InterpretedMotionState.cs │ │ ├── Motion.cs │ │ ├── MotionInterp.cs │ │ ├── MotionNode.cs │ │ ├── MotionState.cs │ │ ├── MotionTable.cs │ │ ├── MovementNode.cs │ │ ├── MovementParamFlags.cs │ │ ├── MovementParameters.cs │ │ ├── MovementStruct.cs │ │ ├── MovementSystem.cs │ │ ├── RawMotionState.cs │ │ └── Sequence.cs │ ├── BSP │ │ ├── BSPLeaf.cs │ │ ├── BSPNode.cs │ │ ├── BSPPortal.cs │ │ ├── BSPTree.cs │ │ └── PortalPoly.cs │ ├── BoundingBox.cs │ ├── Collision │ │ ├── BBox.cs │ │ ├── CollisionInfo.cs │ │ ├── CollisionRecord.cs │ │ ├── EnvCollisionProfile.cs │ │ └── ObjCollisionProfile.cs │ ├── Combat │ │ ├── AtkCollisionProfile.cs │ │ ├── AtkObjInfo.cs │ │ ├── AttackCone.cs │ │ ├── AttackInfo.cs │ │ ├── DetectionCylsphere.cs │ │ ├── DetectionInfo.cs │ │ ├── TargetInfo.cs │ │ └── TargettedVoyeurInfo.cs │ ├── Command │ │ ├── ACCmdInterp.cs │ │ ├── CmdStruct.cs │ │ ├── CommandInterpreter.cs │ │ ├── CommandList.cs │ │ ├── CommandListElement.cs │ │ └── InputEvent.cs │ ├── Common │ │ ├── AddUpdateObjs.cs │ │ ├── BldPortal.cs │ │ ├── BuildingObj.cs │ │ ├── CellArray.cs │ │ ├── CellStruct.cs │ │ ├── ChatRoomTracker.cs │ │ ├── ChildList.cs │ │ ├── DBObj.cs │ │ ├── EncumbranceSystem.cs │ │ ├── EnvCell.cs │ │ ├── GfxObj.cs │ │ ├── HookAppraisalProfile.cs │ │ ├── ImgTex.cs │ │ ├── LScape.cs │ │ ├── LandCell.cs │ │ ├── LandDefs.cs │ │ ├── LandSurf.cs │ │ ├── Landblock.cs │ │ ├── LandblockStruct.cs │ │ ├── LostCell.cs │ │ ├── MasterDBMap.cs │ │ ├── ObjCache.cs │ │ ├── ObjCell.cs │ │ ├── ObjectDesc.cs │ │ ├── ObjectMaint.cs │ │ ├── PalShift.cs │ │ ├── PalShiftRoadCode.cs │ │ ├── PalShiftSubPal.cs │ │ ├── PalShiftTerrainPal.cs │ │ ├── PalShiftTex.cs │ │ ├── Palette.cs │ │ ├── PartCell.cs │ │ ├── PhysicsTimer.cs │ │ ├── Position.cs │ │ ├── QualifiedDataID.cs │ │ ├── Random.cs │ │ ├── RegionDesc.cs │ │ ├── Render.cs │ │ ├── RenderSurface.cs │ │ ├── RoadAlphaMap.cs │ │ ├── SetPosition.cs │ │ ├── ShadowObj.cs │ │ ├── ShadowPart.cs │ │ ├── SmartBox.cs │ │ ├── SortCell.cs │ │ ├── SubPalette.cs │ │ ├── SurfInfo.cs │ │ ├── Surface.cs │ │ ├── TMTerrainDesc.cs │ │ ├── TerrainAlphaMap.cs │ │ ├── TerrainTex.cs │ │ ├── TexMerge.cs │ │ ├── TextureMergeInfo.cs │ │ ├── Vector.cs │ │ ├── Vertex.cs │ │ ├── VertexArray.cs │ │ ├── WeenieDesc.cs │ │ └── WeenieObject.cs │ ├── CylSphere.cs │ ├── Entity │ │ ├── BSPCache.cs │ │ ├── GfxObjCache.cs │ │ ├── PolygonCache.cs │ │ └── VertexCache.cs │ ├── Extensions │ │ ├── FloatExtensions.cs │ │ ├── ListExtensions.cs │ │ ├── PlaneExtensions.cs │ │ ├── QuaternionExtensions.cs │ │ ├── QueueExtensions.cs │ │ └── Vector3Extensions.cs │ ├── Hooks │ │ ├── AnimHook.cs │ │ ├── FPHook.cs │ │ ├── PhysicsHookType.cs │ │ ├── PhysicsObjHook.cs │ │ └── VectorHook.cs │ ├── Managers │ │ ├── AttackManager.cs │ │ ├── ConstraintManager.cs │ │ ├── DetectionManager.cs │ │ ├── InterpolationManager.cs │ │ ├── MotionTableManager.cs │ │ ├── MoveToManager.cs │ │ ├── MovementManager.cs │ │ ├── PositionManager.cs │ │ ├── ServerObjectManager.cs │ │ ├── StickyManager.cs │ │ └── TargetManager.cs │ ├── ObjectInfo.cs │ ├── PartArray.cs │ ├── Particles │ │ ├── Particle.cs │ │ ├── ParticleEmitter.cs │ │ ├── ParticleEmitterInfo.cs │ │ └── ParticleManager.cs │ ├── PhysObjProfile.cs │ ├── PhysicsDesc.cs │ ├── PhysicsEngine.cs │ ├── PhysicsGlobals.cs │ ├── PhysicsObj.cs │ ├── PhysicsPart.cs │ ├── Polygon.cs │ ├── Ray.cs │ ├── Scripts │ │ ├── PhysicsScript.cs │ │ ├── PhysicsScriptData.cs │ │ ├── PhysicsScriptTable.cs │ │ ├── PhysicsScriptTableData.cs │ │ ├── ScriptAndModData.cs │ │ ├── ScriptData.cs │ │ └── ScriptManager.cs │ ├── Setup.cs │ ├── Sound │ │ ├── SoundData.cs │ │ ├── SoundTable.cs │ │ └── SoundTableData.cs │ ├── Sphere.cs │ ├── SpherePath.cs │ ├── Trajectory.cs │ ├── Trajectory2.cs │ ├── Transition.cs │ └── Util │ │ ├── AdjustCell.cs │ │ ├── AdjustPos.cs │ │ ├── AdjustPosProfile.cs │ │ └── Environment.cs ├── Picker.cs ├── Player.cs ├── Primitives │ ├── CylinderPrimitive.cs │ ├── GeometricPrimitive.cs │ ├── SpherePrimitive.cs │ └── VertexPositionNormal.cs ├── Render │ ├── Billboard.cs │ ├── Buffer.cs │ ├── Camera.cs │ ├── DirectBitmap.cs │ ├── EffectParameters.cs │ ├── GfxObjInstance_Shared.cs │ ├── GfxObjTexturePalette.cs │ ├── GfxObjinstance_TextureFormat.cs │ ├── InstanceBatch.cs │ ├── InstanceBatchDraw.cs │ ├── LinkNode.cs │ ├── ParticleBatch.cs │ ├── ParticleBatchDraw.cs │ ├── ParticleTextureFormat.cs │ ├── PerfTimer.cs │ ├── PixelFormatDesc.cs │ ├── R_CellStruct.cs │ ├── R_EnvCell.cs │ ├── R_Environment.cs │ ├── R_EnvironmentCache.cs │ ├── R_GfxObj.cs │ ├── R_Landblock.cs │ ├── R_PartArray.cs │ ├── R_PhysicsObj.cs │ ├── R_PhysicsPart.cs │ ├── Render.cs │ ├── RenderLinks.cs │ ├── SurfaceTexturePalette.cs │ ├── TerrainBatch.cs │ ├── TerrainBatchDraw.cs │ ├── TextureAtlas.cs │ ├── TextureAtlasChain.cs │ ├── TextureCache.cs │ ├── TextureChanges.cs │ ├── TextureFormat.cs │ ├── TextureFormatChain.cs │ └── TextureSet.cs ├── Server.cs ├── TextureViewer.cs ├── ThemeManager.cs ├── View │ ├── About.xaml │ ├── About.xaml.cs │ ├── App.xaml │ ├── App.xaml.cs │ ├── ArmorList.xaml │ ├── ArmorList.xaml.cs │ ├── ClothingTableList.xaml │ ├── ClothingTableList.xaml.cs │ ├── FileExplorer.xaml │ ├── FileExplorer.xaml.cs │ ├── FileInfo.xaml │ ├── FileInfo.xaml.cs │ ├── Finder.xaml │ ├── Finder.xaml.cs │ ├── MainMenu.xaml │ ├── MainMenu.xaml.cs │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── MotionList.xaml │ ├── MotionList.xaml.cs │ ├── Options.xaml │ ├── Options.xaml.cs │ ├── Options_MapViewer.xaml │ ├── Options_MapViewer.xaml.cs │ ├── ParticleExplorer.xaml │ ├── ParticleExplorer.xaml.cs │ ├── PasswordHelper.cs │ ├── ScriptList.xaml │ ├── ScriptList.xaml.cs │ ├── Teleport.xaml │ ├── Teleport.xaml.cs │ ├── Themes │ │ ├── Attached │ │ │ ├── CornerRadiusHelper.cs │ │ │ ├── MenuHelper.cs │ │ │ ├── PasswordBoxHelper.cs │ │ │ ├── TextBoxAutoSelect.cs │ │ │ └── TextHinting.cs │ │ ├── ColorDictionaries │ │ │ ├── DarkGreyTheme.xaml │ │ │ ├── DeepDarkTheme.xaml │ │ │ ├── GreyTheme.xaml │ │ │ ├── LightTheme.xaml │ │ │ └── SoftDarkTheme.xaml │ │ ├── ControlColors.xaml │ │ ├── Controls.xaml │ │ ├── Controls.xaml.cs │ │ └── credit.md │ ├── VirindiColorTool.xaml │ ├── VirindiColorTool.xaml.cs │ ├── ucSpinnerApple.xaml │ └── ucSpinnerApple.xaml.cs ├── ViewObject.cs ├── WorldObjectViewer.cs └── WorldViewer.cs ├── LICENSE ├── README.md ├── appveyor.yml ├── build ├── init.bat ├── merge.bat └── update.bat └── docs ├── images ├── ACViewer.png ├── Armor.png ├── ClothingBase.png ├── FileInfo.png ├── FileType.png ├── Open.png ├── OpenFile.png ├── SelectFile.png ├── ViewMenu.png ├── VirindiColorTool.png ├── VtankLootEditor.png ├── WorldMap.png ├── WorldMap_SelectRange.png ├── WorldMap_Zoom.png ├── op-house.png ├── op.png └── yaraq.png └── index.html /.gitignore: -------------------------------------------------------------------------------- 1 | .vs/ 2 | bin/ 3 | obj/ 4 | *.user 5 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ACE"] 2 | path = ACE 3 | url = https://github.com/ACEmulator/ACE.git 4 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/Entity/HeldItem.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity.Enum; 2 | 3 | namespace ACE.Server.Entity 4 | { 5 | /// 6 | /// This Class is used to add children 7 | /// 8 | public class HeldItem 9 | { 10 | public uint Guid { get; } 11 | 12 | public int LocationId { get; } 13 | 14 | public EquipMask EquipMask { get; } 15 | 16 | public HeldItem(uint guid, int locationId, EquipMask equipmask) 17 | { 18 | Guid = guid; 19 | EquipMask = equipmask; 20 | LocationId = locationId; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/Entity/Mesh.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Numerics; 3 | 4 | namespace ACE.Server.Entity 5 | { 6 | /// 7 | /// A 3D mesh of vertices and triangles 8 | /// Used for collision detection and physics simulation 9 | /// 10 | public class Mesh 11 | { 12 | /// 13 | /// The list of vertices comprising the mesh 14 | /// 15 | public List Vertices; 16 | 17 | /// 18 | /// The list of triangles comprising the mesh 19 | /// 20 | public List Triangles; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/Entity/ProjectileSpellType.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Entity 2 | { 3 | /// 4 | /// Custom server enum 5 | /// Maps to Spell.Category 6 | /// 7 | public enum ProjectileSpellType 8 | { 9 | Undef, 10 | Bolt, 11 | Blast, 12 | Volley, 13 | Streak, 14 | Arc, 15 | Ring, 16 | Wall, 17 | Strike 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/Managers/GuidManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using ACE.Entity; 4 | 5 | namespace ACE.Server.Managers 6 | { 7 | /// 8 | /// Used to assign global guids and ensure they are unique to server. 9 | /// 10 | public static class GuidManager 11 | { 12 | private static uint nextDynamicGuid = 0x80000000; 13 | 14 | /// 15 | /// These represent items are generated in the world. 16 | /// Some of them will be saved to the Shard db. 17 | /// They can be monsters, loot, etc.. 18 | /// 19 | public static ObjectGuid NewDynamicGuid() 20 | { 21 | return new ObjectGuid(nextDynamicGuid++); 22 | } 23 | 24 | /// 25 | /// Guid will be added to the recycle queue, and available for use in GuidAllocator.recycleTime 26 | /// 27 | /// 28 | public static void RecycleDynamicGuid(ObjectGuid guid) 29 | { 30 | //dynamicAlloc.Recycle(guid.Full); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/Managers/RecipeManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using ACE.DatLoader; 4 | using ACE.DatLoader.FileTypes; 5 | using ACE.Entity.Enum; 6 | 7 | namespace ACE.Server.Managers 8 | { 9 | public partial class RecipeManager 10 | { 11 | public static uint MaterialDualDID = 0x27000000; 12 | 13 | public static string GetMaterialName(MaterialType materialType) 14 | { 15 | var dualDIDs = DatManager.PortalDat.ReadFromDat(MaterialDualDID); 16 | 17 | if (!dualDIDs.ClientEnumToName.TryGetValue((uint)materialType, out var materialName)) 18 | { 19 | Console.WriteLine($"RecipeManager.GetMaterialName({materialType}): couldn't find material name"); 20 | return materialType.ToString(); 21 | } 22 | return materialName.Replace("_", " "); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/AdvocateFane.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Models; 3 | 4 | namespace ACE.Server.WorldObjects 5 | { 6 | public class AdvocateFane : WorldObject 7 | { 8 | /// 9 | /// A new biota be created taking all of its values from weenie. 10 | /// 11 | public AdvocateFane(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 12 | { 13 | SetEphemeralValues(); 14 | } 15 | 16 | /// 17 | /// Restore a WorldObject from the database. 18 | /// 19 | public AdvocateFane(Biota biota) : base(biota) 20 | { 21 | SetEphemeralValues(); 22 | } 23 | 24 | private void SetEphemeralValues() 25 | { 26 | //CurrentMotionState = new Motion(MotionStance.NonCombat); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/AdvocateItem.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Models; 3 | 4 | namespace ACE.Server.WorldObjects 5 | { 6 | public class AdvocateItem : GenericObject 7 | { 8 | /// 9 | /// A new biota be created taking all of its values from weenie. 10 | /// 11 | public AdvocateItem(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 12 | { 13 | SetEphemeralValues(); 14 | } 15 | 16 | /// 17 | /// Restore a WorldObject from the database. 18 | /// 19 | public AdvocateItem(Biota biota) : base(biota) 20 | { 21 | SetEphemeralValues(); 22 | } 23 | 24 | private void SetEphemeralValues() 25 | { 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Ammunition.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Models; 3 | 4 | namespace ACE.Server.WorldObjects 5 | { 6 | public class Ammunition : Stackable 7 | { 8 | /// 9 | /// A new biota be created taking all of its values from weenie. 10 | /// 11 | public Ammunition(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 12 | { 13 | SetEphemeralValues(); 14 | } 15 | 16 | /// 17 | /// Restore a WorldObject from the database. 18 | /// 19 | public Ammunition(Biota biota) : base(biota) 20 | { 21 | SetEphemeralValues(); 22 | } 23 | 24 | private void SetEphemeralValues() 25 | { 26 | } 27 | 28 | public override void OnCollideObject(WorldObject target) 29 | { 30 | //ProjectileCollisionHelper.OnCollideObject(this, target); 31 | } 32 | 33 | public override void OnCollideEnvironment() 34 | { 35 | //ProjectileCollisionHelper.OnCollideEnvironment(this); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Bindstone.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Enum; 3 | using ACE.Entity.Enum.Properties; 4 | using ACE.Entity.Models; 5 | 6 | namespace ACE.Server.WorldObjects 7 | { 8 | public class Bindstone : WorldObject 9 | { 10 | /// 11 | /// A new biota be created taking all of its values from weenie. 12 | /// 13 | public Bindstone(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 14 | { 15 | SetEphemeralValues(); 16 | } 17 | 18 | /// 19 | /// Restore a WorldObject from the database. 20 | /// 21 | public Bindstone(Biota biota) : base(biota) 22 | { 23 | SetEphemeralValues(); 24 | } 25 | 26 | private void SetEphemeralValues() 27 | { 28 | ObjectDescriptionFlags |= ObjectDescriptionFlag.BindStone; 29 | 30 | SetProperty(PropertyInt.ShowableOnRadar, (int)ACE.Entity.Enum.RadarBehavior.ShowAlways); 31 | SetProperty(PropertyInt.RadarBlipColor, (int)ACE.Entity.Enum.RadarColor.LifeStone); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Caster.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Models; 3 | 4 | namespace ACE.Server.WorldObjects 5 | { 6 | public class Caster : WorldObject 7 | { 8 | /// 9 | /// A new biota be created taking all of its values from weenie. 10 | /// 11 | public Caster(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 12 | { 13 | SetEphemeralValues(); 14 | } 15 | 16 | /// 17 | /// Restore a WorldObject from the database. 18 | /// 19 | public Caster(Biota biota) : base(biota) 20 | { 21 | SetEphemeralValues(); 22 | } 23 | 24 | private void SetEphemeralValues() 25 | { 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Coin.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Models; 3 | 4 | namespace ACE.Server.WorldObjects 5 | { 6 | public class Coin : Stackable 7 | { 8 | /// 9 | /// A new biota be created taking all of its values from weenie. 10 | /// 11 | public Coin(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 12 | { 13 | SetEphemeralValues(); 14 | } 15 | 16 | /// 17 | /// Restore a WorldObject from the database. 18 | /// 19 | public Coin(Biota biota) : base(biota) 20 | { 21 | SetEphemeralValues(); 22 | } 23 | 24 | private void SetEphemeralValues() 25 | { 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/CombatPet.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Models; 3 | 4 | namespace ACE.Server.WorldObjects 5 | { 6 | /// 7 | /// Summonable monsters combat AI 8 | /// 9 | public partial class CombatPet : Pet 10 | { 11 | /// 12 | /// A new biota be created taking all of its values from weenie. 13 | /// 14 | public CombatPet(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 15 | { 16 | SetEphemeralValues(); 17 | } 18 | 19 | /// 20 | /// Restore a WorldObject from the database. 21 | /// 22 | public CombatPet(Biota biota) : base(biota) 23 | { 24 | SetEphemeralValues(); 25 | } 26 | 27 | private void SetEphemeralValues() 28 | { 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Cow.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Models; 3 | 4 | namespace ACE.Server.WorldObjects 5 | { 6 | public class Cow : Creature 7 | { 8 | /// 9 | /// A new biota be created taking all of its values from weenie. 10 | /// 11 | public Cow(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 12 | { 13 | SetEphemeralValues(); 14 | } 15 | 16 | /// 17 | /// Restore a WorldObject from the database. 18 | /// 19 | public Cow(Biota biota) : base(biota) 20 | { 21 | SetEphemeralValues(); 22 | } 23 | 24 | private void SetEphemeralValues() 25 | { 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/CraftTool.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Models; 3 | 4 | namespace ACE.Server.WorldObjects 5 | { 6 | public class CraftTool : Stackable 7 | { 8 | /// 9 | /// A new biota be created taking all of its values from weenie. 10 | /// 11 | public CraftTool(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 12 | { 13 | SetEphemeralValues(); 14 | } 15 | 16 | /// 17 | /// Restore a WorldObject from the database. 18 | /// 19 | public CraftTool(Biota biota) : base(biota) 20 | { 21 | SetEphemeralValues(); 22 | } 23 | 24 | private void SetEphemeralValues() 25 | { 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Creature_Attributes.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using ACE.Entity.Enum.Properties; 4 | using ACE.Server.WorldObjects.Entity; 5 | 6 | namespace ACE.Server.WorldObjects 7 | { 8 | partial class Creature 9 | { 10 | public readonly Dictionary Attributes = new Dictionary(); 11 | 12 | public CreatureAttribute Strength => Attributes[PropertyAttribute.Strength]; 13 | public CreatureAttribute Endurance => Attributes[PropertyAttribute.Endurance]; 14 | public CreatureAttribute Coordination => Attributes[PropertyAttribute.Coordination]; 15 | public CreatureAttribute Quickness => Attributes[PropertyAttribute.Quickness]; 16 | public CreatureAttribute Focus => Attributes[PropertyAttribute.Focus]; 17 | public CreatureAttribute Self => Attributes[PropertyAttribute.Self]; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Creature_Combat.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity.Enum; 2 | 3 | namespace ACE.Server.WorldObjects 4 | { 5 | partial class Creature 6 | { 7 | /// 8 | /// The list of combat maneuvers performable by this creature 9 | /// 10 | public DatLoader.FileTypes.CombatManeuverTable CombatTable { get; set; } 11 | 12 | public CombatMode CombatMode { get; protected set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Creature_Vitals.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using ACE.Entity.Enum.Properties; 4 | using ACE.Server.WorldObjects.Entity; 5 | 6 | namespace ACE.Server.WorldObjects 7 | { 8 | partial class Creature 9 | { 10 | public readonly Dictionary Vitals = new Dictionary(); 11 | 12 | public CreatureVital Health => Vitals[PropertyAttribute2nd.MaxHealth]; 13 | public CreatureVital Stamina => Vitals[PropertyAttribute2nd.MaxStamina]; 14 | public CreatureVital Mana => Vitals[PropertyAttribute2nd.MaxMana]; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Food.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Enum; 3 | using ACE.Entity.Models; 4 | 5 | namespace ACE.Server.WorldObjects 6 | { 7 | public class Food : Stackable 8 | { 9 | /// 10 | /// A new biota be created taking all of its values from weenie. 11 | /// 12 | public Food(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 13 | { 14 | SetEphemeralValues(); 15 | } 16 | 17 | /// 18 | /// Restore a WorldObject from the database. 19 | /// 20 | public Food(Biota biota) : base(biota) 21 | { 22 | SetEphemeralValues(); 23 | } 24 | 25 | private void SetEphemeralValues() 26 | { 27 | ObjectDescriptionFlags |= ObjectDescriptionFlag.Food; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Game.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Models; 3 | 4 | namespace ACE.Server.WorldObjects 5 | { 6 | /// 7 | /// Represents a chessboard in game 8 | /// 9 | public class Game : WorldObject 10 | { 11 | /// 12 | /// A new biota be created taking all of its values from weenie. 13 | /// 14 | public Game(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 15 | { 16 | SetEphemeralValues(); 17 | } 18 | 19 | /// 20 | /// Restore a WorldObject from the database. 21 | /// 22 | public Game(Biota biota) : base(biota) 23 | { 24 | SetEphemeralValues(); 25 | } 26 | 27 | private void SetEphemeralValues() 28 | { 29 | UseRadius = 6.5f; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/GamePiece.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Models; 3 | 4 | namespace ACE.Server.WorldObjects 5 | { 6 | public class GamePiece : Creature 7 | { 8 | /// 9 | /// A new biota be created taking all of its values from weenie. 10 | /// 11 | public GamePiece(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 12 | { 13 | SetEphemeralValues(); 14 | } 15 | 16 | /// 17 | /// Restore a WorldObject from the database. 18 | /// 19 | public GamePiece(Biota biota) : base(biota) 20 | { 21 | SetEphemeralValues(); 22 | } 23 | 24 | private void SetEphemeralValues() 25 | { 26 | TimeToRot = -1; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Gem.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Models; 3 | 4 | namespace ACE.Server.WorldObjects 5 | { 6 | public class Gem : Stackable 7 | { 8 | /// 9 | /// A new biota be created taking all of its values from weenie. 10 | /// 11 | public Gem(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 12 | { 13 | SetEphemeralValues(); 14 | } 15 | 16 | /// 17 | /// Restore a WorldObject from the database. 18 | /// 19 | public Gem(Biota biota) : base(biota) 20 | { 21 | SetEphemeralValues(); 22 | } 23 | 24 | private void SetEphemeralValues() 25 | { 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Healer.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Enum; 3 | using ACE.Entity.Models; 4 | 5 | namespace ACE.Server.WorldObjects 6 | { 7 | public class Healer : WorldObject 8 | { 9 | // TODO: change structure / maxstructure to int, 10 | // cast to ushort at network level 11 | public ushort? UsesLeft 12 | { 13 | get => Structure; 14 | set => Structure = value; 15 | } 16 | 17 | /// 18 | /// A new biota be created taking all of its values from weenie. 19 | /// 20 | public Healer(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 21 | { 22 | SetEphemeralValues(); 23 | } 24 | 25 | /// 26 | /// Restore a WorldObject from the database. 27 | /// 28 | public Healer(Biota biota) : base(biota) 29 | { 30 | SetEphemeralValues(); 31 | } 32 | 33 | private void SetEphemeralValues() 34 | { 35 | ObjectDescriptionFlags |= ObjectDescriptionFlag.Healer; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Lifestone.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Enum; 3 | using ACE.Entity.Models; 4 | 5 | namespace ACE.Server.WorldObjects 6 | { 7 | public class Lifestone : WorldObject 8 | { 9 | /// 10 | /// A new biota be created taking all of its values from weenie. 11 | /// 12 | public Lifestone(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 13 | { 14 | SetEphemeralValues(); 15 | } 16 | 17 | /// 18 | /// Restore a WorldObject from the database. 19 | /// 20 | public Lifestone(Biota biota) : base(biota) 21 | { 22 | SetEphemeralValues(); 23 | } 24 | 25 | private void SetEphemeralValues() 26 | { 27 | ObjectDescriptionFlags |= ObjectDescriptionFlag.LifeStone; 28 | 29 | RadarColor = ACE.Entity.Enum.RadarColor.LifeStone; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/LightSource.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Models; 3 | 4 | namespace ACE.Server.WorldObjects 5 | { 6 | public class LightSource : GenericObject 7 | { 8 | /// 9 | /// A new biota be created taking all of its values from weenie. 10 | /// 11 | public LightSource(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 12 | { 13 | SetEphemeralValues(); 14 | } 15 | 16 | /// 17 | /// Restore a WorldObject from the database. 18 | /// 19 | public LightSource(Biota biota) : base(biota) 20 | { 21 | SetEphemeralValues(); 22 | } 23 | 24 | private void SetEphemeralValues() 25 | { 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Lockpick.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Enum; 3 | using ACE.Entity.Models; 4 | 5 | namespace ACE.Server.WorldObjects 6 | { 7 | public class Lockpick : WorldObject 8 | { 9 | /// 10 | /// A new biota be created taking all of its values from weenie. 11 | /// 12 | public Lockpick(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 13 | { 14 | SetEphemeralValues(); 15 | } 16 | 17 | /// 18 | /// Restore a WorldObject from the database. 19 | /// 20 | public Lockpick(Biota biota) : base(biota) 21 | { 22 | SetEphemeralValues(); 23 | } 24 | 25 | private void SetEphemeralValues() 26 | { 27 | ObjectDescriptionFlags |= ObjectDescriptionFlag.Lockpick; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/MeleeWeapon.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Models; 3 | 4 | namespace ACE.Server.WorldObjects 5 | { 6 | public class MeleeWeapon : WorldObject 7 | { 8 | /// 9 | /// A new biota be created taking all of its values from weenie. 10 | /// 11 | public MeleeWeapon(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 12 | { 13 | SetEphemeralValues(); 14 | } 15 | 16 | /// 17 | /// Restore a WorldObject from the database. 18 | /// 19 | public MeleeWeapon(Biota biota) : base(biota) 20 | { 21 | SetEphemeralValues(); 22 | } 23 | 24 | private void SetEphemeralValues() 25 | { 26 | //CurrentMotionState = null; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Missile.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Models; 3 | 4 | namespace ACE.Server.WorldObjects 5 | { 6 | public class Missile : Stackable 7 | { 8 | /// 9 | /// A new biota be created taking all of its values from weenie. 10 | /// 11 | public Missile(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 12 | { 13 | SetEphemeralValues(); 14 | } 15 | 16 | /// 17 | /// Restore a WorldObject from the database. 18 | /// 19 | public Missile(Biota biota) : base(biota) 20 | { 21 | SetEphemeralValues(); 22 | } 23 | 24 | private void SetEphemeralValues() 25 | { 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/MissileLauncher.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Models; 3 | 4 | namespace ACE.Server.WorldObjects 5 | { 6 | public class MissileLauncher : WorldObject 7 | { 8 | /// 9 | /// A new biota be created taking all of its values from weenie. 10 | /// 11 | public MissileLauncher(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 12 | { 13 | SetEphemeralValues(); 14 | } 15 | 16 | /// 17 | /// Restore a WorldObject from the database. 18 | /// 19 | public MissileLauncher(Biota biota) : base(biota) 20 | { 21 | SetEphemeralValues(); 22 | } 23 | 24 | private void SetEphemeralValues() 25 | { 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Monster_Combat.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity.Enum; 2 | using ACE.Entity.Enum.Properties; 3 | 4 | namespace ACE.Server.WorldObjects 5 | { 6 | /// 7 | /// Monster combat general functions 8 | /// 9 | partial class Creature 10 | { 11 | /// 12 | /// Returns true if monster is dead 13 | /// 14 | public bool IsDead => Health.Current <= 0; 15 | 16 | public CombatStyle AiAllowedCombatStyle 17 | { 18 | get => (CombatStyle)(GetProperty(PropertyInt.AiAllowedCombatStyle) ?? 0); 19 | set { if (value == 0) RemoveProperty(PropertyInt.AiAllowedCombatStyle); else SetProperty(PropertyInt.AiAllowedCombatStyle, (int)value); } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Monster_Properties.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity.Enum.Properties; 2 | 3 | namespace ACE.Server.WorldObjects 4 | { 5 | /// 6 | /// Monster-specific properties 7 | /// 8 | partial class Creature 9 | { 10 | public int AiOptions 11 | { 12 | get => GetProperty(PropertyInt.AiOptions) ?? 0; 13 | set { if (value == 0) RemoveProperty(PropertyInt.AiOptions); else SetProperty(PropertyInt.AiOptions, value); } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Pet.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Enum; 3 | using ACE.Entity.Models; 4 | 5 | namespace ACE.Server.WorldObjects 6 | { 7 | /// 8 | /// A passive summonable creature 9 | /// 10 | public class Pet : Creature 11 | { 12 | /// 13 | /// A new biota be created taking all of its values from weenie. 14 | /// 15 | public Pet(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 16 | { 17 | SetEphemeralValues(); 18 | } 19 | 20 | /// 21 | /// Restore a WorldObject from the database. 22 | /// 23 | public Pet(Biota biota) : base(biota) 24 | { 25 | SetEphemeralValues(); 26 | } 27 | 28 | private void SetEphemeralValues() 29 | { 30 | Ethereal = true; 31 | RadarBehavior = ACE.Entity.Enum.RadarBehavior.ShowNever; 32 | ItemUseable = Usable.No; 33 | 34 | SuppressGenerateEffect = true; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Player_Combat.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity.Enum; 2 | 3 | namespace ACE.Server.WorldObjects 4 | { 5 | partial class Player 6 | { 7 | public bool IsPKType => PlayerKillerStatus == PlayerKillerStatus.PK || PlayerKillerStatus == PlayerKillerStatus.PKLite; 8 | 9 | public bool IsPK => PlayerKillerStatus == PlayerKillerStatus.PK; 10 | 11 | public bool IsPKL => PlayerKillerStatus == PlayerKillerStatus.PKLite; 12 | 13 | public bool IsNPK => PlayerKillerStatus == PlayerKillerStatus.NPK; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Player_Commerce.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity.Enum; 2 | 3 | namespace ACE.Server.WorldObjects 4 | { 5 | partial class Player 6 | { 7 | private void UpdateCoinValue(bool sendUpdateMessageIfChanged = true) 8 | { 9 | int coins = 0; 10 | 11 | foreach (var coinStack in GetInventoryItemsOfTypeWeenieType(WeenieType.Coin)) 12 | coins += coinStack.Value ?? 0; 13 | 14 | if (sendUpdateMessageIfChanged && CoinValue == coins) 15 | sendUpdateMessageIfChanged = false; 16 | 17 | CoinValue = coins; 18 | 19 | //if (sendUpdateMessageIfChanged) 20 | //Session.Network.EnqueueSend(new GameMessagePrivateUpdatePropertyInt(this, PropertyInt.CoinValue, CoinValue ?? 0)); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Player_Database.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.WorldObjects 2 | { 3 | partial class Player 4 | { 5 | /// 6 | /// This variable is set to true when a change is made, and set to false before a save is requested. 7 | /// The primary use for this is to trigger save on add/modify/remove of properties. 8 | /// 9 | public bool CharacterChangesDetected { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/Scroll.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity; 2 | using ACE.Entity.Models; 3 | 4 | namespace ACE.Server.WorldObjects 5 | { 6 | public class Scroll : WorldObject 7 | { 8 | public Server.Entity.Spell Spell; 9 | 10 | /// 11 | /// A new biota be created taking all of its values from weenie. 12 | /// 13 | public Scroll(Weenie weenie, ObjectGuid guid) : base(weenie, guid) 14 | { 15 | SetEphemeralValues(); 16 | } 17 | 18 | /// 19 | /// Restore a WorldObject from the database. 20 | /// 21 | public Scroll(Biota biota) : base(biota) 22 | { 23 | SetEphemeralValues(); 24 | } 25 | 26 | private void SetEphemeralValues() 27 | { 28 | if (SpellDID != null) 29 | Spell = new Server.Entity.Spell(SpellDID.Value, false); 30 | 31 | if (Spell != null) 32 | LongDesc = $"Inscribed spell: {Spell.Name}\n{Spell.Description}"; 33 | 34 | Use = "Use this item to attempt to learn its spell."; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/WorldObject_Links.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using ACE.Database.Models.World; 5 | 6 | namespace ACE.Server.WorldObjects 7 | { 8 | partial class WorldObject 9 | { 10 | public List LinkedInstances { get; set; } = new List(); 11 | 12 | public WorldObject ParentLink { get; set; } 13 | public List ChildLinks { get; set; } = new List(); 14 | 15 | public virtual void SetLinkProperties(WorldObject wo) 16 | { 17 | // empty base 18 | Console.WriteLine($"{Name}.SetLinkProperties({wo.Name}) called for unknown parent type: {WeenieType}"); 19 | } 20 | 21 | public virtual void UpdateLinkProperties(WorldObject wo) 22 | { 23 | // empty base 24 | Console.WriteLine($"{Name}.UpdateLinkProperties({wo.Name}) called for unknown parent type: {WeenieType}"); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ACViewer/ACE.Server/WorldObjects/WorldObject_Tick.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.WorldObjects 2 | { 3 | partial class WorldObject 4 | { 5 | /// 6 | /// A value of Double.MaxValue indicates that there is no NextGeneratorRegeneration 7 | /// 8 | public double NextGeneratorRegenerationTime; 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ACViewer/ActionCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Input; 3 | 4 | public class ActionCommand : ICommand 5 | { 6 | private readonly Action _action; 7 | 8 | public ActionCommand(Action action) 9 | { 10 | _action = action; 11 | } 12 | 13 | public void Execute(object parameter) 14 | { 15 | _action(); 16 | } 17 | 18 | public bool CanExecute(object parameter) 19 | { 20 | return true; 21 | } 22 | 23 | public event EventHandler CanExecuteChanged { add {} remove {} } 24 | } 25 | -------------------------------------------------------------------------------- /ACViewer/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ACViewer/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | [assembly: ThemeInfo( 4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 5 | //(used if a resource is not found in the page, 6 | // or application resource dictionaries) 7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 8 | //(used if a resource is not found in the page, 9 | // app, or any theme specific resource dictionaries) 10 | )] 11 | -------------------------------------------------------------------------------- /ACViewer/Config/Config.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Config 2 | { 3 | public class Config 4 | { 5 | public string ACFolder { get; set; } 6 | public bool AutomaticallyLoadDATsOnStartup { get; set; } 7 | public Database Database { get; set; } = new Database(); 8 | public Toggles Toggles { get; set; } = new Toggles(); 9 | public MapViewerOptions MapViewer { get; set; } = new MapViewerOptions(); 10 | public BackgroundColors BackgroundColors { get; set; } = new BackgroundColors(); 11 | public string Theme { get; set; } 12 | public Mouse Mouse { get; set; } = new Mouse(); 13 | public WindowPos WindowPos { get; set; } = new WindowPos(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ACViewer/Config/Database.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Config 2 | { 3 | public class Database 4 | { 5 | public string Host { get; set; } 6 | public int Port { get; set; } 7 | public string DatabaseName { get; set; } 8 | public string Username { get; set; } 9 | public string Password { get; set; } 10 | 11 | public Database() 12 | { 13 | // defaults 14 | Host = "127.0.0.1"; 15 | Port = 3306; 16 | DatabaseName = "ace_world"; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ACViewer/Config/MapViewerOptions.cs: -------------------------------------------------------------------------------- 1 | using ACViewer.Enum; 2 | 3 | namespace ACViewer.Config 4 | { 5 | public class MapViewerOptions 6 | { 7 | public MapViewerMode Mode { get; set; } 8 | public bool EnableZSlicing { get; set; } = false; 9 | public int CurrentZLevel { get; set; } = 1; 10 | public float LevelHeight { get; set; } = 10.0f; 11 | 12 | public MapViewerOptions() 13 | { 14 | // defaults 15 | Mode = MapViewerMode.PreGenerated; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ACViewer/Config/Mouse.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Config 2 | { 3 | public class Mouse 4 | { 5 | public float Speed { get; set; } 6 | public bool AltMethod { get; set; } 7 | 8 | public Mouse() 9 | { 10 | // defaults 11 | Speed = 3.0f; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ACViewer/Config/Toggles.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Config 2 | { 3 | public class Toggles 4 | { 5 | public bool UseMipMaps { get; set; } 6 | public bool ShowHUD { get; set; } 7 | public bool ShowParticles { get; set; } 8 | public bool LoadInstances { get; set; } 9 | public bool LoadEncounters { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ACViewer/Config/WindowPos.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Config 2 | { 3 | public class WindowPos 4 | { 5 | public int X { get; set; } 6 | public int Y { get; set; } 7 | public int Width { get; set; } 8 | public int Height { get; set; } 9 | public int VSplit { get; set; } 10 | public int HSplit { get; set; } 11 | public bool IsMaximized { get; set; } 12 | 13 | public WindowPos() 14 | { 15 | // defaults 16 | X = int.MinValue; 17 | Y = int.MinValue; 18 | Width = 1342; 19 | Height = 798; 20 | VSplit = 360; 21 | HSplit = 67; 22 | IsMaximized = false; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACViewer/Content/Content.mgcb: -------------------------------------------------------------------------------- 1 | 2 | #----------------------------- Global Properties ----------------------------# 3 | 4 | /outputDir:bin/$(Platform) 5 | /intermediateDir:obj/$(Platform) 6 | /platform:Windows 7 | /config: 8 | /profile:Reach 9 | /compress:False 10 | 11 | #-------------------------------- References --------------------------------# 12 | 13 | 14 | #---------------------------------- Content ---------------------------------# 15 | 16 | #begin Fonts/Consolas.spritefont 17 | /importer:FontDescriptionImporter 18 | /processor:FontDescriptionProcessor 19 | /processorParam:PremultiplyAlpha=True 20 | /processorParam:TextureFormat=Color 21 | /build:Fonts/Consolas.spritefont 22 | 23 | -------------------------------------------------------------------------------- /ACViewer/Content/Fonts/Consolas.xnb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Content/Fonts/Consolas.xnb -------------------------------------------------------------------------------- /ACViewer/Content/Fonts/password.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Content/Fonts/password.ttf -------------------------------------------------------------------------------- /ACViewer/Content/Images/highres-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Content/Images/highres-color.png -------------------------------------------------------------------------------- /ACViewer/Content/Images/highres.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Content/Images/highres.png -------------------------------------------------------------------------------- /ACViewer/Content/build.bat: -------------------------------------------------------------------------------- 1 | mgfxc %1.fx %1.mgfxo /Profile:DirectX_11 -------------------------------------------------------------------------------- /ACViewer/Content/build_debug.bat: -------------------------------------------------------------------------------- 1 | mgfxc %1.fx %1.mgfxo /Debug /Profile:DirectX_11 2 | copy %1.fx %1.fx.28_1.hlsl -------------------------------------------------------------------------------- /ACViewer/Content/texture.mgfxo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Content/texture.mgfxo -------------------------------------------------------------------------------- /ACViewer/Content/texture_clamp.mgfxo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Content/texture_clamp.mgfxo -------------------------------------------------------------------------------- /ACViewer/Data/DIDTable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ACViewer.Data 4 | { 5 | public class DIDTable: IEquatable 6 | { 7 | public uint SetupID { get; set; } 8 | public uint MotionTableID { get; set; } 9 | public uint SoundTableID { get; set; } 10 | public uint CombatTableID { get; set; } 11 | 12 | public DIDTable() { } 13 | 14 | public DIDTable(uint setupID) 15 | { 16 | SetupID = setupID; 17 | } 18 | 19 | public bool Equals(DIDTable table) 20 | { 21 | return SetupID.Equals(table.SetupID); 22 | } 23 | 24 | public override int GetHashCode() 25 | { 26 | return SetupID.GetHashCode(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ACViewer/Data/LootItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ACViewer.Data 8 | { 9 | public class LootItem : IEquatable 10 | { 11 | public uint WCID { get; set; } 12 | public string Name { get; set; } 13 | public string ClothingBase { get; set; } 14 | public uint PaletteTemplate { get; set; } 15 | public float Shade{ get; set; } 16 | 17 | public LootItem() { } 18 | 19 | public LootItem(uint wcid) 20 | { 21 | WCID = wcid; 22 | } 23 | 24 | public bool Equals(LootItem table) 25 | { 26 | return WCID.Equals(table.WCID); 27 | } 28 | 29 | public override int GetHashCode() 30 | { 31 | return WCID.GetHashCode(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ACViewer/Data/TeleportLocationType.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Data 2 | { 3 | public enum TeleportLocationType 4 | { 5 | Undef, 6 | Town, 7 | Dungeon, 8 | POI 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ACViewer/Data/TeleportRow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ACViewer.Data 4 | { 5 | public class TeleportRow 6 | { 7 | public string Name { get; set; } 8 | public string Type { get; set; } 9 | public string Location { get; set; } 10 | 11 | public TeleportLocationType LocationType { get; set; } 12 | 13 | public TeleportRow() { } 14 | 15 | public TeleportRow(string name, string type, string location) 16 | { 17 | Name = name; 18 | Type = type; 19 | Location = location; 20 | 21 | if (System.Enum.TryParse(type, out TeleportLocationType locationType)) 22 | LocationType = locationType; 23 | } 24 | 25 | public bool Contains(string str) 26 | { 27 | return Name.IndexOf(str, StringComparison.OrdinalIgnoreCase) != -1 28 | || Type.IndexOf(str, StringComparison.OrdinalIgnoreCase) != -1 29 | || Location.IndexOf(str, StringComparison.OrdinalIgnoreCase) != -1; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ACViewer/Entity/AmbientSoundDesc.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using ACE.Entity.Enum; 4 | 5 | namespace ACViewer.Entity 6 | { 7 | public class AmbientSoundDesc 8 | { 9 | public ACE.DatLoader.Entity.AmbientSoundDesc _soundDesc; 10 | 11 | public AmbientSoundDesc(ACE.DatLoader.Entity.AmbientSoundDesc soundDesc) 12 | { 13 | _soundDesc = soundDesc; 14 | } 15 | 16 | public List BuildTree() 17 | { 18 | var soundType = new TreeNode($"SoundType: {(Sound)_soundDesc.SType}"); 19 | var volume = new TreeNode($"Volume: {_soundDesc.Volume}"); 20 | var baseChance = new TreeNode($"BaseChance: {_soundDesc.BaseChance}"); 21 | var minRate = new TreeNode($"MinRate: {_soundDesc.MinRate}"); 22 | var maxRate = new TreeNode($"MaxRate: {_soundDesc.MaxRate}"); 23 | 24 | return new List() { soundType, volume, baseChance, minRate, maxRate }; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ACViewer/Entity/AmbientSoundTableDesc.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class AmbientSoundTableDesc 6 | { 7 | public ACE.DatLoader.Entity.AmbientSTBDesc _stbDesc; 8 | 9 | public AmbientSoundTableDesc(ACE.DatLoader.Entity.AmbientSTBDesc stbDesc) 10 | { 11 | _stbDesc = stbDesc; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var ambientSoundTableID = new TreeNode($"Ambient Sound Table ID: {_stbDesc.STBId:X8}", clickable: true); 17 | 18 | var ambientSounds = new TreeNode("Ambient Sounds:"); 19 | for (var i = 0; i < _stbDesc.AmbientSounds.Count; i++) 20 | { 21 | var sound = new TreeNode($"{i}"); 22 | sound.Items.AddRange(new AmbientSoundDesc(_stbDesc.AmbientSounds[i]).BuildTree()); 23 | 24 | ambientSounds.Items.Add(sound); 25 | } 26 | return new List() { ambientSoundTableID, ambientSounds }; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class AnimData 6 | { 7 | public ACE.DatLoader.Entity.AnimData _animData; 8 | 9 | public AnimData(ACE.DatLoader.Entity.AnimData animData) 10 | { 11 | _animData = animData; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var animID = new TreeNode($"AnimID: {_animData.AnimId:X8}", clickable: true); 17 | var lowFrame = new TreeNode($"Low frame: {_animData.LowFrame}"); 18 | var highFrame = new TreeNode($"High frame: {_animData.HighFrame}"); 19 | var framerate = new TreeNode($"Framerate: {_animData.Framerate}"); 20 | 21 | return new List() { animID, lowFrame, highFrame, framerate }; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimPartChange.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class AnimPartChange 6 | { 7 | public ACE.DatLoader.Entity.AnimationPartChange _animChange; 8 | 9 | public AnimPartChange(ACE.DatLoader.Entity.AnimationPartChange animChange) 10 | { 11 | _animChange = animChange; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var partIdx = new TreeNode($"PartIdx: {_animChange.PartIndex}"); 17 | var partID = new TreeNode($"PartID: {_animChange.PartID:X8}", clickable: true); 18 | 19 | return new List() { partIdx, partID }; 20 | } 21 | 22 | public override string ToString() 23 | { 24 | return $"PartIdx: {_animChange.PartIndex}, PartID: {_animChange.PartID:X8}"; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/AttackHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class AttackHook : AnimationHook 6 | { 7 | public AttackHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.AttackHook _attackHook) 17 | { 18 | var attackCone = new AttackCone(_attackHook.AttackCone); 19 | treeNode.AddRange(attackCone.BuildTree()); 20 | } 21 | treeNode.AddRange(base.BuildTree()); 22 | 23 | return treeNode; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/CallPESHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class CallPESHook : AnimationHook 6 | { 7 | public CallPESHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.CallPESHook _callPESHook) 17 | { 18 | treeNode.Add(new TreeNode($"PES: {_callPESHook.PES:X8}", clickable: true)); 19 | treeNode.Add(new TreeNode($"Pause: {_callPESHook.Pause}")); 20 | } 21 | treeNode.AddRange(base.BuildTree()); 22 | 23 | return treeNode; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/CreateParticleHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class CreateParticleHook: AnimationHook 6 | { 7 | public CreateParticleHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.CreateParticleHook _createParticleHook) 17 | { 18 | treeNode.Add(new TreeNode($"EmitterInfoId: {_createParticleHook.EmitterInfoId:X8}", clickable: true)); 19 | treeNode.Add(new TreeNode($"PartIndex: {(int)_createParticleHook.PartIndex}")); 20 | treeNode.Add(new TreeNode($"Offset: {new Frame(_createParticleHook.Offset)}")); 21 | treeNode.Add(new TreeNode($"EmitterId: {_createParticleHook.EmitterId}")); 22 | } 23 | treeNode.AddRange(base.BuildTree()); 24 | 25 | return treeNode; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/DefaultScriptPartHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class DefaultScriptPartHook : AnimationHook 6 | { 7 | public DefaultScriptPartHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.DefaultScriptPartHook _defaultScriptPartHook) 17 | { 18 | treeNode.Add(new TreeNode($"PartIndex: {_defaultScriptPartHook.PartIndex}")); 19 | } 20 | treeNode.AddRange(base.BuildTree()); 21 | 22 | return treeNode; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/DestroyParticleHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class DestroyParticleHook : AnimationHook 6 | { 7 | public DestroyParticleHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.DestroyParticleHook _destroyParticleHook) 17 | { 18 | treeNode.Add(new TreeNode($"EmitterId: {_destroyParticleHook.EmitterId}")); 19 | } 20 | treeNode.AddRange(base.BuildTree()); 21 | 22 | return treeNode; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/DiffuseHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class DiffuseHook : AnimationHook 6 | { 7 | public DiffuseHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.DiffuseHook _diffuseHook) 17 | { 18 | treeNode.Add(new TreeNode($"Start: {_diffuseHook.Start}")); 19 | treeNode.Add(new TreeNode($"End: {_diffuseHook.End}")); 20 | treeNode.Add(new TreeNode($"Time: {_diffuseHook.Time}")); 21 | } 22 | treeNode.AddRange(base.BuildTree()); 23 | 24 | return treeNode; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/DiffusePartHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class DiffusePartHook : AnimationHook 6 | { 7 | public DiffusePartHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.DiffusePartHook _diffusePartHook) 17 | { 18 | treeNode.Add(new TreeNode($"Part: {_diffusePartHook.Part}")); 19 | treeNode.Add(new TreeNode($"Start: {_diffusePartHook.Start}")); 20 | treeNode.Add(new TreeNode($"End: {_diffusePartHook.End}")); 21 | treeNode.Add(new TreeNode($"Time: {_diffusePartHook.Time}")); 22 | } 23 | treeNode.AddRange(base.BuildTree()); 24 | 25 | return treeNode; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/EtherealHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class EtherealHook : AnimationHook 6 | { 7 | public EtherealHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.EtherealHook _etherealHook) 17 | { 18 | treeNode.Add(new TreeNode($"Ethereal: {_etherealHook.Ethereal}")); 19 | } 20 | treeNode.AddRange(base.BuildTree()); 21 | 22 | return treeNode; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/LuminousHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class LuminousHook : AnimationHook 6 | { 7 | public LuminousHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.LuminousHook _luminousHook) 17 | { 18 | treeNode.Add(new TreeNode($"Start: {_luminousHook.Start}")); 19 | treeNode.Add(new TreeNode($"End: {_luminousHook.End}")); 20 | treeNode.Add(new TreeNode($"Time: {_luminousHook.Time}")); 21 | } 22 | treeNode.AddRange(base.BuildTree()); 23 | 24 | return treeNode; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/LuminousPartHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class LuminousPartHook : AnimationHook 6 | { 7 | public LuminousPartHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.LuminousPartHook _luminousPartHook) 17 | { 18 | treeNode.Add(new TreeNode($"Part: {_luminousPartHook.Part}")); 19 | treeNode.Add(new TreeNode($"Start: {_luminousPartHook.Start}")); 20 | treeNode.Add(new TreeNode($"End: {_luminousPartHook.End}")); 21 | treeNode.Add(new TreeNode($"Time: {_luminousPartHook.Time}")); 22 | } 23 | treeNode.AddRange(base.BuildTree()); 24 | 25 | return treeNode; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/NoDrawHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class NoDrawHook : AnimationHook 6 | { 7 | public NoDrawHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.NoDrawHook _noDrawHook) 17 | { 18 | treeNode.Add(new TreeNode($"NoDraw: {_noDrawHook.NoDraw}")); 19 | } 20 | treeNode.AddRange(base.BuildTree()); 21 | 22 | return treeNode; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/ReplaceObjectHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class ReplaceObjectHook : AnimationHook 6 | { 7 | public ReplaceObjectHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.ReplaceObjectHook _replaceObjectHook) 17 | { 18 | var animPartChange = new AnimPartChange(_replaceObjectHook.APChange); 19 | treeNode.AddRange(animPartChange.BuildTree()); 20 | } 21 | treeNode.AddRange(base.BuildTree()); 22 | 23 | return treeNode; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/ScaleHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class ScaleHook : AnimationHook 6 | { 7 | public ScaleHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.ScaleHook _scaleHook) 17 | { 18 | treeNode.Add(new TreeNode($"End: {_scaleHook.End}")); 19 | treeNode.Add(new TreeNode($"Time: {_scaleHook.Time}")); 20 | } 21 | treeNode.AddRange(base.BuildTree()); 22 | 23 | return treeNode; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/SetLightHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class SetLightHook : AnimationHook 6 | { 7 | public SetLightHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.SetLightHook _setLightHook) 17 | { 18 | treeNode.Add(new TreeNode($"LightsOn: {_setLightHook.LightsOn}")); 19 | } 20 | treeNode.AddRange(base.BuildTree()); 21 | 22 | return treeNode; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/SetOmegaHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class SetOmegaHook : AnimationHook 6 | { 7 | public SetOmegaHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.SetOmegaHook _setOmegaHook) 17 | { 18 | treeNode.Add(new TreeNode($"Axis: {_setOmegaHook.Axis}")); 19 | } 20 | treeNode.AddRange(base.BuildTree()); 21 | 22 | return treeNode; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/SoundHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class SoundHook : AnimationHook 6 | { 7 | public SoundHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.SoundHook _soundHook) 17 | { 18 | treeNode.Add(new TreeNode($"Id: {_soundHook.Id:X8}")); 19 | } 20 | treeNode.AddRange(base.BuildTree()); 21 | 22 | return treeNode; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/SoundTableHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using ACE.Entity.Enum; 4 | 5 | namespace ACViewer.Entity.AnimationHooks 6 | { 7 | public class SoundTableHook : AnimationHook 8 | { 9 | public SoundTableHook(ACE.DatLoader.Entity.AnimationHook hook) 10 | : base(hook) 11 | { 12 | } 13 | 14 | public override List BuildTree() 15 | { 16 | var treeNode = new List(); 17 | 18 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.SoundTableHook _soundTableHook) 19 | { 20 | treeNode.Add(new TreeNode($"SoundType: {(Sound)_soundTableHook.SoundType}")); 21 | } 22 | treeNode.AddRange(base.BuildTree()); 23 | 24 | return treeNode; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/SoundTweakedHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class SoundTweakedHook : AnimationHook 6 | { 7 | public SoundTweakedHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.SoundTweakedHook _soundTweakedHook) 17 | { 18 | treeNode.Add(new TreeNode($"SoundID: {_soundTweakedHook.SoundID:X8}", clickable: true)); 19 | treeNode.Add(new TreeNode($"Priority: {_soundTweakedHook.Priority}")); 20 | treeNode.Add(new TreeNode($"Probability: {_soundTweakedHook.Probability}")); 21 | treeNode.Add(new TreeNode($"Volume: {_soundTweakedHook.Volume}")); 22 | } 23 | treeNode.AddRange(base.BuildTree()); 24 | 25 | return treeNode; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/StopParticleHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class StopParticleHook : AnimationHook 6 | { 7 | public StopParticleHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.StopParticleHook _stopParticleHook) 17 | { 18 | treeNode.Add(new TreeNode($"EmitterId: {_stopParticleHook.EmitterId}")); 19 | } 20 | treeNode.AddRange(base.BuildTree()); 21 | 22 | return treeNode; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/TextureVelocityHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class TextureVelocityHook : AnimationHook 6 | { 7 | public TextureVelocityHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.TextureVelocityHook _textureVelocityHook) 17 | { 18 | treeNode.Add(new TreeNode($"USpeed: {_textureVelocityHook.USpeed}")); 19 | treeNode.Add(new TreeNode($"VSpeed: {_textureVelocityHook.VSpeed}")); 20 | } 21 | treeNode.AddRange(base.BuildTree()); 22 | 23 | return treeNode; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/TextureVelocityPartHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class TextureVelocityPartHook : AnimationHook 6 | { 7 | public TextureVelocityPartHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.TextureVelocityPartHook _textureVelocityPartHook) 17 | { 18 | treeNode.Add(new TreeNode($"PartIndex: {_textureVelocityPartHook.PartIndex}")); 19 | treeNode.Add(new TreeNode($"USpeed: {_textureVelocityPartHook.USpeed}")); 20 | treeNode.Add(new TreeNode($"VSpeed: {_textureVelocityPartHook.VSpeed}")); 21 | } 22 | treeNode.AddRange(base.BuildTree()); 23 | 24 | return treeNode; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/TransparentHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class TransparentHook : AnimationHook 6 | { 7 | public TransparentHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.TransparentHook _transparentHook) 17 | { 18 | treeNode.Add(new TreeNode($"Start: {_transparentHook.Start}")); 19 | treeNode.Add(new TreeNode($"End: {_transparentHook.End}")); 20 | treeNode.Add(new TreeNode($"Time: {_transparentHook.Time}")); 21 | } 22 | treeNode.AddRange(base.BuildTree()); 23 | 24 | return treeNode; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ACViewer/Entity/AnimationHooks/TransparentPartHook.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity.AnimationHooks 4 | { 5 | public class TransparentPartHook : AnimationHook 6 | { 7 | public TransparentPartHook(ACE.DatLoader.Entity.AnimationHook hook) 8 | : base(hook) 9 | { 10 | } 11 | 12 | public override List BuildTree() 13 | { 14 | var treeNode = new List(); 15 | 16 | if (_hook is ACE.DatLoader.Entity.AnimationHooks.TransparentPartHook _transparentPartHook) 17 | { 18 | treeNode.Add(new TreeNode($"Part: {_transparentPartHook.Part}")); 19 | treeNode.Add(new TreeNode($"Start: {_transparentPartHook.Start}")); 20 | treeNode.Add(new TreeNode($"End: {_transparentPartHook.End}")); 21 | treeNode.Add(new TreeNode($"Time: {_transparentPartHook.Time}")); 22 | } 23 | treeNode.AddRange(base.BuildTree()); 24 | 25 | return treeNode; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/Entity/AttackCone.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class AttackCone 6 | { 7 | public ACE.DatLoader.Entity.AttackCone _attackCone; 8 | 9 | public AttackCone(ACE.DatLoader.Entity.AttackCone attackCone) 10 | { 11 | _attackCone = attackCone; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var treeNode = new List(); 17 | 18 | treeNode.Add(new TreeNode($"PartIndex: {_attackCone.PartIndex}")); 19 | 20 | treeNode.Add(new TreeNode($"LeftX: {_attackCone.LeftX}")); 21 | treeNode.Add(new TreeNode($"LeftY: {_attackCone.LeftY}")); 22 | 23 | treeNode.Add(new TreeNode($"RightX: {_attackCone.RightX}")); 24 | treeNode.Add(new TreeNode($"RightY: {_attackCone.RightY}")); 25 | 26 | treeNode.Add(new TreeNode($"Radius: {_attackCone.Radius}")); 27 | treeNode.Add(new TreeNode($"Height: {_attackCone.Height}")); 28 | 29 | return treeNode; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ACViewer/Entity/BSPLeaf.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using ACE.Entity.Enum; 4 | 5 | namespace ACViewer.Entity 6 | { 7 | public class BSPLeaf: BSPNode 8 | { 9 | public ACE.DatLoader.Entity.BSPLeaf _bspLeaf; 10 | 11 | public BSPLeaf(ACE.DatLoader.Entity.BSPLeaf bspLeaf) 12 | { 13 | _bspLeaf = bspLeaf; 14 | } 15 | 16 | public override List BuildTree(BSPType bspType) 17 | { 18 | var type = new TreeNode($"Type: {_bspLeaf.Type}"); 19 | var leafIdx = new TreeNode($"LeafIndex: {_bspLeaf.LeafIndex}"); 20 | 21 | var treeNode = new List() { type, leafIdx }; 22 | 23 | if (bspType == BSPType.Physics) 24 | { 25 | var solid = new TreeNode($"Solid: {_bspLeaf.Solid}"); 26 | var sphere = new TreeNode($"Sphere: {new Sphere(_bspLeaf.Sphere)}"); 27 | var inPolys = new TreeNode($"InPolys: {string.Join(", ", _bspLeaf.InPolys)}"); 28 | 29 | treeNode.AddRange(new List() { solid, sphere, inPolys }); 30 | } 31 | return treeNode; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ACViewer/Entity/BSPTree.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity.Enum; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class BSPTree 6 | { 7 | public ACE.DatLoader.Entity.BSPTree _bspTree; 8 | 9 | public BSPTree(ACE.DatLoader.Entity.BSPTree bspTree) 10 | { 11 | _bspTree = bspTree; 12 | } 13 | 14 | public TreeNode BuildTree(BSPType bspType) 15 | { 16 | var root = new TreeNode("Root"); 17 | root.Items.AddRange(new BSPNode(_bspTree.RootNode).BuildTree(bspType)); 18 | 19 | return root; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ACViewer/Entity/BldPortal.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class BldPortal 6 | { 7 | public ACE.DatLoader.Entity.CBldPortal _portal; 8 | 9 | public BldPortal(ACE.DatLoader.Entity.CBldPortal portal) 10 | { 11 | _portal = portal; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var treeNode = new List(); 17 | 18 | if (_portal.Flags != 0) 19 | { 20 | var flags = new TreeNode($"Flags: {_portal.Flags}"); 21 | treeNode.Add(flags); 22 | } 23 | 24 | if (_portal.OtherCellId != 0) 25 | { 26 | var otherCellID = new TreeNode($"OtherCellID: {_portal.OtherCellId:X}"); 27 | treeNode.Add(otherCellID); 28 | } 29 | 30 | if (_portal.OtherPortalId != 0) 31 | { 32 | var otherPortalID = new TreeNode($"OtherPortalID: {_portal.OtherPortalId:X}"); 33 | treeNode.Add(otherPortalID); 34 | } 35 | 36 | return treeNode; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ACViewer/Entity/BuildInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class BuildInfo 6 | { 7 | public ACE.DatLoader.Entity.BuildInfo _buildInfo; 8 | 9 | public BuildInfo(ACE.DatLoader.Entity.BuildInfo buildInfo) 10 | { 11 | _buildInfo = buildInfo; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var modelID = new TreeNode($"ModelID: {_buildInfo.ModelId:X8}", clickable: true); 17 | var frame = new TreeNode($"Frame: {new Frame(_buildInfo.Frame)}"); 18 | var numLeaves = new TreeNode($"NumLeaves: {_buildInfo.NumLeaves}"); 19 | 20 | var portals = new TreeNode("Portals:"); 21 | for (var i = 0; i < _buildInfo.Portals.Count; i++) 22 | { 23 | var portal = new TreeNode($"{i}"); 24 | portal.Items.AddRange(new BldPortal(_buildInfo.Portals[i]).BuildTree()); 25 | 26 | portals.Items.Add(portal); 27 | } 28 | return new List() { modelID, frame, numLeaves, portals }; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ACViewer/Entity/ChatEmoteData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class ChatEmoteData 6 | { 7 | public ACE.DatLoader.Entity.ChatEmoteData _chatEmoteData; 8 | 9 | public ChatEmoteData(ACE.DatLoader.Entity.ChatEmoteData chatEmoteData) 10 | { 11 | _chatEmoteData = chatEmoteData; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var treeNode = new List(); 17 | 18 | treeNode.Add(new TreeNode($"MyEmote: {_chatEmoteData.MyEmote}")); 19 | treeNode.Add(new TreeNode($"OtherEmote: {_chatEmoteData.OtherEmote}")); 20 | 21 | return treeNode; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ACViewer/Entity/ClothingBaseEffect.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace ACViewer.Entity 5 | { 6 | public class ClothingBaseEffect 7 | { 8 | public ACE.DatLoader.Entity.ClothingBaseEffect _baseEffect; 9 | 10 | public ClothingBaseEffect(ACE.DatLoader.Entity.ClothingBaseEffect baseEffect) 11 | { 12 | _baseEffect = baseEffect; 13 | } 14 | 15 | public List BuildTree() 16 | { 17 | var objEffects = new TreeNode($"Object Effects:"); 18 | foreach (var objEffect in _baseEffect.CloObjectEffects.OrderBy(i => i.Index)) 19 | { 20 | var objEffectTree = new ClothingObjectEffect(objEffect).BuildTree(); 21 | var objEffectNode = new TreeNode($"{objEffectTree[0].Name}"); 22 | objEffectTree.RemoveAt(0); 23 | objEffectNode.Items.AddRange(objEffectTree); 24 | objEffects.Items.Add(objEffectNode); 25 | } 26 | return new List() { objEffects }; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ACViewer/Entity/ClothingObjectEffect.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class ClothingObjectEffect 6 | { 7 | public ACE.DatLoader.Entity.CloObjectEffect _effect; 8 | 9 | public ClothingObjectEffect(ACE.DatLoader.Entity.CloObjectEffect effect) 10 | { 11 | _effect = effect; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var idx = new TreeNode($"PartIdx: {_effect.Index}"); 17 | var modelID = new TreeNode($"Model ID: {_effect.ModelId:X8}", clickable: true); 18 | 19 | var textureEffects = new TreeNode("Texture Effects:"); 20 | foreach (var textureEffect in _effect.CloTextureEffects) 21 | textureEffects.Items.Add(new TreeNode(new ClothingTextureEffect(textureEffect).ToString(), clickable: true)); 22 | 23 | return new List() { idx, modelID, textureEffects }; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ACViewer/Entity/ClothingSubPaletteEffect.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class ClothingSubPaletteEffect 6 | { 7 | public ACE.DatLoader.Entity.CloSubPalEffect _effect; 8 | 9 | public ClothingSubPaletteEffect(ACE.DatLoader.Entity.CloSubPalEffect effect) 10 | { 11 | _effect = effect; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var icon = new TreeNode($"Icon: {_effect.Icon:X8}", clickable: true); 17 | 18 | var subPalettes = new TreeNode("SubPalettes:"); 19 | foreach (var subPalette in _effect.CloSubPalettes) 20 | { 21 | var subPaletteTree = new ClothingSubPalette(subPalette).BuildTree(); 22 | var subPaletteNode = new TreeNode($"{subPaletteTree[1].Name.Replace("Palette Set: ", "")}", clickable: true); 23 | subPaletteTree.RemoveAt(1); 24 | subPaletteNode.Items.AddRange(subPaletteTree); 25 | subPalettes.Items.Add(subPaletteNode); 26 | } 27 | return new List() { icon, subPalettes }; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ACViewer/Entity/ClothingSubPaletteRange.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class ClothingSubPaletteRange 6 | { 7 | public ACE.DatLoader.Entity.CloSubPaletteRange _range; 8 | 9 | public ClothingSubPaletteRange(ACE.DatLoader.Entity.CloSubPaletteRange range) 10 | { 11 | _range = range; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var offset = new TreeNode($"Offset: {_range.Offset}"); 17 | var numColors = new TreeNode($"NumColors: {_range.NumColors}"); 18 | 19 | return new List() { offset, numColors }; 20 | } 21 | 22 | public override string ToString() 23 | { 24 | return $"Offset: {_range.Offset}, NumColors: {_range.NumColors}"; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ACViewer/Entity/ClothingTextureEffect.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Entity 2 | { 3 | public class ClothingTextureEffect 4 | { 5 | public ACE.DatLoader.Entity.CloTextureEffect _effect; 6 | 7 | public ClothingTextureEffect(ACE.DatLoader.Entity.CloTextureEffect effect) 8 | { 9 | _effect = effect; 10 | } 11 | 12 | public override string ToString() 13 | { 14 | return $"OldTex: {_effect.OldTexture:X8}, NewTex: {_effect.NewTexture:X8}"; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ACViewer/Entity/Color.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class Color 6 | { 7 | public static string ToRGBA(uint color) 8 | { 9 | // palette colors are natively stored in ARGB format 10 | var a = color >> 24; 11 | var r = (color >> 16) & 0xFF; 12 | var g = (color >> 8) & 0xFF; 13 | var b = color & 0xFF; 14 | 15 | var sb = new StringBuilder(); 16 | sb.Append($"R: {r} G: {g} B: {b}"); 17 | 18 | if (a < 255) 19 | sb.Append($" A: {a} "); 20 | 21 | return sb.ToString(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ACViewer/Entity/CylSphere.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Entity 2 | { 3 | public class CylSphere 4 | { 5 | public ACE.DatLoader.Entity.CylSphere _cylSphere; 6 | 7 | public CylSphere(ACE.DatLoader.Entity.CylSphere cylSphere) 8 | { 9 | _cylSphere = cylSphere; 10 | } 11 | 12 | public override string ToString() 13 | { 14 | return $"Origin: {_cylSphere.Origin}, Radius: {_cylSphere.Radius}, Height: {_cylSphere.Height}"; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ACViewer/Entity/FaceStripCG.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class FaceStripCG 6 | { 7 | public ACE.DatLoader.Entity.FaceStripCG _faceStrip; 8 | 9 | public FaceStripCG(ACE.DatLoader.Entity.FaceStripCG faceStrip) 10 | { 11 | _faceStrip = faceStrip; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var treeNode = new List(); 17 | 18 | if (_faceStrip.IconImage != 0) 19 | { 20 | var icon = new TreeNode($"Icon: {_faceStrip.IconImage:X8}", clickable: true); 21 | treeNode.Add(icon); 22 | } 23 | 24 | var objDesc = new TreeNode("ObjDesc:"); 25 | objDesc.Items.AddRange(new ObjDesc(_faceStrip.ObjDesc).BuildTree()); 26 | treeNode.Add(objDesc); 27 | 28 | return treeNode; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ACViewer/Entity/FileType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class FileType 6 | { 7 | public uint ID; 8 | public string Name; 9 | public string Description; 10 | public Type Type; 11 | 12 | public FileType(uint id, string name, Type t, string description = "") 13 | { 14 | ID = id; 15 | Name = name; 16 | Type = t; 17 | Description = description; 18 | } 19 | 20 | public override string ToString() 21 | { 22 | return $"0x{ID:X2} - {Name}"; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACViewer/Entity/Frame.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Entity 2 | { 3 | public class Frame 4 | { 5 | public ACE.DatLoader.Entity.Frame _frame; 6 | 7 | public Frame(ACE.DatLoader.Entity.Frame frame) 8 | { 9 | _frame = frame; 10 | } 11 | 12 | public override string ToString() 13 | { 14 | return $"{_frame.Origin} - {_frame.Orientation}"; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ACViewer/Entity/GearCG.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class GearCG 6 | { 7 | public ACE.DatLoader.Entity.GearCG _gear; 8 | 9 | public GearCG(ACE.DatLoader.Entity.GearCG gear) 10 | { 11 | _gear = gear; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var name = new TreeNode($"Name: {_gear.Name}"); 17 | var clothingTable = new TreeNode($"Clothing Table: {_gear.ClothingTable:X8}", clickable: true); 18 | var weenieDefault = new TreeNode($"Weenie Default: {_gear.WeenieDefault}"); 19 | 20 | return new List() { name, clothingTable, weenieDefault }; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ACViewer/Entity/GfxObjInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class GfxObjInfo 6 | { 7 | public ACE.DatLoader.Entity.GfxObjInfo _gfxObjInfo; 8 | 9 | public GfxObjInfo(ACE.DatLoader.Entity.GfxObjInfo info) 10 | { 11 | _gfxObjInfo = info; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var id = new TreeNode($"ID: {_gfxObjInfo.Id:X8}", clickable: true); 17 | var degradeMode = new TreeNode($"DegradeMode: {_gfxObjInfo.DegradeMode}"); 18 | var minDist = new TreeNode($"MinDist: {_gfxObjInfo.MinDist}"); 19 | var idealDist = new TreeNode($"IdealDist: {_gfxObjInfo.IdealDist}"); 20 | var maxDist = new TreeNode($"MaxDist; {_gfxObjInfo.MaxDist}"); 21 | 22 | return new List() { id, degradeMode, minDist, idealDist, maxDist }; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACViewer/Entity/LandSurf.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class LandSurf 6 | { 7 | public ACE.DatLoader.Entity.LandSurf _landSurf; 8 | 9 | public LandSurf(ACE.DatLoader.Entity.LandSurf landSurf) 10 | { 11 | _landSurf = landSurf; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | // type always 0? 17 | return new TexMerge(_landSurf.TexMerge).BuildTree(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ACViewer/Entity/LocationType.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Entity 2 | { 3 | public class LocationType 4 | { 5 | public ACE.DatLoader.Entity.LocationType _locationType; 6 | 7 | public LocationType(ACE.DatLoader.Entity.LocationType locationType) 8 | { 9 | _locationType = locationType; 10 | } 11 | 12 | public override string ToString() 13 | { 14 | return $"PartID: {_locationType.PartId}, Frame: {new Frame(_locationType.Frame)}"; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ACViewer/Entity/PhysicsScriptData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class PhysicsScriptData 6 | { 7 | public ACE.DatLoader.Entity.PhysicsScriptData _scriptData; 8 | 9 | public PhysicsScriptData(ACE.DatLoader.Entity.PhysicsScriptData scriptData) 10 | { 11 | _scriptData = scriptData; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var startTime = new TreeNode($"StartTime: {_scriptData.StartTime}"); 17 | 18 | var hook = AnimationHook.Create(_scriptData.Hook); 19 | 20 | var hookNode = new TreeNode($"Hook:", hook.BuildTree()); 21 | 22 | return new List() { startTime, hookNode }; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACViewer/Entity/PhysicsScriptTableData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class PhysicsScriptTableData 6 | { 7 | public ACE.DatLoader.Entity.PhysicsScriptTableData _data; 8 | 9 | public PhysicsScriptTableData(ACE.DatLoader.Entity.PhysicsScriptTableData data) 10 | { 11 | _data = data; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var scriptTable = new TreeNode("ScriptMods:"); 17 | 18 | foreach (var scriptMod in _data.Scripts) 19 | scriptTable.Items.Add(new TreeNode($"{new ScriptMod(scriptMod)}", clickable: true)); 20 | 21 | return scriptTable.Items; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ACViewer/Entity/PlacementType.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class PlacementType 6 | { 7 | public ACE.DatLoader.Entity.PlacementType _placementType; 8 | 9 | public PlacementType(ACE.DatLoader.Entity.PlacementType placementType) 10 | { 11 | _placementType = placementType; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | return new AnimationFrame(_placementType.AnimFrame).BuildTree(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ACViewer/Entity/Plane.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Entity 2 | { 3 | public class Plane 4 | { 5 | public ACE.DatLoader.Entity.Plane _plane; 6 | 7 | public Plane(ACE.DatLoader.Entity.Plane plane) 8 | { 9 | _plane = plane; 10 | } 11 | 12 | public override string ToString() 13 | { 14 | return $"Normal: {_plane.N} - Distance: {_plane.D}"; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ACViewer/Entity/PortalPoly.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Entity 2 | { 3 | public class PortalPoly 4 | { 5 | public ACE.DatLoader.Entity.PortalPoly _portalPoly; 6 | 7 | public PortalPoly(ACE.DatLoader.Entity.PortalPoly portalPoly) 8 | { 9 | _portalPoly = portalPoly; 10 | } 11 | 12 | public override string ToString() 13 | { 14 | return $"PortalIdx: {_portalPoly.PortalIndex}, PolygonId: {_portalPoly.PolygonId}"; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ACViewer/Entity/RoadAlphaMap.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class RoadAlphaMap 6 | { 7 | public ACE.DatLoader.Entity.RoadAlphaMap _roadAlphaMap; 8 | 9 | public RoadAlphaMap(ACE.DatLoader.Entity.RoadAlphaMap roadAlphaMap) 10 | { 11 | _roadAlphaMap = roadAlphaMap; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var roadCode = new TreeNode($"RoadCode: {_roadAlphaMap.RCode}"); 17 | var roadTexGID = new TreeNode($"RoadTexGID: {_roadAlphaMap.RoadTexGID:X8}", clickable: true); 18 | 19 | return new List() { roadCode, roadTexGID }; 20 | } 21 | 22 | public override string ToString() 23 | { 24 | return $"RoadCode: {_roadAlphaMap.RCode}, RoadTexGID: {_roadAlphaMap.RoadTexGID:X8}"; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ACViewer/Entity/SceneDesc.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class SceneDesc 6 | { 7 | public ACE.DatLoader.Entity.SceneDesc _sceneDesc; 8 | 9 | public SceneDesc(ACE.DatLoader.Entity.SceneDesc sceneDesc) 10 | { 11 | _sceneDesc = sceneDesc; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var sceneTypes = new TreeNode("SceneTypes:"); 17 | 18 | for (var i = 0; i < _sceneDesc.SceneTypes.Count; i++) 19 | { 20 | var sceneType = new TreeNode($"{i}"); 21 | sceneType.Items.AddRange(new SceneType(_sceneDesc.SceneTypes[i]).BuildTree()); 22 | 23 | sceneTypes.Items.Add(sceneType); 24 | } 25 | return new List() { sceneTypes }; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/Entity/SceneType.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class SceneType 6 | { 7 | public ACE.DatLoader.Entity.SceneType _sceneType; 8 | 9 | public SceneType(ACE.DatLoader.Entity.SceneType sceneType) 10 | { 11 | _sceneType = sceneType; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var sceneTableIdx = new TreeNode($"SceneTableIdx: {_sceneType.StbIndex}"); 17 | 18 | var scenes = new TreeNode($"Scenes:"); 19 | 20 | foreach (var scene in _sceneType.Scenes) 21 | scenes.Items.Add(new TreeNode($"{scene:X8}", clickable: true)); 22 | 23 | return new List() { sceneTableIdx, scenes }; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ACViewer/Entity/ScriptMod.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class ScriptMod 6 | { 7 | public ACE.DatLoader.Entity.ScriptAndModData _scriptMod; 8 | 9 | public ScriptMod(ACE.DatLoader.Entity.ScriptAndModData scriptMod) 10 | { 11 | _scriptMod = scriptMod; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var mod = new TreeNode($"{_scriptMod.Mod}"); 17 | var script = new TreeNode($"{_scriptMod.ScriptId:X8}", clickable: true); 18 | 19 | return new List() { mod, script }; 20 | } 21 | 22 | public override string ToString() 23 | { 24 | return $"Mod: {_scriptMod.Mod}, Script: {_scriptMod.ScriptId:X8}"; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ACViewer/Entity/Season.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class Season 6 | { 7 | public ACE.DatLoader.Entity.Season _season; 8 | 9 | public Season(ACE.DatLoader.Entity.Season season) 10 | { 11 | _season = season; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var startDate = new TreeNode($"StartDate: {_season.StartDate}"); 17 | var name = new TreeNode($"Name: {_season.Name}"); 18 | 19 | return new List() { startDate, name }; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ACViewer/Entity/SkillCG.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using ACE.Entity.Enum; 4 | 5 | namespace ACViewer.Entity 6 | { 7 | public class SkillCG 8 | { 9 | public ACE.DatLoader.Entity.SkillCG _skill; 10 | 11 | public SkillCG(ACE.DatLoader.Entity.SkillCG skill) 12 | { 13 | _skill = skill; 14 | } 15 | 16 | public List BuildTree() 17 | { 18 | var skill = new TreeNode($"Skill: {(Skill)_skill.SkillNum}"); 19 | var normalCost = new TreeNode($"Normal Cost: {_skill.NormalCost}"); 20 | var primaryCost = new TreeNode($"Primary Cost: {_skill.PrimaryCost}"); 21 | 22 | return new List() { skill, normalCost, primaryCost }; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACViewer/Entity/SkillFormula.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using ACE.Entity.Enum.Properties; 4 | 5 | namespace ACViewer.Entity 6 | { 7 | public class SkillFormula 8 | { 9 | public ACE.DatLoader.Entity.SkillFormula _skillFormula; 10 | 11 | public SkillFormula(ACE.DatLoader.Entity.SkillFormula skillFormula) 12 | { 13 | _skillFormula = skillFormula; 14 | } 15 | 16 | public List BuildTree() 17 | { 18 | var treeNode = new List(); 19 | 20 | treeNode.Add(new TreeNode($"Attr1: {(PropertyAttribute)_skillFormula.Attr1}")); 21 | treeNode.Add(new TreeNode($"Attr2: {(PropertyAttribute)_skillFormula.Attr2}")); 22 | treeNode.Add(new TreeNode($"W: {_skillFormula.W}")); 23 | treeNode.Add(new TreeNode($"X: {_skillFormula.X}")); 24 | treeNode.Add(new TreeNode($"Y: {_skillFormula.Y}")); 25 | treeNode.Add(new TreeNode($"Z (divisor): {_skillFormula.Z}")); 26 | 27 | return treeNode; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ACViewer/Entity/SkyDesc.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class SkyDesc 6 | { 7 | public ACE.DatLoader.Entity.SkyDesc _skyDesc; 8 | 9 | public SkyDesc(ACE.DatLoader.Entity.SkyDesc skyDesc) 10 | { 11 | _skyDesc = skyDesc; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var tickSize = new TreeNode($"TickSize: {_skyDesc.TickSize}"); 17 | var lightTickSize = new TreeNode($"LightTickSize: {_skyDesc.LightTickSize}"); 18 | 19 | var dayGroups = new TreeNode("DayGroups:"); 20 | for (var i = 0; i < _skyDesc.DayGroups.Count; i++) 21 | { 22 | var dayGroup = new TreeNode($"{i:D2}"); 23 | dayGroup.Items.AddRange(new DayGroup(_skyDesc.DayGroups[i]).BuildTree()); 24 | dayGroups.Items.Add(dayGroup); 25 | } 26 | return new List() { tickSize, lightTickSize, dayGroups }; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ACViewer/Entity/SoundData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class SoundData 6 | { 7 | public ACE.DatLoader.Entity.SoundData _soundData; 8 | 9 | public SoundData(ACE.DatLoader.Entity.SoundData soundData) 10 | { 11 | _soundData = soundData; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var soundTable = new TreeNode("SoundTable:"); 17 | 18 | foreach (var sound in _soundData.Data) 19 | { 20 | var soundTree = new SoundTableData(sound).BuildTree(); 21 | var soundNode = new TreeNode(soundTree[0].Name.Replace("Sound ID: ", ""), clickable: true); 22 | soundTree.RemoveAt(0); 23 | soundNode.Items.AddRange(soundTree); 24 | soundTable.Items.Add(soundNode); 25 | } 26 | var unknown = new TreeNode($"Unknown: {_soundData.Unknown}"); 27 | 28 | return new List() { soundTable, unknown }; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ACViewer/Entity/SoundDesc.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class SoundDesc 6 | { 7 | public ACE.DatLoader.Entity.SoundDesc _soundDesc; 8 | 9 | public SoundDesc(ACE.DatLoader.Entity.SoundDesc soundDesc) 10 | { 11 | _soundDesc = soundDesc; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var soundInfos = new List(); 17 | 18 | for (var i = 0; i < _soundDesc.STBDesc.Count; i++) 19 | { 20 | var tree = new AmbientSoundTableDesc(_soundDesc.STBDesc[i]).BuildTree(); 21 | var node = new TreeNode($"{i}: {tree[0].Name.Replace("Ambient Sound Table ID: ", "")}", clickable: true); 22 | tree.RemoveAt(0); 23 | node.Items.AddRange(tree); 24 | 25 | soundInfos.Add(node); 26 | } 27 | return soundInfos; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ACViewer/Entity/SoundTableData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class SoundTableData 6 | { 7 | public ACE.DatLoader.Entity.SoundTableData _data; 8 | 9 | public SoundTableData(ACE.DatLoader.Entity.SoundTableData data) 10 | { 11 | _data = data; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var soundID = new TreeNode($"Sound ID: {_data.SoundId:X8}", clickable: true); 17 | var priority = new TreeNode($"Priority: {_data.Priority}"); 18 | var probability = new TreeNode($"Probability: {_data.Probability}"); 19 | var volume = new TreeNode($"Volume: {_data.Volume}"); 20 | 21 | return new List() { soundID, priority, probability, volume }; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ACViewer/Entity/SpellSet.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class SpellSet 6 | { 7 | public ACE.DatLoader.Entity.SpellSet _spellSet; 8 | 9 | public SpellSet(ACE.DatLoader.Entity.SpellSet spellSet) 10 | { 11 | _spellSet = spellSet; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var treeNode = new List(); 17 | 18 | var spellSetTiers = new TreeNode($"SpellSetTiers"); 19 | 20 | foreach (var kvp in _spellSet.SpellSetTiers) 21 | { 22 | var spellSetTier = new TreeNode(kvp.Key.ToString()); 23 | spellSetTier.Items = new SpellSetTier(kvp.Value).BuildTree(); 24 | 25 | spellSetTiers.Items.Add(spellSetTier); 26 | } 27 | treeNode.Add(spellSetTiers); 28 | treeNode.Add(new TreeNode($"HighestTier: {_spellSet.HighestTier}")); 29 | return treeNode; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ACViewer/Entity/SpellSetTier.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using ACE.DatLoader; 4 | 5 | namespace ACViewer.Entity 6 | { 7 | public class SpellSetTier 8 | { 9 | public ACE.DatLoader.FileTypes.SpellSetTiers _spellSetTier; 10 | 11 | public SpellSetTier(ACE.DatLoader.FileTypes.SpellSetTiers spellSetTier) 12 | { 13 | _spellSetTier = spellSetTier; 14 | } 15 | 16 | public List BuildTree() 17 | { 18 | var treeNode = new List(); 19 | 20 | var spellTable = DatManager.PortalDat.SpellTable; 21 | 22 | foreach (var spellId in _spellSetTier.Spells) 23 | { 24 | var spell = spellTable.Spells[spellId]; 25 | treeNode.Add(new TreeNode($"{spellId} - {spell.Name}")); 26 | } 27 | return treeNode; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ACViewer/Entity/Sphere.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Entity 2 | { 3 | public class Sphere 4 | { 5 | public ACE.DatLoader.Entity.Sphere _sphere; 6 | 7 | public Sphere(ACE.DatLoader.Entity.Sphere sphere) 8 | { 9 | _sphere = sphere; 10 | } 11 | 12 | public override string ToString() 13 | { 14 | return $"Origin: {_sphere.Origin}, Radius: {_sphere.Radius}"; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ACViewer/Entity/Stab.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class Stab 6 | { 7 | public ACE.DatLoader.Entity.Stab _stab; 8 | 9 | public Stab(ACE.DatLoader.Entity.Stab stab) 10 | { 11 | _stab = stab; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var id = new TreeNode($"ID: {_stab.Id:X8}", clickable: true); 17 | var frame = new TreeNode($"Frame: {new Frame(_stab.Frame)}"); 18 | 19 | return new List() { id, frame }; 20 | } 21 | 22 | public override string ToString() 23 | { 24 | return $"ID: {_stab.Id:X8}, Frame: {new Frame(_stab.Frame)}"; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ACViewer/Entity/StarterArea.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class StarterArea 6 | { 7 | public ACE.DatLoader.Entity.StarterArea _starterArea; 8 | 9 | public StarterArea(ACE.DatLoader.Entity.StarterArea starterArea) 10 | { 11 | _starterArea = starterArea; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var name = new TreeNode($"Name: {_starterArea.Name}"); 17 | var locations = new TreeNode("Locations:"); 18 | for (var i = 0; i < _starterArea.Locations.Count; i++) 19 | { 20 | var position = new Position(_starterArea.Locations[i]).BuildTree(); 21 | var location = new TreeNode($"{position[0].Name.Replace("ObjCellID: ", "")}", clickable: true); 22 | location.Items.AddRange(new List() { position[1], position[2] }); 23 | locations.Items.Add(location); 24 | } 25 | return new List() { name, locations }; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/Entity/SubPalette.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class SubPalette 6 | { 7 | public ACE.DatLoader.Entity.SubPalette _subPalette; 8 | 9 | public SubPalette(ACE.DatLoader.Entity.SubPalette subPalette) 10 | { 11 | _subPalette = subPalette; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var subID = new TreeNode($"SubID: {_subPalette.SubID:X8}", clickable: true); 17 | var offset = new TreeNode($"Offset: {_subPalette.Offset}"); 18 | var numColors = new TreeNode($"NumColors: {_subPalette.NumColors}"); 19 | 20 | return new List() { subID, offset, numColors }; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ACViewer/Entity/TMTerrainDesc.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class TMTerrainDesc 6 | { 7 | public ACE.DatLoader.Entity.TMTerrainDesc _tmTerrainDesc; 8 | 9 | public TMTerrainDesc(ACE.DatLoader.Entity.TMTerrainDesc tmTerrainDesc) 10 | { 11 | _tmTerrainDesc = tmTerrainDesc; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var terrainType = new TreeNode($"TerrainType: {_tmTerrainDesc.TerrainType}"); 17 | 18 | var terrainTex = new TreeNode("TerrainTexture:"); 19 | terrainTex.Items.AddRange(new TerrainTex(_tmTerrainDesc.TerrainTex).BuildTree()); 20 | 21 | return new List() { terrainType, terrainTex }; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ACViewer/Entity/TerrainAlphaMap.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class TerrainAlphaMap 6 | { 7 | public ACE.DatLoader.Entity.TerrainAlphaMap _terrainAlphaMap; 8 | 9 | public TerrainAlphaMap(ACE.DatLoader.Entity.TerrainAlphaMap terrainAlphaMap) 10 | { 11 | _terrainAlphaMap = terrainAlphaMap; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var terrainCode = new TreeNode($"TerrainCode: {_terrainAlphaMap.TCode}"); 17 | var textureGID = new TreeNode($"TextureGID: {_terrainAlphaMap.TexGID:X8}", clickable: true); 18 | 19 | return new List() { terrainCode, textureGID }; 20 | } 21 | 22 | public override string ToString() 23 | { 24 | return $"TerrainCode: {_terrainAlphaMap.TCode}, TextureGID: {_terrainAlphaMap.TexGID:X8}"; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ACViewer/Entity/TerrainType.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class TerrainType 6 | { 7 | public ACE.DatLoader.Entity.TerrainType _terrainType; 8 | 9 | public TerrainType(ACE.DatLoader.Entity.TerrainType terrainType) 10 | { 11 | _terrainType = terrainType; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var terrainName = new TreeNode($"TerrainName: {_terrainType.TerrainName}"); 17 | var terrainColor = new TreeNode($"TerrainColor: {_terrainType.TerrainColor:X8}"); 18 | 19 | var sceneTypes = new TreeNode("SceneTypes:"); 20 | for (var i = 0; i < _terrainType.SceneTypes.Count; i++) 21 | sceneTypes.Items.Add(new TreeNode($"{i}: {_terrainType.SceneTypes[i]}")); 22 | 23 | return new List() { terrainName, terrainColor, sceneTypes }; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ACViewer/Entity/TextureMapChange.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class TextureMapChange 6 | { 7 | public ACE.DatLoader.Entity.TextureMapChange _textureChange; 8 | 9 | public TextureMapChange(ACE.DatLoader.Entity.TextureMapChange textureChange) 10 | { 11 | _textureChange = textureChange; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var partIdx = new TreeNode($"PartIdx: {_textureChange.PartIndex}"); 17 | var oldTexture = new TreeNode($"Old Texture: {_textureChange.OldTexture:X8}", clickable: true); 18 | var newTexture = new TreeNode($"New Texture: {_textureChange.NewTexture:X8}", clickable: true); 19 | 20 | return new List() { partIdx, oldTexture, newTexture }; 21 | } 22 | 23 | public override string ToString() 24 | { 25 | return $"PartIdx: {_textureChange.PartIndex}, Old Tex: {_textureChange.OldTexture:X8}, New Tex: {_textureChange.NewTexture:X8}"; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/Entity/TimeOfDay.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class TimeOfDay 6 | { 7 | public ACE.DatLoader.Entity.TimeOfDay _timeOfDay; 8 | 9 | public TimeOfDay(ACE.DatLoader.Entity.TimeOfDay timeOfDay) 10 | { 11 | _timeOfDay = timeOfDay; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var start = new TreeNode($"Start: {_timeOfDay.Start}"); 17 | var isNight = new TreeNode($"IsNight: {_timeOfDay.IsNight}"); 18 | var name = new TreeNode($"Name: {_timeOfDay.Name}"); 19 | 20 | return new List() { start, isNight, name }; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ACViewer/Entity/TreeNode.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class TreeNode 6 | { 7 | public string Name { get; set; } 8 | public List Items { get; set; } 9 | public bool Clickable { get; set; } 10 | 11 | public TreeNode(string name = "", List items = null, bool clickable = false) 12 | { 13 | Name = name; 14 | Items = items ?? new List(); 15 | 16 | Clickable = clickable; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ACViewer/Entity/UV.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Entity 2 | { 3 | public class UV 4 | { 5 | public ACE.DatLoader.Entity.Vec2Duv _uv; 6 | 7 | public UV(ACE.DatLoader.Entity.Vec2Duv uv) 8 | { 9 | _uv = uv; 10 | } 11 | 12 | public TreeNode BuildTree() 13 | { 14 | return new TreeNode($"U: {_uv.U} V: {_uv.V}"); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ACViewer/Entity/Vertex.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class Vertex 6 | { 7 | public ACE.DatLoader.Entity.SWVertex _swVertex; 8 | 9 | public Vertex(ACE.DatLoader.Entity.SWVertex swVertex) 10 | { 11 | _swVertex = swVertex; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var origin = new TreeNode($"Origin: {_swVertex.Origin}"); 17 | var normal = new TreeNode($"Normal: {_swVertex.Normal}"); 18 | var uvs = new TreeNode("UVs"); 19 | 20 | foreach (var uv in _swVertex.UVs) 21 | uvs.Items.Add(new UV(uv).BuildTree()); 22 | 23 | return new List() { origin, normal, uvs }; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ACViewer/Entity/VertexArray.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Entity 4 | { 5 | public class VertexArray 6 | { 7 | public ACE.DatLoader.Entity.CVertexArray _vertexArray; 8 | 9 | public VertexArray(ACE.DatLoader.Entity.CVertexArray vertexArray) 10 | { 11 | _vertexArray = vertexArray; 12 | } 13 | 14 | public List BuildTree() 15 | { 16 | var vertexType = new TreeNode($"VertexType: {_vertexArray.VertexType}"); 17 | 18 | var vertices = new TreeNode("Vertices"); 19 | 20 | foreach (var kvp in _vertexArray.Vertices) 21 | { 22 | var vertex = new TreeNode($"{kvp.Key}"); 23 | 24 | foreach (var item in new Vertex(kvp.Value).BuildTree()) 25 | vertex.Items.Add(item); 26 | 27 | vertices.Items.Add(vertex); 28 | } 29 | return new List() { vertexType, vertices }; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ACViewer/Enum/DatType.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Enum 2 | { 3 | public enum DatType 4 | { 5 | Undef, 6 | Cell, 7 | Portal, 8 | Language, 9 | HighRes 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ACViewer/Enum/Facing.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Enum 2 | { 3 | public enum Facing 4 | { 5 | Front, 6 | Back, 7 | Left, 8 | Right, 9 | Top, 10 | Bottom 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /ACViewer/Enum/GeneratorTickMode.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Enum 2 | { 3 | public enum GeneratorTickMode 4 | { 5 | Undef, 6 | Instances, 7 | Encounters 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ACViewer/Enum/MapViewerMode.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Enum 2 | { 3 | public enum MapViewerMode 4 | { 5 | Undef, 6 | PreGenerated, 7 | GenerateFromDAT 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ACViewer/Enum/ModelType.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Enum 2 | { 3 | public enum ModelType 4 | { 5 | Undef, 6 | Setup, 7 | EnvCell, 8 | Environment, 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /ACViewer/Enum/PickType.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Enum 2 | { 3 | public enum PickType 4 | { 5 | Undef, 6 | LandCell, 7 | EnvCell, 8 | GfxObj, 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ACViewer/Enum/ProfilerSection.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Enum 2 | { 3 | public enum ProfilerSection 4 | { 5 | Draw, 6 | ParticleUpdate, 7 | ParticleDraw 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ACViewer/Enum/ViewMode.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Enum 2 | { 3 | public enum ViewMode 4 | { 5 | Undef, 6 | Texture, 7 | Model, 8 | World, 9 | Map, 10 | Particle, 11 | WorldObject, 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /ACViewer/Extensions/ColorExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Media; 2 | 3 | namespace ACViewer.Extensions 4 | { 5 | public static class ColorExtensions 6 | { 7 | public static SolidColorBrush ToSolidColorBrush(this System.Drawing.Color c) 8 | { 9 | return new SolidColorBrush(Color.FromArgb(c.A, c.R, c.G, c.B)); 10 | } 11 | 12 | public static SolidColorBrush ToSolidColorBrush(this Microsoft.Xna.Framework.Color c) 13 | { 14 | return new SolidColorBrush(Color.FromArgb(c.A, c.R, c.G, c.B)); 15 | } 16 | 17 | public static System.Drawing.Color ToColor(this SolidColorBrush brush) 18 | { 19 | return System.Drawing.Color.FromArgb(brush.Color.A, brush.Color.R, brush.Color.G, brush.Color.B); 20 | } 21 | 22 | public static Microsoft.Xna.Framework.Color ToXNAColor(this SolidColorBrush brush) 23 | { 24 | return new Microsoft.Xna.Framework.Color(brush.Color.R, brush.Color.G, brush.Color.B, brush.Color.A); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ACViewer/Extensions/FloatExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ACViewer.Extensions 4 | { 5 | public static class FloatExtensions 6 | { 7 | /// 8 | /// Converts radians to degrees 9 | /// 10 | public static float ToDegs(this float rads) 11 | { 12 | return (float)(180.0f / Math.PI * rads); 13 | } 14 | 15 | /// 16 | /// Converts degrees to radians 17 | /// 18 | public static float ToRads(this float degrees) 19 | { 20 | return (float)(Math.PI / 180.0f * degrees); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ACViewer/Extensions/FrameExtensions.cs: -------------------------------------------------------------------------------- 1 | using ACE.DatLoader.Entity; 2 | using ACE.Server.Physics.Animation; 3 | 4 | using Microsoft.Xna.Framework; 5 | 6 | namespace ACViewer 7 | { 8 | public static class FrameExtensions 9 | { 10 | public static Matrix ToXna(this Frame frame) 11 | { 12 | var translate = Matrix.CreateTranslation(frame.Origin.ToXna()); 13 | var rotate = Matrix.CreateFromQuaternion(frame.Orientation.ToXna()); 14 | 15 | return rotate * translate; 16 | } 17 | 18 | public static Matrix ToXna(this AFrame frame) 19 | { 20 | var translate = Matrix.CreateTranslation(frame.Origin.ToXna()); 21 | var rotate = Matrix.CreateFromQuaternion(frame.Orientation.ToXna()); 22 | 23 | return rotate * translate; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ACViewer/Extensions/MathExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Extensions 2 | { 3 | public static class MathExtensions 4 | { 5 | public static float Clamp(float val, float min, float max) 6 | { 7 | if (val < min) 8 | val = min; 9 | else if (val > max) 10 | val = max; 11 | 12 | return val; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ACViewer/Extensions/MatrixExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer 2 | { 3 | public static class MatrixExtensions 4 | { 5 | public static System.Numerics.Matrix4x4 ToNumerics(this Microsoft.Xna.Framework.Matrix m) 6 | { 7 | return new System.Numerics.Matrix4x4(m.M11, m.M12, m.M13, m.M14, m.M21, m.M22, m.M23, m.M24, m.M31, m.M32, m.M33, m.M34, m.M41, m.M42, m.M43, m.M44); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ACViewer/Extensions/MouseEx.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using System.Windows; 3 | using System.Windows.Media; 4 | 5 | namespace ACViewer.Extensions 6 | { 7 | public class MouseEx 8 | { 9 | public struct POINT 10 | { 11 | public int X; 12 | public int Y; 13 | } 14 | 15 | [DllImport("user32.dll")] 16 | public static extern bool GetCursorPos(out POINT lpPoint); 17 | 18 | [DllImport("user32.dll")] 19 | public static extern bool SetCursorPos(int X, int Y); 20 | 21 | public static Point SetCursor(Visual visual, int x, int y) 22 | { 23 | var p = visual.PointToScreen(new Point(x, y)); 24 | SetCursorPos((int)p.X, (int)p.Y); 25 | return p; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/Extensions/PositionExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Xna.Framework; 2 | 3 | using ACE.Server.Physics.Common; 4 | 5 | namespace ACViewer 6 | { 7 | public static class PositionExtensions 8 | { 9 | public static Matrix ToXna(this Position pos) 10 | { 11 | var frameTransform = pos.Frame.ToXna(); 12 | 13 | // translate to landblock 14 | var lbx = pos.ObjCellID >> 24; 15 | var lby = pos.ObjCellID >> 16 & 0xFF; 16 | 17 | var worldTranslate = Matrix.CreateTranslation(new Vector3(lbx * LandDefs.BlockLength, lby * LandDefs.BlockLength, 0)); 18 | 19 | return frameTransform * worldTranslate; 20 | } 21 | 22 | public static Vector3 GetWorldPos(this Position pos) 23 | { 24 | // translate to landblock 25 | var lbx = pos.ObjCellID >> 24; 26 | var lby = pos.ObjCellID >> 16 & 0xFF; 27 | 28 | return new Vector3(lbx * LandDefs.BlockLength + pos.Frame.Origin.X, lby * LandDefs.BlockLength + pos.Frame.Origin.Y, pos.Frame.Origin.Z); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ACViewer/Extensions/TextBoxExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | using ACViewer.View; 4 | 5 | namespace ACViewer 6 | { 7 | public static class TextBoxExtensions 8 | { 9 | public static void WriteLine(this TextBox textBox, string line) 10 | { 11 | MainWindow.Instance.AddStatusText(line); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ACViewer/Extensions/VertexExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Xna.Framework; 2 | using Microsoft.Xna.Framework.Graphics; 3 | 4 | namespace ACViewer 5 | { 6 | public static class VertexExtensions 7 | { 8 | public static VertexPositionNormalTexture Transform(this VertexPositionNormalTexture _v, Matrix transform) 9 | { 10 | return new VertexPositionNormalTexture(Vector3.Transform(_v.Position, transform), _v.Normal, _v.TextureCoordinate); 11 | } 12 | 13 | public static VertexPositionNormalTextures Transform(this VertexPositionNormalTexture _v, Matrix transform, byte textureIdx) 14 | { 15 | return new VertexPositionNormalTextures(Vector3.Transform(_v.Position, transform), _v.Normal, _v.TextureCoordinate, textureIdx); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ACViewer/FileTypes/BadData.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | using ACViewer.Entity; 4 | 5 | namespace ACViewer.FileTypes 6 | { 7 | public class BadData 8 | { 9 | public ACE.DatLoader.FileTypes.BadData _badData; 10 | 11 | public BadData(ACE.DatLoader.FileTypes.BadData badData) 12 | { 13 | _badData = badData; 14 | } 15 | 16 | public TreeNode BuildTree() 17 | { 18 | var treeView = new TreeNode($"{_badData.Id:X8}"); 19 | 20 | var wcids = _badData.Bad.Keys.OrderBy(i => i).ToList(); 21 | 22 | foreach (var wcid in wcids) 23 | treeView.Items.Add(new TreeNode($"{wcid}")); 24 | 25 | return treeView; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/FileTypes/CombatTable.cs: -------------------------------------------------------------------------------- 1 | using ACViewer.Entity; 2 | 3 | namespace ACViewer.FileTypes 4 | { 5 | public class CombatTable 6 | { 7 | public ACE.DatLoader.FileTypes.CombatManeuverTable _combatTable; 8 | 9 | public CombatTable(ACE.DatLoader.FileTypes.CombatManeuverTable combatTable) 10 | { 11 | _combatTable = combatTable; 12 | } 13 | 14 | public TreeNode BuildTree() 15 | { 16 | var treeView = new TreeNode($"{_combatTable.Id:X8}"); 17 | 18 | var maneuvers = new TreeNode("Maneuvers:"); 19 | 20 | for (var i = 0; i < _combatTable.CMT.Count; i++) 21 | { 22 | var maneuver = new TreeNode($"{i}"); 23 | maneuver.Items.AddRange(new CombatManeuver(_combatTable.CMT[i]).BuildTree()); 24 | 25 | maneuvers.Items.Add(maneuver); 26 | } 27 | treeView.Items.AddRange(maneuvers.Items); 28 | 29 | return treeView; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ACViewer/FileTypes/ContractTable.cs: -------------------------------------------------------------------------------- 1 | using ACViewer.Entity; 2 | 3 | namespace ACViewer.FileTypes 4 | { 5 | public class ContractTable 6 | { 7 | public ACE.DatLoader.FileTypes.ContractTable _contractTable; 8 | 9 | public ContractTable(ACE.DatLoader.FileTypes.ContractTable contractTable) 10 | { 11 | _contractTable = contractTable; 12 | } 13 | 14 | public TreeNode BuildTree() 15 | { 16 | var treeView = new TreeNode($"{_contractTable.Id:X8}"); 17 | 18 | foreach (var kvp in _contractTable.Contracts) 19 | { 20 | var contract = new TreeNode($"{kvp.Key} - {kvp.Value.ContractName}"); 21 | contract.Items = new Contract(kvp.Value).BuildTree(); 22 | treeView.Items.Add(contract); 23 | } 24 | return treeView; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ACViewer/FileTypes/DegradeInfo.cs: -------------------------------------------------------------------------------- 1 | using ACViewer.Entity; 2 | 3 | namespace ACViewer.FileTypes 4 | { 5 | public class DegradeInfo 6 | { 7 | public ACE.DatLoader.FileTypes.GfxObjDegradeInfo _degrade; 8 | 9 | public DegradeInfo(ACE.DatLoader.FileTypes.GfxObjDegradeInfo degrade) 10 | { 11 | _degrade = degrade; 12 | } 13 | 14 | public TreeNode BuildTree() 15 | { 16 | var treeView = new TreeNode($"{_degrade.Id:X8}"); 17 | 18 | foreach (var degrade in _degrade.Degrades) 19 | { 20 | var degradeTree = new GfxObjInfo(degrade).BuildTree(); 21 | var degradeNode = new TreeNode($"{degradeTree[0].Name.Replace("ID: ", "")}", clickable: true); 22 | degradeTree.RemoveAt(0); 23 | degradeNode.Items.AddRange(degradeTree); 24 | treeView.Items.Add(degradeNode); 25 | } 26 | return treeView; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ACViewer/FileTypes/Environment.cs: -------------------------------------------------------------------------------- 1 | using ACViewer.Entity; 2 | 3 | namespace ACViewer.FileTypes 4 | { 5 | public class Environment 6 | { 7 | public ACE.DatLoader.FileTypes.Environment _env; 8 | 9 | public Environment(ACE.DatLoader.FileTypes.Environment env) 10 | { 11 | _env = env; 12 | } 13 | 14 | public TreeNode BuildTree() 15 | { 16 | var treeView = new TreeNode($"{_env.Id:X8}"); 17 | 18 | foreach (var kvp in _env.Cells) 19 | { 20 | var cellStruct = new TreeNode($"{kvp.Key}"); 21 | cellStruct.Items.AddRange(new CellStruct(kvp.Value).BuildTree()); 22 | treeView.Items.Add(cellStruct); 23 | } 24 | return treeView; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ACViewer/FileTypes/NameFilterTable.cs: -------------------------------------------------------------------------------- 1 | using ACViewer.Entity; 2 | 3 | namespace ACViewer.FileTypes 4 | { 5 | public class NameFilterTable 6 | { 7 | public ACE.DatLoader.FileTypes.NameFilterTable _nameFilterTable; 8 | 9 | public NameFilterTable(ACE.DatLoader.FileTypes.NameFilterTable nameFilterTable) 10 | { 11 | _nameFilterTable = nameFilterTable; 12 | } 13 | 14 | public TreeNode BuildTree() 15 | { 16 | var treeView = new TreeNode($"{_nameFilterTable.Id:X8}"); 17 | 18 | foreach (var kvp in _nameFilterTable.LanguageData) 19 | { 20 | var node = new TreeNode($"{kvp.Key}"); 21 | node.Items = new NameFilterLanguageData(kvp.Value).BuildTree(); 22 | 23 | treeView.Items.Add(node); 24 | } 25 | return treeView; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/FileTypes/ObjDesc.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using ACE.DatLoader.Entity; 4 | 5 | namespace ACViewer.FileTypes 6 | { 7 | /// 8 | /// Used in the Clothing Table entries to change the look/color of a default model (e.g. because it has clothing equipped) 9 | /// 10 | public class ObjDesc 11 | { 12 | public Dictionary> TextureChanges { get; } = new Dictionary>(); 13 | public Dictionary AnimPartChanges { get; } = new Dictionary(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ACViewer/FileTypes/Palette.cs: -------------------------------------------------------------------------------- 1 | using ACViewer.Entity; 2 | 3 | namespace ACViewer.FileTypes 4 | { 5 | public class Palette 6 | { 7 | public ACE.DatLoader.FileTypes.Palette _palette; 8 | 9 | public Palette(ACE.DatLoader.FileTypes.Palette palette) 10 | { 11 | _palette = palette; 12 | } 13 | 14 | public TreeNode BuildTree() 15 | { 16 | var treeView = new TreeNode($"{_palette.Id:X8}"); 17 | 18 | foreach (var color in _palette.Colors) 19 | treeView.Items.Add(new TreeNode(Color.ToRGBA(color))); 20 | 21 | return treeView; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ACViewer/FileTypes/PaletteSet.cs: -------------------------------------------------------------------------------- 1 | using ACViewer.Entity; 2 | 3 | namespace ACViewer.FileTypes 4 | { 5 | public class PaletteSet 6 | { 7 | public ACE.DatLoader.FileTypes.PaletteSet _paletteSet; 8 | 9 | public PaletteSet(ACE.DatLoader.FileTypes.PaletteSet paletteSet) 10 | { 11 | _paletteSet = paletteSet; 12 | } 13 | 14 | public TreeNode BuildTree() 15 | { 16 | var treeView = new TreeNode($"{_paletteSet.Id:X8}"); 17 | 18 | foreach (var paletteID in _paletteSet.PaletteList) 19 | treeView.Items.Add(new TreeNode($"{paletteID:X8}", clickable: true)); 20 | 21 | return treeView; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ACViewer/FileTypes/PhysicsScriptTable.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity.Enum; 2 | 3 | using ACViewer.Entity; 4 | 5 | namespace ACViewer.FileTypes 6 | { 7 | public class PhysicsScriptTable 8 | { 9 | public ACE.DatLoader.FileTypes.PhysicsScriptTable _scriptTable; 10 | 11 | public PhysicsScriptTable(ACE.DatLoader.FileTypes.PhysicsScriptTable scriptTable) 12 | { 13 | _scriptTable = scriptTable; 14 | } 15 | 16 | public TreeNode BuildTree() 17 | { 18 | var treeView = new TreeNode($"{_scriptTable.Id:X8}"); 19 | 20 | foreach (var kvp in _scriptTable.ScriptTable) 21 | { 22 | var script = new TreeNode($"{(PlayScript)kvp.Key}"); 23 | script.Items.AddRange(new PhysicsScriptTableData(kvp.Value).BuildTree()); 24 | 25 | treeView.Items.Add(script); 26 | } 27 | return treeView; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ACViewer/FileTypes/Scene.cs: -------------------------------------------------------------------------------- 1 | using ACViewer.Entity; 2 | 3 | namespace ACViewer.FileTypes 4 | { 5 | public class Scene 6 | { 7 | public ACE.DatLoader.FileTypes.Scene _scene; 8 | 9 | public Scene(ACE.DatLoader.FileTypes.Scene scene) 10 | { 11 | _scene = scene; 12 | } 13 | 14 | public TreeNode BuildTree() 15 | { 16 | var treeView = new TreeNode($"{_scene.Id:X8}"); 17 | 18 | foreach (var objDesc in _scene.Objects) 19 | { 20 | var desc = new ObjectDesc(objDesc).BuildTree(); 21 | var obj = new TreeNode(desc[0].Name.Replace("Object ID: ", ""), clickable: true); 22 | desc.RemoveAt(0); 23 | obj.Items.AddRange(desc); 24 | treeView.Items.Add(obj); 25 | } 26 | return treeView; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ACViewer/FileTypes/SecondaryAttributeTable.cs: -------------------------------------------------------------------------------- 1 | using ACViewer.Entity; 2 | 3 | namespace ACViewer.FileTypes 4 | { 5 | public class SecondaryAttributeTable 6 | { 7 | public ACE.DatLoader.FileTypes.SecondaryAttributeTable _vitalTable; 8 | 9 | public SecondaryAttributeTable(ACE.DatLoader.FileTypes.SecondaryAttributeTable vitalTable) 10 | { 11 | _vitalTable = vitalTable; 12 | } 13 | 14 | public TreeNode BuildTree() 15 | { 16 | var treeView = new TreeNode($"{_vitalTable.Id:X8}"); 17 | 18 | var health = new TreeNode($"Health"); 19 | health.Items = new SkillFormula(_vitalTable.MaxHealth.Formula).BuildTree(); 20 | treeView.Items.Add(health); 21 | 22 | var stamina = new TreeNode($"Stamina"); 23 | stamina.Items = new SkillFormula(_vitalTable.MaxStamina.Formula).BuildTree(); 24 | treeView.Items.Add(stamina); 25 | 26 | var mana = new TreeNode($"Mana"); 27 | mana.Items = new SkillFormula(_vitalTable.MaxMana.Formula).BuildTree(); 28 | treeView.Items.Add(mana); 29 | 30 | return treeView; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ACViewer/FileTypes/SkillTable.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | using ACViewer.Entity; 4 | 5 | namespace ACViewer.FileTypes 6 | { 7 | public class SkillTable 8 | { 9 | public ACE.DatLoader.FileTypes.SkillTable _skillTable; 10 | 11 | public SkillTable(ACE.DatLoader.FileTypes.SkillTable skillTable) 12 | { 13 | _skillTable = skillTable; 14 | } 15 | 16 | public TreeNode BuildTree() 17 | { 18 | var treeView = new TreeNode($"{_skillTable.Id:X8}"); 19 | 20 | foreach (var skill in _skillTable.SkillBaseHash.OrderBy(i => i.Key)) 21 | { 22 | // skip retired skills, empty data 23 | if (string.IsNullOrEmpty(skill.Value.Name)) 24 | continue; 25 | 26 | var skillNode = new TreeNode($"{skill.Key}: {skill.Value.Name}"); 27 | skillNode.Items = new SkillBase(skill.Value).BuildTree(); 28 | 29 | treeView.Items.Add(skillNode); 30 | } 31 | return treeView; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ACViewer/FileTypes/Sound.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using ACViewer.Entity; 4 | 5 | namespace ACViewer.FileTypes 6 | { 7 | public class Sound 8 | { 9 | public ACE.DatLoader.FileTypes.Wave _audio; 10 | 11 | public Sound(ACE.DatLoader.FileTypes.Wave audio) 12 | { 13 | _audio = audio; 14 | } 15 | 16 | public TreeNode BuildTree(uint soundID) 17 | { 18 | var treeView = new TreeNode($"{soundID:X8}"); 19 | 20 | var typeStr = _audio.Header[0] == 0x55 ? "MP3" : "WAV"; 21 | var type = new TreeNode($"Type: {typeStr}"); 22 | 23 | var headerSize = new TreeNode($"Header size: {_audio.Header.Length}"); 24 | var dataSize = new TreeNode($"Data size: {_audio.Data.Length}"); 25 | 26 | treeView.Items.AddRange(new List() { type, headerSize, dataSize }); 27 | 28 | return treeView; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ACViewer/FileTypes/SpellComponentsTable.cs: -------------------------------------------------------------------------------- 1 | using ACViewer.Entity; 2 | 3 | namespace ACViewer.FileTypes 4 | { 5 | public class SpellComponentsTable 6 | { 7 | public ACE.DatLoader.FileTypes.SpellComponentsTable _spellComponentsTable; 8 | 9 | public SpellComponentsTable(ACE.DatLoader.FileTypes.SpellComponentsTable spellComponentsTable) 10 | { 11 | _spellComponentsTable = spellComponentsTable; 12 | } 13 | 14 | public TreeNode BuildTree() 15 | { 16 | var treeView = new TreeNode($"{_spellComponentsTable.Id:X8}"); 17 | 18 | foreach (var kvp in _spellComponentsTable.SpellComponents) 19 | { 20 | var spellComponentNode = new TreeNode($"{kvp.Key}: {kvp.Value.Name}"); 21 | spellComponentNode.Items = new Entity.SpellComponentBase(kvp.Value).BuildTree(); 22 | 23 | treeView.Items.Add(spellComponentNode); 24 | } 25 | return treeView; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ACViewer/FileTypes/SurfaceTexture.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using ACViewer.Entity; 4 | 5 | namespace ACViewer.FileTypes 6 | { 7 | public class SurfaceTexture 8 | { 9 | public ACE.DatLoader.FileTypes.SurfaceTexture _surfaceTexture; 10 | 11 | public SurfaceTexture(ACE.DatLoader.FileTypes.SurfaceTexture surfaceTexture) 12 | { 13 | _surfaceTexture = surfaceTexture; 14 | } 15 | 16 | public TreeNode BuildTree() 17 | { 18 | var treeView = new TreeNode($"{_surfaceTexture.Id:X8}"); 19 | 20 | var unknown = new TreeNode($"Unknown: {_surfaceTexture.Unknown}"); 21 | var unknownByte = new TreeNode($"UnknownByte: {_surfaceTexture.UnknownByte}"); 22 | 23 | var textures = new TreeNode("Textures:"); 24 | foreach (var textureID in _surfaceTexture.Textures) 25 | textures.Items.Add(new TreeNode($"{textureID:X8}", clickable: true)); 26 | 27 | treeView.Items.AddRange(new List() { unknown, unknownByte, textures }); 28 | 29 | return treeView; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ACViewer/FileTypes/TabooTable.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | using ACViewer.Entity; 4 | 5 | namespace ACViewer.FileTypes 6 | { 7 | public class TabooTable 8 | { 9 | public ACE.DatLoader.FileTypes.TabooTable _tabooTable; 10 | 11 | public TabooTable(ACE.DatLoader.FileTypes.TabooTable tabooTable) 12 | { 13 | _tabooTable = tabooTable; 14 | } 15 | 16 | public TreeNode BuildTree() 17 | { 18 | var treeView = new TreeNode($"{_tabooTable.Id:X8}"); 19 | 20 | foreach (var kvp in _tabooTable.TabooTableEntries.OrderBy(i => i.Key)) 21 | { 22 | var keyNode = new TreeNode(kvp.Key.ToString("X8")); 23 | 24 | var entry = kvp.Value; 25 | 26 | foreach (var bannedPattern in entry.BannedPatterns) 27 | keyNode.Items.Add(new TreeNode(bannedPattern)); 28 | 29 | treeView.Items.Add(keyNode); 30 | } 31 | return treeView; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ACViewer/History.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer 4 | { 5 | /// 6 | /// DID history 7 | /// 8 | public class History 9 | { 10 | private static readonly int MaxSize = 50; 11 | 12 | private readonly List DID = new List(); 13 | 14 | public void Add(uint did) 15 | { 16 | // don't add consecutive duplicates 17 | if (DID.Count > 0 && DID[DID.Count - 1] == did) 18 | return; 19 | 20 | DID.Add(did); 21 | 22 | if (DID.Count > MaxSize) 23 | DID.RemoveAt(0); 24 | } 25 | 26 | public void Clear() 27 | { 28 | DID.Clear(); 29 | } 30 | 31 | public uint? Pop() 32 | { 33 | if (DID.Count <= 1) return null; 34 | 35 | DID.RemoveAt(DID.Count - 1); 36 | 37 | return DID[DID.Count - 1]; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ACViewer/Icons/Checkmark_16x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Icons/Checkmark_16x.png -------------------------------------------------------------------------------- /ACViewer/Icons/HelpApplication_16x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Icons/HelpApplication_16x.png -------------------------------------------------------------------------------- /ACViewer/Icons/OpenFile_16x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Icons/OpenFile_16x.png -------------------------------------------------------------------------------- /ACViewer/Icons/Question_16x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Icons/Question_16x.png -------------------------------------------------------------------------------- /ACViewer/Icons/Search_16x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Icons/Search_16x.png -------------------------------------------------------------------------------- /ACViewer/Icons/Settings_16x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Icons/Settings_16x.png -------------------------------------------------------------------------------- /ACViewer/Icons/Settings_16x_inverted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Icons/Settings_16x_inverted.png -------------------------------------------------------------------------------- /ACViewer/Icons/StatusCriticalError_16x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Icons/StatusCriticalError_16x.png -------------------------------------------------------------------------------- /ACViewer/Icons/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Icons/about.png -------------------------------------------------------------------------------- /ACViewer/Icons/armor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Icons/armor.png -------------------------------------------------------------------------------- /ACViewer/Icons/export-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Icons/export-file.png -------------------------------------------------------------------------------- /ACViewer/Icons/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Icons/help.png -------------------------------------------------------------------------------- /ACViewer/Icons/plume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Icons/plume.png -------------------------------------------------------------------------------- /ACViewer/Icons/portal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Icons/portal.png -------------------------------------------------------------------------------- /ACViewer/Icons/question-mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACEmulator/ACViewer/ceed7b1a3931ca952671cc6868303a659af1be66/ACViewer/Icons/question-mark.png -------------------------------------------------------------------------------- /ACViewer/Model/GfxObjCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace ACViewer.Model 5 | { 6 | public static class GfxObjCache 7 | { 8 | public static Dictionary Cache { get; set; } 9 | 10 | static GfxObjCache() 11 | { 12 | Init(); 13 | } 14 | 15 | public static void Init() 16 | { 17 | Cache = new Dictionary(); 18 | } 19 | 20 | public static GfxObj Get(uint gfxObjID) 21 | { 22 | if (!Cache.TryGetValue(gfxObjID, out var gfxObj)) 23 | { 24 | //Console.WriteLine($"- Loading {gfxObjID:X8}"); 25 | gfxObj = new GfxObj(gfxObjID); 26 | Cache.Add(gfxObjID, gfxObj); 27 | } 28 | return gfxObj; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ACViewer/Model/GfxObjInstance.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Xna.Framework; 2 | 3 | namespace ACViewer.Model 4 | { 5 | public class GfxObjInstance 6 | { 7 | public GfxObj GfxObj { get; set; } 8 | 9 | public Vector3 Position { get; set; } 10 | public Quaternion Rotation { get; set; } 11 | public Vector3 Scale { get; set; } 12 | 13 | public GfxObjInstance(uint gfxObjID) 14 | { 15 | GfxObj = GfxObjCache.Get(gfxObjID); 16 | 17 | Position = Vector3.Zero; 18 | Rotation = Quaternion.Identity; 19 | Scale = Vector3.One; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ACViewer/Model/InstanceBufferStats.cs: -------------------------------------------------------------------------------- 1 | namespace ACViewer.Model 2 | { 3 | public class InstanceBufferStats 4 | { 5 | public int TotalUninstancedVertices; 6 | public int TotalVerticesWithInstancing; 7 | public int TotalUniqueGfxObjIDs; 8 | public int TotalDrawCalls; 9 | 10 | public override string ToString() 11 | { 12 | return $"{TotalUninstancedVertices:N0} / {TotalVerticesWithInstancing:N0} / {TotalUniqueGfxObjIDs:N0} / {TotalDrawCalls:N0}"; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ACViewer/Model/MaterialIdx.cs: -------------------------------------------------------------------------------- 1 | using Assimp; 2 | 3 | namespace ACViewer.Model 4 | { 5 | public class MaterialIdx 6 | { 7 | public int MaterialId { get; set; } 8 | public Material Material { get; set; } 9 | 10 | public MaterialIdx(int materialId, Material material = null) 11 | { 12 | MaterialId = materialId; 13 | Material = material; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ACViewer/Model/PartChange.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Model 4 | { 5 | public class PartChange 6 | { 7 | public uint NewGfxObjId { get; set; } 8 | public Dictionary TextureChanges { get; set; } 9 | 10 | public PartChange(uint newGfxObjId) 11 | { 12 | NewGfxObjId = newGfxObjId; 13 | } 14 | 15 | public void AddTexture(uint oldTexture, uint newTexture) 16 | { 17 | if (TextureChanges == null) 18 | TextureChanges = new Dictionary(); 19 | 20 | //TextureChanges.Add(oldTexture, newTexture); 21 | TextureChanges[oldTexture] = newTexture; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ACViewer/Model/PickResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using ACE.Server.Physics; 4 | using ACE.Server.Physics.Common; 5 | 6 | using ACViewer.Enum; 7 | 8 | namespace ACViewer.Model 9 | { 10 | public class PickResult 11 | { 12 | public PickType Type { get; set; } 13 | public ObjCell ObjCell { get; set; } 14 | public PhysicsObj PhysicsObj { get; set; } 15 | public int PartIdx { get; set; } 16 | public ushort PolyIdx { get; set; } 17 | 18 | public ACE.Server.Physics.Polygon HitPoly { get; set; } // only needed for ObjCell single poly mode 19 | 20 | public DateTime ClickTime { get; set; } 21 | 22 | public static readonly TimeSpan DoubleClickTime = TimeSpan.FromSeconds(0.5f); 23 | 24 | public PickResult() 25 | { 26 | ClickTime = DateTime.Now; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ACViewer/Model/SetupCache.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Model 4 | { 5 | public static class SetupCache 6 | { 7 | public static Dictionary Cache { get; set; } 8 | 9 | static SetupCache() 10 | { 11 | Init(); 12 | } 13 | 14 | public static void Init() 15 | { 16 | Cache = new Dictionary(); 17 | } 18 | 19 | public static Setup Get(uint setupID) 20 | { 21 | if (!Cache.TryGetValue(setupID, out var setup)) 22 | { 23 | setup = new Setup(setupID); 24 | Cache.Add(setupID, setup); 25 | } 26 | return setup; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ACViewer/Model/VertexInstanceEnv.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Xna.Framework; 2 | using Microsoft.Xna.Framework.Graphics; 3 | 4 | namespace ACViewer 5 | { 6 | public struct VertexInstanceEnv : IVertexType 7 | { 8 | public Vector3 Position { get; set; } 9 | public Vector4 Rotation { get; set; } 10 | 11 | public readonly static VertexDeclaration VertexDeclaration = new VertexDeclaration 12 | ( 13 | new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 1), 14 | new VertexElement(sizeof(float) * 3, VertexElementFormat.Vector4, VertexElementUsage.TextureCoordinate, 1) 15 | ); 16 | 17 | public VertexInstanceEnv(Vector3 position, Quaternion rotation) 18 | { 19 | Position = position; 20 | Rotation = new Vector4(rotation.X, rotation.Y, rotation.Z, rotation.W); 21 | } 22 | 23 | VertexDeclaration IVertexType.VertexDeclaration => VertexDeclaration; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACViewer/Model/VertexUV.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ACViewer.Model 4 | { 5 | public class VertexUV: IEquatable 6 | { 7 | public int VertexIdx { get; set; } 8 | public int UVIdx { get; set; } 9 | 10 | public VertexUV(int vertexIdx, int uvIdx) 11 | { 12 | VertexIdx = vertexIdx; 13 | UVIdx = uvIdx; 14 | } 15 | 16 | public bool Equals(VertexUV v) 17 | { 18 | return VertexIdx == v.VertexIdx && UVIdx == v.UVIdx; 19 | } 20 | 21 | public override int GetHashCode() 22 | { 23 | int hash = 0; 24 | 25 | hash = (hash * 397) ^ VertexIdx.GetHashCode(); 26 | hash = (hash * 397) ^ UVIdx.GetHashCode(); 27 | 28 | return hash; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ACViewer/Physics/Animation/ActionNode.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Animation 2 | { 3 | public class ActionNode 4 | { 5 | public uint Action; 6 | public float Speed; 7 | public int Stamp; 8 | public bool Autonomous; 9 | 10 | public ActionNode() { } 11 | 12 | public ActionNode(uint action, float speed, int stamp, bool autonomous) 13 | { 14 | Action = action; 15 | Speed = speed; 16 | Stamp = stamp; 17 | Autonomous = autonomous; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ACViewer/Physics/Animation/AnimData.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Animation 2 | { 3 | public class AnimData 4 | { 5 | public uint AnimID; 6 | public int LowFrame; 7 | public int HighFrame; 8 | public float Framerate; 9 | 10 | public AnimData() { } 11 | 12 | public AnimData(DatLoader.Entity.AnimData animData, float speed = 1.0f) 13 | { 14 | AnimID = animData.AnimId; 15 | LowFrame = animData.LowFrame; 16 | HighFrame = animData.HighFrame; 17 | Framerate = animData.Framerate * speed; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ACViewer/Physics/Animation/AnimNode.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Animation 2 | { 3 | public class AnimNode 4 | { 5 | public uint Motion; 6 | public uint NumAnims; 7 | 8 | public AnimNode() { } 9 | 10 | public AnimNode(uint motion, uint numAnims) 11 | { 12 | Motion = motion; 13 | NumAnims = numAnims; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ACViewer/Physics/Animation/Animation.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using ACE.DatLoader.Entity; 3 | 4 | namespace ACE.Server.Physics.Animation 5 | { 6 | public class Animation 7 | { 8 | public uint ID; 9 | public List PosFrames; 10 | public List PartFrames; 11 | public bool HasHooks; 12 | public uint NumParts; 13 | public uint NumFrames; 14 | 15 | public Animation() { } 16 | 17 | public Animation(DatLoader.FileTypes.Animation anim) 18 | { 19 | ID = anim.Id; 20 | HasHooks = false; // comes from bitfield? 21 | NumParts = anim.NumParts; 22 | NumFrames = anim.NumFrames; 23 | PartFrames = anim.PartFrames; 24 | PosFrames = new List(); 25 | foreach (var posFrame in anim.PosFrames) 26 | PosFrames.Add(new AFrame(posFrame)); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ACViewer/Physics/Animation/InterpolationNode.cs: -------------------------------------------------------------------------------- 1 | using System.Numerics; 2 | using ACE.Server.Physics.Common; 3 | 4 | namespace ACE.Server.Physics.Animation 5 | { 6 | public enum InterpolationNodeType 7 | { 8 | InvalidType = 0x0, 9 | PositionType = 0x1, 10 | JumpType = 0x2, 11 | VelocityType = 0x3, 12 | }; 13 | 14 | public class InterpolationNode 15 | { 16 | public InterpolationNodeType Type; 17 | public Position Position; 18 | public Vector3 Velocity; 19 | public float Extent; 20 | 21 | public InterpolationNode() { } 22 | 23 | public InterpolationNode(InterpolationNodeType type, Position position) 24 | { 25 | Type = type; 26 | Position = position; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ACViewer/Physics/Animation/Motion.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Animation.Internal 2 | { 3 | public class Motion 4 | { 5 | public uint ID; 6 | public float SpeedMod; 7 | 8 | public Motion() { } 9 | 10 | public Motion(uint id, float speedMod = 1.0f) 11 | { 12 | ID = id; 13 | SpeedMod = speedMod; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ACViewer/Physics/Animation/MotionNode.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity.Enum; 2 | 3 | namespace ACE.Server.Physics.Animation 4 | { 5 | public class MotionNode 6 | { 7 | public int ContextID; 8 | public uint Motion; 9 | public WeenieError JumpErrorCode; 10 | 11 | public MotionNode() { } 12 | 13 | public MotionNode(int contextID, uint motion, WeenieError jumpErrorCode) 14 | { 15 | ContextID = contextID; 16 | Motion = motion; 17 | JumpErrorCode = jumpErrorCode; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ACViewer/Physics/Animation/MovementNode.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity.Enum; 2 | 3 | namespace ACE.Server.Physics.Animation 4 | { 5 | public class MovementNode 6 | { 7 | public MovementType Type; 8 | public float Heading; 9 | 10 | public MovementNode() { } 11 | 12 | public MovementNode(MovementType type, float heading = 0.0f) 13 | { 14 | Type = type; 15 | Heading = heading; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ACViewer/Physics/Animation/MovementStruct.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity.Enum; 2 | using ACE.Server.Physics.Common; 3 | 4 | namespace ACE.Server.Physics.Animation 5 | { 6 | public class MovementStruct 7 | { 8 | public MovementType Type; 9 | public uint Motion; 10 | public uint ObjectId; 11 | public uint TopLevelId; 12 | public Position Position; 13 | public float Radius; 14 | public float Height; 15 | public MovementParameters Params; 16 | 17 | public MovementStruct() { } 18 | 19 | public MovementStruct(MovementType type) 20 | { 21 | Type = type; 22 | } 23 | 24 | public MovementStruct(MovementType type, uint motion, MovementParameters movementParams) 25 | { 26 | Type = type; 27 | Motion = motion; 28 | Params = movementParams; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ACViewer/Physics/BSP/PortalPoly.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ACE.Server.Physics.BSP 4 | { 5 | public class PortalPoly: IEquatable 6 | { 7 | public int PortalIdx; 8 | public Polygon Portal; 9 | 10 | public PortalPoly() 11 | { 12 | PortalIdx = -1; 13 | } 14 | 15 | public bool Equals(PortalPoly pPoly) 16 | { 17 | return PortalIdx == pPoly.PortalIdx && Portal.Equals(pPoly.Portal); 18 | } 19 | 20 | public override int GetHashCode() 21 | { 22 | int hash = 0; 23 | 24 | hash = (hash * 397) ^ PortalIdx.GetHashCode(); 25 | hash = (hash * 397) ^ Portal.GetHashCode(); 26 | 27 | return hash; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ACViewer/Physics/Collision/CollisionRecord.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Collision 2 | { 3 | public class CollisionRecord 4 | { 5 | public double TouchedTime; 6 | public bool Ethereal; 7 | 8 | public CollisionRecord(double touchedTime, bool ethereal) 9 | { 10 | TouchedTime = touchedTime; 11 | Ethereal = ethereal; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ACViewer/Physics/Collision/EnvCollisionProfile.cs: -------------------------------------------------------------------------------- 1 | using System.Numerics; 2 | 3 | namespace ACE.Server.Physics.Collision 4 | { 5 | public enum EnvCollisionProfileFlags 6 | { 7 | Undefined = 0x0, 8 | MyContact = 0x1, 9 | }; 10 | 11 | public class EnvCollisionProfile 12 | { 13 | public Vector3 Velocity; 14 | public EnvCollisionProfileFlags Flags; 15 | 16 | public void SetMeInContact(bool hasContact) 17 | { 18 | if (hasContact) 19 | Flags = EnvCollisionProfileFlags.MyContact; 20 | else 21 | Flags = EnvCollisionProfileFlags.Undefined; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ACViewer/Physics/Combat/AtkCollisionProfile.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity.Enum; 2 | using ACE.Server.Physics.Collision; 3 | 4 | namespace ACE.Server.Physics.Combat 5 | { 6 | public class AtkCollisionProfile : ObjCollisionProfile 7 | { 8 | public int Part; 9 | public Quadrant Location; 10 | 11 | public AtkCollisionProfile() { } 12 | 13 | public AtkCollisionProfile(uint id, int part, Quadrant location) 14 | { 15 | ID = id; 16 | Part = part; 17 | Location = location; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ACViewer/Physics/Combat/AtkObjInfo.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity.Enum; 2 | 3 | namespace ACE.Server.Physics.Combat 4 | { 5 | public class AtkObjInfo 6 | { 7 | public uint ObjectID; 8 | public Quadrant HitLocation; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ACViewer/Physics/Combat/AttackCone.cs: -------------------------------------------------------------------------------- 1 | using System.Numerics; 2 | 3 | namespace ACE.Server.Physics.Combat 4 | { 5 | public class AttackCone 6 | { 7 | public int PartIdx; 8 | public Vector2 Left; 9 | public Vector2 Right; 10 | public float Radius; 11 | public float Height; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ACViewer/Physics/Combat/AttackInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using ACE.Entity.Enum; 3 | 4 | namespace ACE.Server.Physics.Combat 5 | { 6 | public class AttackInfo 7 | { 8 | public int AttackID; 9 | public int PartIndex; 10 | public float AttackRadius; 11 | public bool WaitingForCells; 12 | public int NumObjects; 13 | public List ObjectList; 14 | 15 | public void AddObject(uint objectID, Quadrant hitLocation) 16 | { 17 | 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ACViewer/Physics/Combat/DetectionCylsphere.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Combat 2 | { 3 | public class DetectionCylsphere 4 | { 5 | public int ContextID; 6 | public float Radius; 7 | public int ObjectDetected; 8 | public DetectionInfo Info; 9 | public int DetectionType; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ACViewer/Physics/Combat/DetectionInfo.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Combat 2 | { 3 | public enum DetectionType 4 | { 5 | NoChangeDetection = 0x0, 6 | EnteredDetection = 0x1, 7 | LeftDetection = 0x2, 8 | }; 9 | 10 | public class DetectionInfo 11 | { 12 | public uint ObjectID; 13 | public DetectionType Status; 14 | 15 | public DetectionInfo() { } 16 | 17 | public DetectionInfo(uint objectID, DetectionType status) 18 | { 19 | ObjectID = objectID; 20 | Status = status; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ACViewer/Physics/Combat/TargettedVoyeurInfo.cs: -------------------------------------------------------------------------------- 1 | using ACE.Server.Physics.Common; 2 | 3 | namespace ACE.Server.Physics.Combat 4 | { 5 | public class TargettedVoyeurInfo 6 | { 7 | public uint ObjectID; 8 | public double Quantum; 9 | public float Radius; 10 | public Position LastSentPosition; 11 | 12 | public TargettedVoyeurInfo() { } 13 | 14 | public TargettedVoyeurInfo(uint objectID, float radius, double quantum) 15 | { 16 | ObjectID = objectID; 17 | Quantum = quantum; 18 | Radius = radius; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ACViewer/Physics/Command/CmdStruct.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity.Enum; 2 | 3 | namespace ACE.Server.Physics.Command 4 | { 5 | public class CmdStruct 6 | { 7 | public uint[] Args = new uint[64]; 8 | public uint Size; 9 | public uint Curr; 10 | public MotionCommand Command; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ACViewer/Physics/Command/CommandListElement.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity.Enum; 2 | 3 | namespace ACE.Server.Physics.Command 4 | { 5 | public class CommandListElement 6 | { 7 | public CommandListElement Next; 8 | public CommandListElement Prev; 9 | 10 | public MotionCommand Command; 11 | public float Speed; 12 | public bool HoldRun; 13 | 14 | public CommandListElement() 15 | { 16 | Speed = 1.0f; 17 | } 18 | 19 | public CommandListElement(MotionCommand command, float speed, bool holdRun) 20 | { 21 | Command = command; 22 | Speed = speed; 23 | HoldRun = holdRun; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ACViewer/Physics/Command/InputEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ACE.Server.Physics.Command 6 | { 7 | public class InputEvent 8 | { 9 | public uint InputAction; 10 | public bool Start; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/AddUpdateObjs.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACE.Server.Physics.Common 4 | { 5 | public class AddUpdateObjs 6 | { 7 | public List AddObjects; 8 | public List UpdateObjects; 9 | 10 | public AddUpdateObjs(List addObjects, List updateObjects) 11 | { 12 | AddObjects = addObjects; 13 | UpdateObjects = updateObjects; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/ChatRoomTracker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ACE.Server.Physics.Common 6 | { 7 | public class ChatRoomTracker 8 | { 9 | public static uint GetGlobalTradeRoomID(PhysicsDesc desc) 10 | { 11 | return 0; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/HookAppraisalProfile.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Common 2 | { 3 | public class HookAppraisalProfile 4 | { 5 | public int Bitfield; 6 | public int ValidLocations; 7 | 8 | public static bool GetValidLocations(PhysicsDesc desc) 9 | { 10 | return false; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/LostCell.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACE.Server.Physics.Common 4 | { 5 | public class LostCell 6 | { 7 | public int NumObjects; 8 | public List Objects; 9 | 10 | public LostCell() 11 | { 12 | Objects = new List(); 13 | } 14 | 15 | public void Clear() 16 | { 17 | Objects.Clear(); 18 | NumObjects = 0; 19 | } 20 | 21 | public void remove_object(PhysicsObj obj) 22 | { 23 | Objects.Remove(obj); 24 | NumObjects = Objects.Count; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/MasterDBMap.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Common 2 | { 3 | public class MasterDBMap 4 | { 5 | public static uint DivineType(uint dataDID) 6 | { 7 | var type = dataDID >> 24; 8 | if (type == 0x01) 9 | return 6; 10 | else if (type == 0x02) 11 | return 7; 12 | else 13 | return 0; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/ObjCache.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using ACE.Server.Physics.Animation; 3 | 4 | namespace ACE.Server.Physics.Common 5 | { 6 | public static class ObjCache 7 | { 8 | public static Dictionary MotionTables; 9 | 10 | static ObjCache() 11 | { 12 | MotionTables = new Dictionary(); 13 | } 14 | 15 | public static MotionTable GetMotionTable(uint id) 16 | { 17 | MotionTable mtable = null; 18 | MotionTables.TryGetValue(id, out mtable); 19 | return mtable; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/PalShiftRoadCode.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Common 2 | { 3 | public class PalShiftRoadCode 4 | { 5 | public uint RoadCode; 6 | public LandDefs.PalType SubPalType; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/PalShiftSubPal.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Common 2 | { 3 | public class PalShiftSubPal 4 | { 5 | public uint SubPalIndex; 6 | public uint SubPalLength; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/PalShiftTerrainPal.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Common 2 | { 3 | public class PalShiftTerrainPal 4 | { 5 | public LandDefs.TerrainType TerrainIndex; 6 | public uint PalID; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/PalShiftTex.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACE.Server.Physics.Common 4 | { 5 | public class PalShiftTex 6 | { 7 | public uint TexGID; 8 | public List SubPal; 9 | public List RoadCode; 10 | public List TerrainPal; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/Palette.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Common 2 | { 3 | public class Palette 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/PhysicsTimer.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace ACE.Server.Physics.Common 4 | { 5 | /// 6 | /// This should only be used by the ACE.Server.Physics namespace and physics related properties 7 | /// For a equally precise timer outside of this namespace, you can use WorldManager.PortalYearTicks 8 | /// 9 | public class PhysicsTimer 10 | { 11 | private static readonly Stopwatch _timer; 12 | 13 | /// 14 | /// This should only be used by the ACE.Server.Physics namespace and physics related properties 15 | /// For a equally precise timer outside of this namespace, you can use WorldManager.PortalYearTicks 16 | /// 17 | public static double CurrentTime => _timer.Elapsed.TotalSeconds; 18 | 19 | static PhysicsTimer() 20 | { 21 | _timer = Stopwatch.StartNew(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/QualifiedDataID.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Common 2 | { 3 | public class QualifiedDataID 4 | { 5 | public uint Type; 6 | public uint ID; 7 | 8 | public QualifiedDataID(uint type, uint id) 9 | { 10 | // todo: use ACE data structures 11 | Type = type; 12 | ID = id; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/RegionDesc.cs: -------------------------------------------------------------------------------- 1 | using ACE.DatLoader.Entity; 2 | 3 | namespace ACE.Server.Physics.Common 4 | { 5 | public class RegionDesc 6 | { 7 | public uint RegionNum; 8 | public string Name; 9 | public int Version; 10 | public bool MinimizePal; 11 | public uint PartsMask; 12 | //public FileNameDesc FileInfo; 13 | public SkyDesc SkyInfo; 14 | public SoundDesc SoundInfo; 15 | public SceneDesc SceneInfo; 16 | public TerrainDesc TerrainInfo; 17 | //public EncounterDesc EncounterInfo; 18 | //public WaterDesc WaterInfo; 19 | //public FogDesc FogInfo; 20 | //public DistanceFogDesc DistFogInfo; 21 | //public RegionMapDesc RegionMapInfo; 22 | public RegionMisc RegionMisc; 23 | 24 | public RegionDesc(uint gid) 25 | { 26 | Version = -1; 27 | MinimizePal = true; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/Render.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Common 2 | { 3 | public class Render 4 | { 5 | public static float ParticleDistance2DSquared = float.MaxValue; 6 | public static float ObjectDistance2DSquared = float.MaxValue; 7 | 8 | public static Position ViewerPos; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/RoadAlphaMap.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Common 2 | { 3 | public class RoadAlphaMap 4 | { 5 | public DatLoader.Entity.RoadAlphaMap _alphaMap; 6 | 7 | public uint RCode; 8 | public uint RoadTexGID; 9 | public ImgTex Texture; 10 | 11 | public static readonly RoadAlphaMap NULL; 12 | 13 | public RoadAlphaMap(DatLoader.Entity.RoadAlphaMap alphaMap) 14 | { 15 | _alphaMap = alphaMap; 16 | 17 | RCode = alphaMap.RCode; 18 | RoadTexGID = alphaMap.RoadTexGID; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/ShadowObj.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Common 2 | { 3 | public class ShadowObj 4 | { 5 | public PhysicsObj PhysicsObj; 6 | public ObjCell Cell; 7 | 8 | public ShadowObj(PhysicsObj physicsObj, ObjCell cell) 9 | { 10 | PhysicsObj = physicsObj; 11 | Cell = cell; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/ShadowPart.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Numerics; 3 | using ACE.Server.Physics.Animation; 4 | 5 | namespace ACE.Server.Physics.Common 6 | { 7 | public class ShadowPart 8 | { 9 | public int NumPlanes; 10 | public List Planes; // ClipPlaneList 11 | public AFrame Frame; 12 | public PhysicsPart Part; 13 | 14 | public ShadowPart() { } 15 | 16 | public ShadowPart(int numPlanes, List planes, AFrame frame, PhysicsPart part) 17 | { 18 | NumPlanes = numPlanes; 19 | Planes = planes; 20 | Frame = frame; 21 | Part = part; 22 | } 23 | 24 | public ShadowPart(List planes, AFrame frame, PhysicsPart part) 25 | { 26 | NumPlanes = planes != null ? planes.Count : 0; 27 | Planes = planes; 28 | Frame = frame; 29 | Part = part; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/SubPalette.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Common 2 | { 3 | public class SubPalette 4 | { 5 | public uint SubID; 6 | public uint Offset; 7 | public uint NumColors; 8 | public SubPalette Prev; 9 | public SubPalette Next; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/SurfInfo.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Common 2 | { 3 | public class SurfInfo 4 | { 5 | public uint PalCode; 6 | public uint LCellCount; 7 | public Surface Surface; 8 | public uint SurfNum; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/TMTerrainDesc.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Common 2 | { 3 | public class TMTerrainDesc 4 | { 5 | public DatLoader.Entity.TMTerrainDesc _terrainDesc; 6 | 7 | public LandDefs.TerrainType TerrainType; 8 | public TerrainTex TerrainTex; 9 | 10 | public TMTerrainDesc(DatLoader.Entity.TMTerrainDesc terrainDesc) 11 | { 12 | _terrainDesc = terrainDesc; 13 | 14 | TerrainType = (LandDefs.TerrainType)terrainDesc.TerrainType; 15 | TerrainTex = new TerrainTex(_terrainDesc.TerrainTex); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/TerrainAlphaMap.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Common 2 | { 3 | public class TerrainAlphaMap 4 | { 5 | public DatLoader.Entity.TerrainAlphaMap _alphaMap; 6 | 7 | public uint TCode; 8 | public uint TexGID; 9 | public ImgTex Texture; 10 | 11 | public static readonly TerrainAlphaMap NULL; 12 | 13 | public TerrainAlphaMap() { } 14 | 15 | public TerrainAlphaMap(DatLoader.Entity.TerrainAlphaMap alphaMap) 16 | { 17 | _alphaMap = alphaMap; 18 | 19 | TCode = alphaMap.TCode; 20 | TexGID = alphaMap.TexGID; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/Vector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Numerics; 3 | 4 | namespace ACE.Server.Physics.Common 5 | { 6 | public static class Vec 7 | { 8 | public static bool NormalizeCheckSmall(ref Vector3 v) 9 | { 10 | var dist = v.Length(); 11 | if (dist < PhysicsGlobals.EPSILON) 12 | return true; 13 | 14 | v *= 1.0f / dist; 15 | return false; 16 | } 17 | 18 | public static bool IsZero(Vector3 v) 19 | { 20 | return Math.Abs(v.X) < PhysicsGlobals.EPSILON && 21 | Math.Abs(v.Y) < PhysicsGlobals.EPSILON && 22 | Math.Abs(v.Z) < PhysicsGlobals.EPSILON; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/VertexArray.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using ACE.Entity.Enum; 3 | using ACE.Server.Physics.Entity; 4 | 5 | namespace ACE.Server.Physics.Common 6 | { 7 | public class VertexArray 8 | { 9 | public VertexType Type; 10 | public List Vertices; 11 | 12 | public VertexArray() 13 | { 14 | Vertices = new List(); 15 | } 16 | 17 | public VertexArray(VertexType type, int numVerts) 18 | { 19 | Vertices = new List(numVerts); 20 | Type = type; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ACViewer/Physics/Common/WeenieDesc.cs: -------------------------------------------------------------------------------- 1 | using ACE.DatLoader.Entity; 2 | 3 | namespace ACE.Server.Physics.Common 4 | { 5 | public class WeenieDesc 6 | { 7 | public static void Destroy(Animation.AnimData animData) 8 | { 9 | 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ACViewer/Physics/Extensions/FloatExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ACE.Server.Physics.Extensions 4 | { 5 | public static class FloatExtensions 6 | { 7 | public static float ToRadians(this float angle) 8 | { 9 | return (float)(Math.PI / 180.0f * angle); 10 | } 11 | 12 | public static float ToDegrees(this float rads) 13 | { 14 | return (float)(180.0f / Math.PI * rads); 15 | } 16 | 17 | public static float Clamp(this float f, float min, float max) 18 | { 19 | if (f < min) 20 | f = min; 21 | if (f > max) 22 | f = max; 23 | return f; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ACViewer/Physics/Extensions/ListExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using ACE.Server.Physics.Common; 4 | 5 | namespace ACE.Server.Physics.Extensions 6 | { 7 | public static class ListExtensions 8 | { 9 | public static void Shuffle(this IList list) 10 | { 11 | int n = list.Count; 12 | while (n > 1) 13 | { 14 | n--; 15 | int k = Random.RollDice(0, n); 16 | T value = list[k]; 17 | list[k] = list[n]; 18 | list[n] = value; 19 | } 20 | } 21 | 22 | public static float Product(this IList list) 23 | { 24 | var totalProduct = 1.0f; 25 | foreach (var item in list) 26 | totalProduct *= item; 27 | 28 | return totalProduct; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ACViewer/Physics/Extensions/QuaternionExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Numerics; 3 | 4 | namespace ACE.Server.Physics.Extensions 5 | { 6 | public static class QuaternionExtensions 7 | { 8 | public static bool IsValid(this Quaternion q) 9 | { 10 | if (float.IsNaN(q.X) || float.IsNaN(q.Y) || float.IsNaN(q.Z) || float.IsNaN(q.W)) 11 | return false; 12 | 13 | var length = q.Length(); 14 | if (float.IsNaN(length)) 15 | return false; 16 | 17 | if (Math.Abs(length - 1.0f) > PhysicsGlobals.EPSILON * 5.0f) 18 | return false; 19 | 20 | return true; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ACViewer/Physics/Hooks/AnimHook.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using ACE.DatLoader.Entity; 3 | using ACE.DatLoader.Entity.AnimationHooks; 4 | using ACE.Entity.Enum; 5 | using ACE.Server.Physics.Animation; 6 | 7 | namespace ACE.Server.Physics.Hooks 8 | { 9 | public class AnimHook 10 | { 11 | public static void Execute(PhysicsObj obj, AnimationHook animHook) 12 | { 13 | switch (animHook.HookType) 14 | { 15 | case AnimationHookType.AnimationDone: 16 | obj.Hook_AnimDone(); 17 | break; 18 | 19 | /*case AnimationHookType.Ethereal: 20 | if (animHook is EtherealHook hook) 21 | obj.set_ethereal(Convert.ToBoolean(hook.Ethereal), false); 22 | break;*/ 23 | 24 | case AnimationHookType.CreateParticle: 25 | if (animHook is CreateParticleHook hook) 26 | obj.create_particle_emitter(hook.EmitterInfoId, (int)hook.PartIndex, new AFrame(hook.Offset), (int)hook.EmitterId); 27 | break; 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ACViewer/Physics/Hooks/PhysicsHookType.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Hooks 2 | { 3 | public enum PhysicsHookType 4 | { 5 | Scale = 0, 6 | Translucency = 1, 7 | PartTranslucency = 2, 8 | Luminosity = 3, 9 | Diffusion = 4, 10 | PartLuminosity = 5, 11 | PartDiffusion = 6, 12 | CallPES = 7, 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ACViewer/Physics/Hooks/PhysicsObjHook.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ACE.Server.Physics.Hooks 4 | { 5 | public class PhysicsObjHook 6 | { 7 | public PhysicsHookType HookType; 8 | public double TimeCreated; 9 | public double InterpolationTime; 10 | public Object UserData; 11 | 12 | public virtual bool Execute(PhysicsObj obj) 13 | { 14 | return false; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ACViewer/Physics/Hooks/VectorHook.cs: -------------------------------------------------------------------------------- 1 | using System.Numerics; 2 | 3 | namespace ACE.Server.Physics.Hooks 4 | { 5 | public class VectorHook: PhysicsObjHook 6 | { 7 | public Vector3 Start; 8 | public Vector3 End; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ACViewer/Physics/Managers/AttackManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACE.Server.Physics.Combat 4 | { 5 | public class AttackManager 6 | { 7 | public float AttackRadius; 8 | public int CurrentAttack; 9 | public HashSet PendingAttacks; 10 | 11 | public AttackInfo NewAttack(int partIdx) 12 | { 13 | return null; 14 | } 15 | 16 | public void AttackDone(AttackInfo attackInfo) 17 | { 18 | 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ACViewer/Physics/Managers/DetectionManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Numerics; 3 | using ACE.Server.Physics.Common; 4 | 5 | namespace ACE.Server.Physics.Combat 6 | { 7 | public class DetectionManager 8 | { 9 | public PhysicsObj PhysObj; 10 | public HashSet DetectionObjects; 11 | public int NumPendingGlobalDetectUpdates; 12 | public List CellArray; 13 | public double LastUpdateTime; 14 | public Vector3 LastGlobalUpdate; 15 | public HashSet DetectionTable; 16 | public List PendingDeletions; 17 | 18 | public void CheckDetection() 19 | { 20 | 21 | } 22 | 23 | public void ReceiveDetectionUpdate(DetectionInfo info) 24 | { 25 | 26 | } 27 | 28 | public void DestroyDetectionCylsphere(int contextID) 29 | { 30 | 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ACViewer/Physics/PhysObjProfile.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity.Enum; 2 | using ACE.Server.Physics.Animation; 3 | using ACE.Server.Physics.Sound; 4 | 5 | namespace ACE.Server.Physics 6 | { 7 | public class PhysObjProfile 8 | { 9 | public Setup Setup; 10 | public MotionTable MotionTable; 11 | public SoundTable SoundTable; 12 | public int PhysicsEffectTable; 13 | public int PhysicsBitmask; 14 | public int Placement; 15 | public double Scale; 16 | public double Friction; 17 | public double Elasticity; 18 | public double Translucency; 19 | public PlayScript DefaultScript; 20 | public double DefaultScriptIntensity; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ACViewer/Physics/Ray.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Numerics; 3 | 4 | namespace ACE.Server.Physics 5 | { 6 | public class Ray 7 | { 8 | public Vector3 Point; 9 | public Vector3 Dir; 10 | public float Length; 11 | 12 | public Ray() 13 | { 14 | 15 | } 16 | 17 | public Ray(Vector3 point, Vector3 dir, float length) 18 | { 19 | Point = point; 20 | Dir = dir; 21 | Length = length; 22 | } 23 | 24 | public Ray(Vector3 startPoint, Vector3 offset) 25 | { 26 | if (Math.Abs(offset.X - startPoint.X) > PhysicsGlobals.EPSILON || 27 | Math.Abs(offset.Y - startPoint.Y) > PhysicsGlobals.EPSILON || 28 | Math.Abs(offset.Z - startPoint.Z) > PhysicsGlobals.EPSILON) 29 | { 30 | Length = (float)Math.Sqrt(offset.X * offset.X + offset.Y * offset.Y + offset.Z * offset.Z); 31 | 32 | var invLength = 1.0f / Length; 33 | 34 | Point = startPoint; 35 | Dir = new Vector3(offset.X * invLength, offset.Y * invLength, offset.Z * invLength); 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ACViewer/Physics/Scripts/PhysicsScript.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics 2 | { 3 | public class PhysicsScript 4 | { 5 | public PhysicsScriptData Data; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACViewer/Physics/Scripts/PhysicsScriptData.cs: -------------------------------------------------------------------------------- 1 | using ACE.Server.Physics.Animation; 2 | using ACE.DatLoader.Entity; 3 | 4 | namespace ACE.Server.Physics 5 | { 6 | public class PhysicsScriptData 7 | { 8 | public double StartTime; 9 | public AnimationHook Hook; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ACViewer/Physics/Scripts/PhysicsScriptTable.cs: -------------------------------------------------------------------------------- 1 | using ACE.Entity.Enum; 2 | using System.Collections.Generic; 3 | 4 | namespace ACE.Server.Physics 5 | { 6 | public class PhysicsScriptTable 7 | { 8 | public Dictionary ScriptTable; 9 | 10 | public void Release() 11 | { 12 | 13 | } 14 | 15 | public uint GetScript(PlayScript? type, float? mod) 16 | { 17 | return 0; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ACViewer/Physics/Scripts/PhysicsScriptTableData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACE.Server.Physics 4 | { 5 | public class PhysicsScriptTableData 6 | { 7 | public List ScriptArray; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ACViewer/Physics/Scripts/ScriptAndModData.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics 2 | { 3 | public class ScriptAndModData 4 | { 5 | public float Mod; 6 | public int ScriptID; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ACViewer/Physics/Scripts/ScriptData.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics 2 | { 3 | public class ScriptData 4 | { 5 | public double StartTime; 6 | public PhysicsScript Script; 7 | public ScriptData NextData; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ACViewer/Physics/Scripts/ScriptManager.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics 2 | { 3 | public class ScriptManager 4 | { 5 | public PhysicsObj PhysObj; 6 | public ScriptData CurrData; 7 | public ScriptData LastData; 8 | public int HookIndex; 9 | public double NextHookTime; 10 | 11 | public ScriptManager() 12 | { 13 | 14 | } 15 | 16 | public ScriptManager(PhysicsObj obj) 17 | { 18 | PhysObj = obj; 19 | } 20 | 21 | public bool AddScript(uint scriptID) 22 | { 23 | return false; 24 | } 25 | 26 | public void UpdateScripts() 27 | { 28 | 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ACViewer/Physics/Sound/SoundData.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Sound 2 | { 3 | public class SoundData 4 | { 5 | public int SoundID; 6 | public float Priority; 7 | public float Probability; 8 | public float Volume; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ACViewer/Physics/Sound/SoundTable.cs: -------------------------------------------------------------------------------- 1 | namespace ACE.Server.Physics.Sound 2 | { 3 | public class SoundTable 4 | { 5 | public SoundTableData SoundData; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACViewer/Physics/Sound/SoundTableData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACE.Server.Physics.Sound 4 | { 5 | public class SoundTableData 6 | { 7 | public Dictionary SoundHash; 8 | public int NumSTDatas; 9 | public SoundData Data; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ACViewer/Physics/Util/AdjustPosProfile.cs: -------------------------------------------------------------------------------- 1 | using System.Numerics; 2 | 3 | namespace ACE.Server.Physics.Util 4 | { 5 | /// 6 | /// Defines the position adjustment for a dungeon 7 | /// given a bad position (usually the portal drop) from an outdated database 8 | /// and the matching good position from end-of-retail 9 | /// 10 | public class AdjustPosProfile 11 | { 12 | public Vector3 BadPosition; 13 | public Quaternion BadRotation; 14 | public Vector3 GoodPosition; 15 | public Quaternion GoodRotation; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ACViewer/Render/R_EnvironmentCache.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ACViewer.Render 4 | { 5 | public static class R_EnvironmentCache 6 | { 7 | public static Dictionary Cache { get; set; } 8 | 9 | static R_EnvironmentCache() 10 | { 11 | Cache = new Dictionary(); 12 | } 13 | 14 | public static R_Environment Get(uint envID) 15 | { 16 | Cache.TryGetValue(envID, out var env); 17 | 18 | if (env != null) 19 | return env; 20 | 21 | env = new R_Environment(envID); 22 | Cache.Add(envID, env); 23 | return env; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ACViewer/Render/R_PhysicsPart.cs: -------------------------------------------------------------------------------- 1 | using ACE.Server.Physics; 2 | 3 | namespace ACViewer.Render 4 | { 5 | public class R_PhysicsPart 6 | { 7 | // a physics part has 1 gfxobj 8 | // a gfxobj can have multiple polygons 9 | public PhysicsPart PhysicsPart { get; set; } 10 | public R_GfxObj R_GfxObj { get; set; } 11 | 12 | public R_PhysicsPart(PhysicsPart physicsPart) 13 | { 14 | PhysicsPart = physicsPart; 15 | R_GfxObj = new R_GfxObj(physicsPart.GfxObj, PhysicsPart.GfxObjScale.ToXna()); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ACViewer/Render/TextureFormatChain.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ACViewer.Render 4 | { 5 | public class TextureFormatChain : IEquatable 6 | { 7 | public TextureFormat TextureFormat { get; set; } 8 | public int AtlasChainIdx { get; set; } 9 | 10 | public TextureFormatChain(TextureFormat textureFormat, int atlasChainIdx) 11 | { 12 | TextureFormat = textureFormat; 13 | AtlasChainIdx = atlasChainIdx; 14 | } 15 | 16 | public bool Equals(TextureFormatChain textureFormatChain) 17 | { 18 | return TextureFormat.Equals(textureFormatChain.TextureFormat) && AtlasChainIdx == textureFormatChain.AtlasChainIdx; 19 | } 20 | 21 | public override int GetHashCode() 22 | { 23 | var hash = 0; 24 | 25 | hash = (hash * 397) ^ TextureFormat.GetHashCode(); 26 | hash = (hash * 397) ^ AtlasChainIdx.GetHashCode(); 27 | 28 | return hash; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ACViewer/View/About.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | Much thanks: the emulator teams, Pea, parad0x, OptimShi, and the AC community! 14 | 15 |