diff --git a/include/ac_ev_ghost.h b/include/ac_ev_ghost.h index c093321e..3c89a71a 100644 --- a/include/ac_ev_ghost.h +++ b/include/ac_ev_ghost.h @@ -3,11 +3,27 @@ #include "types.h" #include "m_actor.h" +#include "ac_npc.h" #ifdef __cplusplus extern "C" { #endif +typedef struct ev_ghost_s EV_GHOST_ACTOR; + +struct ev_ghost_s { + /* 0x000 */ NPC_ACTOR npc_class; + /* 0x994 */ void* think_proc; + /* 0x998 */ int msg_no; + /* 0x99C */ mActor_name_t give_item; + /* 0x99E */ s16 bye_bye_angle; + /* 0x9A0 */ u8 bye_bye_timer; + /* 0x9A1 */ u8 bye_bye_scale_timer; + /* 0x9A2 */ u8 bye_bye_transparency_delay_timer; + /* 0x9A3 */ u8 think_act; + /* 0x9A4 */ +}; + extern ACTOR_PROFILE Ev_Ghost_Profile; #ifdef __cplusplus diff --git a/include/m_event.h b/include/m_event.h index 8e7c8bfb..d5c0f840 100644 --- a/include/m_event.h +++ b/include/m_event.h @@ -364,12 +364,19 @@ typedef struct ghost_spirit_block_data_s { } mEv_gst_hitodama_block_c; #define mEv_GHOST_FLAG_ACTIVE 0x4000 // TODO: do these live in the ghost actor itself? +#define mEv_GHOST_FLAG_HITODAMA_EXIST 0x8000 typedef struct ghost_common_s { mEv_gst_hitodama_block_c hitodama_block_data; u16 flags; u8 _0C[0x2C - 0x0C]; } mEv_gst_common_c; +typedef struct ghost_event_s { + u16 violent_person_str_no; + u16 flags; + lbRTC_ymd_c renew_time; +} mEv_gst_c; + #define mEv_DESGINER_NUM 3 typedef struct kabu_peddler_event_s { diff --git a/src/ac_ev_ghost.c b/src/ac_ev_ghost.c new file mode 100644 index 00000000..c3966a12 --- /dev/null +++ b/src/ac_ev_ghost.c @@ -0,0 +1,7 @@ +#include "ac_ev_ghost.h" + +#include "m_event.h" +#include "m_common_data.h" + +#include "../src/ac_ev_ghost_talk.c_inc" +#include "../src/ac_ev_ghost_schedule.c_inc" diff --git a/src/ac_ev_ghost_schedule.c_inc b/src/ac_ev_ghost_schedule.c_inc new file mode 100644 index 00000000..e69de29b diff --git a/src/ac_ev_ghost_talk.c_inc b/src/ac_ev_ghost_talk.c_inc new file mode 100644 index 00000000..e69de29b diff --git a/src/ac_set_ovl_insect.c b/src/ac_set_ovl_insect.c index e62e9e52..7fd34e5f 100644 --- a/src/ac_set_ovl_insect.c +++ b/src/ac_set_ovl_insect.c @@ -1337,7 +1337,7 @@ static int aSOI_ins_renew_check_range_table(SET_MANAGER* set_manager, aSOI_insec spawn_type = aSOI_SPAWN_TYPE_ISLAND; } else { - mEv_gst_common_c* ghost_common = (mEv_gst_common_c*)mEv_get_common_area(0x72, 0x37); // TODO: definitions for event type, event id + mEv_gst_common_c* ghost_common = (mEv_gst_common_c*)mEv_get_common_area(mEv_EVENT_GHOST, 0x37); // TODO: definitions for event type, event id if (ghost_common != NULL && (ghost_common->flags & mEv_GHOST_FLAG_ACTIVE) != 0 && aSOI_check_hitodama_set_block(set_manager, &ghost_common->hitodama_block_data) == TRUE ) {