#include "api.h"

#include <client.h>

namespace flyff {
namespace raw {
static const uintptr_t& WORLD = 0x00036050;
static const uintptr_t& PLAYER = WORLD + 4;

static const uintptr_t& PLAYER_OBJECT_ID = 0x00035090;
// The messages that are limited to 5 that are show temporarily.
static const uintptr_t& MESSAGES_UI = 0x00036060;
static const uintptr_t& ANNOUNCEMENTS_UI = 0x00034e2c;
static const uintptr_t& MOVER_MAP = 0x00033460;

extern "C" {
// get_mover
extern u32 w2c_f208(u64);
// get_text
extern void w2c_f167(u32, u32);
// show_message
extern void w2c_f341(u32, u32, u32);
// show_announcement
extern void w2c_f607(u32, u32, u32);
// can_attack_target
extern u32 w2c_f515(u32, u32);
};

static const auto& get_mover = w2c_f208;
static const auto& get_text = w2c_f167;
static const auto& show_message = w2c_f341;
static const auto& show_announcement = w2c_f607;
static const auto& can_attack_target = w2c_f515;
};  // namespace raw

const Pointer<Mover> Project::GetMover(const MoverID& id) {
    const auto& node = make_ref<Pointer<MoverMap::Node>>(raw::get_mover(id));

    return node ? node->mover : Pointer<Mover>(nullptr);
}

};  // namespace flyff