#pragma once
#include "Utils/MemoryUtils.h"
#include "SDK/Mob.h"

namespace Hooks {
	class Mobs {
	private:
		typedef int(__thiscall* mob_getcurrentswingduration_)(Mob*);
		inline static mob_getcurrentswingduration_ mob_getcurrentswingduration;

		static int callback_getcurrentswingduration(Mob* _this);
	public:
		inline static int state = -1;
		static void Init() {
			std::thread([&] {
				void* pattern = Utils::Memory::FindPattern(_("48 89 5C 24 10 48 89 6C 24 18 56 57 41 56 48 83 EC 30 8B 41"));

				state = Utils::Memory::CreateHook(pattern, (void*)&callback_getcurrentswingduration, &mob_getcurrentswingduration);

				if (state == 0)
					MessageBoxA(0, _("The program was terminated due to an error.\nError code: 1-6"), _("Valkyrie"), MB_ICONERROR);
				else
					std::cout << _("Test 1-6... OK\n");
				}).detach();
		}
	};
}
