diff --git a/src/combat_ai.cc b/src/combat_ai.cc index 2cf475e..2110b9d 100644 --- a/src/combat_ai.cc +++ b/src/combat_ai.cc @@ -707,6 +707,24 @@ int combat_ai_num() return gAiPacketsLength; } +// 0x428060 +char* combat_ai_name(int packet_num) +{ + int index; + + if (packet_num < 0 || packet_num >= gAiPacketsLength) { + return NULL; + } + + for (index = 0; index < gAiPacketsLength; index++) { + if (gAiPackets[index].packet_num == packet_num) { + return gAiPackets[index].name; + } + } + + return NULL; +} + // Get ai from object // // 0x4280B4 diff --git a/src/combat_ai.h b/src/combat_ai.h index e182a2c..1e11dfb 100644 --- a/src/combat_ai.h +++ b/src/combat_ai.h @@ -31,6 +31,7 @@ int aiExit(); int aiLoad(File* stream); int aiSave(File* stream); int combat_ai_num(); +char* combat_ai_name(int packet_num); int aiGetAreaAttackMode(Object* obj); int aiGetRunAwayMode(Object* obj); int aiGetBestWeapon(Object* obj);