// .msa —— Metin2 动作描述(文本,ScriptType MotionData)。M2 T1。 #pragma once #include #include namespace fmt { struct MotionEvent { int type = 0; // MotionEventType(10=effect, 4/5=sound, ...) float start_time = 0; // StartingTime std::string effect_file; // EffectFileName(type 10) std::string sound_file; // SoundFileName float position[3] = {0, 0, 0}; }; struct Msa { std::string motion_gr2; // MotionFileName(原样,含 d:\... 前缀) float duration = 0; // MotionDuration float accumulation[3] = {0,0,0};// Accumulation(root motion 位移) std::vector events; bool has_loop_data = false; // LoopData 是片段循环,不等同于整段播放模式 int motion_loop_count = 0; // -1 无限;原客户端仅在 >1 或 -1 时回绕片段 bool loop_cancel_enable = false; float loop_start_time = 0; float loop_end_time = 0; }; bool parse_msa(const std::string& text, Msa& out, std::string* err); bool parse_msa_file(const std::string& path, Msa& out, std::string* err); } // namespace fmt