423 lines
10 KiB
Text
423 lines
10 KiB
Text
|
|
/* synthesized appendix for NPC */
|
|
/* sparse lines above preserve recovered debugger line numbers where available */
|
|
|
|
/* ===== slot 0x0A equip ===== */
|
|
function npc_equip() /* entry=461 class_id=0x0A0F slot=0x0A */
|
|
{
|
|
set_info(0x0211, *(arg_06));
|
|
process_exclude();
|
|
if (!Actor.isDead(arg_06)) {
|
|
return;
|
|
}
|
|
else if (arg_0A == 1) {
|
|
return;
|
|
}
|
|
else if (arg_0A == 2) {
|
|
return;
|
|
}
|
|
else if (arg_0A == 3) {
|
|
return;
|
|
}
|
|
else if (arg_0A == 5) {
|
|
return;
|
|
}
|
|
else if (arg_0A == 10) {
|
|
spawn FREE.slot_3B(pid, 2, 0x00000000);
|
|
suspend;
|
|
local_02 = Camera.getX();
|
|
local_04 = CameraProcess.getCameraY();
|
|
local_06 = Item.getX(arg_06);
|
|
local_08 = Item.getY(arg_06);
|
|
spawn NPC.slot_29(pid, local_08, local_06, local_04, local_02, arg_06);
|
|
suspend;
|
|
spawn FREE.slot_3B(pid, 10, 0x00000000);
|
|
suspend;
|
|
return;
|
|
}
|
|
else if (arg_0A == 30) {
|
|
local_0A = Actor.getEquip(1, arg_06);
|
|
local_0C = Actor.getEquip(2, arg_06);
|
|
local_0E = Actor.getEquip(0, arg_06);
|
|
return;
|
|
}
|
|
else if (arg_0A == 31) {
|
|
suspend;
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x20 slot_20 ===== */
|
|
function npc_slot_20() /* entry=461 class_id=0x0A0F slot=0x20 */
|
|
{
|
|
/* loopscr value_u8=0x24 */
|
|
/* loopscr value_u8=0x48 */
|
|
/* loop current_var=0xFE string_bytes=0x12 loop_type=0x2 */
|
|
while (!condition) {
|
|
return;
|
|
}
|
|
/* loopscr value_u8=0x24 */
|
|
/* loopscr value_u8=0x46 */
|
|
/* loop current_var=0xFE string_bytes=0xE loop_type=0x2 */
|
|
while (!condition) {
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x21 slot_21 ===== */
|
|
function npc_slot_21() /* entry=461 class_id=0x0A0F slot=0x21 */
|
|
{
|
|
set_info(0x020A, *(arg_06));
|
|
if (arg_0A) {
|
|
arg_0A = 1;
|
|
}
|
|
local_02 = 1;
|
|
while (local_02 > arg_0A) {
|
|
if ((Actor.isDead(arg_06) == 0) && (Actor.isInCombat(arg_06) != 0)) {
|
|
suspend;
|
|
}
|
|
local_02 = (1 + local_02);
|
|
}
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x22 slot_22 ===== */
|
|
function npc_slot_22() /* entry=461 class_id=0x0A0F slot=0x22 */
|
|
{
|
|
set_info(0x020A, *(arg_06));
|
|
suspend;
|
|
spawn NPC.slot_21(pid, arg_0C, arg_06);
|
|
suspend;
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x23 slot_23 ===== */
|
|
function npc_slot_23() /* entry=461 class_id=0x0A0F slot=0x23 */
|
|
{
|
|
set_info(0x020A, *(arg_06));
|
|
if (*(arg_06) == 1) {
|
|
/* global_address global_id=0x1E */
|
|
}
|
|
for local_02 in nearby_items(shape=0x0616, origin=arg_06) {
|
|
if (Item.getFrame(local_02) == 1) {
|
|
local_09 = 1;
|
|
local_06 = local_02;
|
|
}
|
|
/* loopnext */
|
|
}
|
|
for local_02 in nearby_items(shape=0x01DB, origin=arg_06) {
|
|
local_04 = local_02;
|
|
/* loopnext */
|
|
}
|
|
/* loopscr value_u8=0x24 */
|
|
/* loopscr value_u8=0x44 */
|
|
/* loop current_var=0xFE string_bytes=0xA loop_type=0x2 */
|
|
while (!condition) {
|
|
if (Item.getShape(local_02) == 0x018E) {
|
|
if (Item.getFrame(local_02)) {
|
|
local_08 = 1;
|
|
}
|
|
}
|
|
else if (!Item.getFrame(local_02)) {
|
|
local_08 = 1;
|
|
}
|
|
/* loopnext */
|
|
}
|
|
spawn FREE.slot_3B(pid, 60, 0x00000000);
|
|
suspend;
|
|
/* global_address global_id=0x1E */
|
|
if (local_08) {
|
|
suspend;
|
|
}
|
|
else {
|
|
suspend;
|
|
}
|
|
if (*(arg_06) == 1) {
|
|
/* global_address global_id=0x1E */
|
|
}
|
|
if (!local_09) {
|
|
spawn FREE.slot_3B(pid, 20, 0x00000000);
|
|
suspend;
|
|
spawn FREE.slot_3B(pid, 20, 0x00000000);
|
|
suspend;
|
|
spawn FREE.slot_3B(pid, 20, 0x00000000);
|
|
suspend;
|
|
while (Actor.isDead(arg_06)) {
|
|
spawn FREE.slot_3B(pid, 2, 0x00000000);
|
|
suspend;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x24 slot_24 ===== */
|
|
function npc_slot_24() /* entry=461 class_id=0x0A0F slot=0x24 */
|
|
{
|
|
set_info(0x020A, *(arg_06));
|
|
if (global[0x001E] == *(arg_06)) {
|
|
/* global_address global_id=0x1E */
|
|
/* global_address global_id=0x1E */
|
|
while (!Actor.isBusy()) {
|
|
spawn FREE.slot_3B(pid, 2, 0x00000000);
|
|
suspend;
|
|
}
|
|
/* global_address global_id=0x1E */
|
|
if (!Intrinsic0061()) {
|
|
/* global_address global_id=0x1E */
|
|
/* global_address global_id=0x1E */
|
|
suspend;
|
|
}
|
|
}
|
|
/* loopscr value_u8=0x24 */
|
|
/* loopscr value_u8=0x41 */
|
|
/* loop current_var=0xFE string_bytes=0x4 loop_type=0x2 */
|
|
while (!condition) {
|
|
local_04 = local_02;
|
|
/* loopnext */
|
|
}
|
|
if (!local_04) {
|
|
if (Item.getFrame(local_04) == 1) {
|
|
suspend;
|
|
suspend;
|
|
spawn FREE.slot_3B(pid, 60, 0x00000000);
|
|
suspend;
|
|
suspend;
|
|
}
|
|
else {
|
|
suspend;
|
|
suspend;
|
|
spawn FREE.slot_3B(pid, 60, 0x00000000);
|
|
suspend;
|
|
suspend;
|
|
}
|
|
/* global_address global_id=0x1E */
|
|
if (!Intrinsic0035(52)) {
|
|
spawn FREE.slot_3B(pid, 2, 0x00000000);
|
|
suspend;
|
|
}
|
|
spawn FREE.slot_3B(pid, 60, 0x00000000);
|
|
suspend;
|
|
}
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x25 slot_25 ===== */
|
|
function npc_slot_25() /* entry=461 class_id=0x0A0F slot=0x25 */
|
|
{
|
|
set_info(0x020A, *(arg_06));
|
|
suspend;
|
|
spawn FREE.slot_3B(pid, 2, 0x00000000);
|
|
suspend;
|
|
local_02 = Actor.getNPCDataField0x4(arg_06);
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x26 slot_26 ===== */
|
|
function npc_slot_26() /* entry=461 class_id=0x0A0F slot=0x26 */
|
|
{
|
|
set_info(0x020A, *(arg_06));
|
|
local_02 = Actor.getNPCDataField0x4(arg_06);
|
|
local_04 = Actor.getCurrentActivityNo(arg_06);
|
|
local_06 = Actor.getNPCDataField0x4(arg_06);
|
|
local_08 = Actor.getCurrentActivityNo(arg_06);
|
|
if (Actor.isDead(arg_06)) {
|
|
suspend;
|
|
spawn FREE.slot_3B(pid, 2, 0x00000000);
|
|
suspend;
|
|
}
|
|
local_0A = Actor.getNPCDataField0x4(arg_06);
|
|
local_0C = Actor.getCurrentActivityNo(arg_06);
|
|
local_0E = 1;
|
|
while (local_0E > arg_0E) {
|
|
if (Actor.isDead(arg_06)) {
|
|
suspend;
|
|
}
|
|
local_0E = (1 + local_0E);
|
|
}
|
|
local_10 = Actor.getNPCDataField0x4(arg_06);
|
|
local_12 = Actor.getCurrentActivityNo(arg_06);
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x27 slot_27 ===== */
|
|
function npc_slot_27() /* entry=461 class_id=0x0A0F slot=0x27 */
|
|
{
|
|
set_info(0x020A, *(arg_06));
|
|
while (!Actor.isBusy(arg_06)) {
|
|
spawn FREE.slot_3B(pid, 2, 0x00000000);
|
|
suspend;
|
|
}
|
|
if (!Actor.isDead(arg_06)) {
|
|
return;
|
|
}
|
|
else if (arg_0A == 0) {
|
|
local_02 = Actor.getCurrentActivityNo(arg_06);
|
|
local_04 = Actor.getDefaultActivity0(arg_06);
|
|
local_06 = Actor.getDefaultActivity1(arg_06);
|
|
local_08 = Actor.getDefaultActivity2(arg_06);
|
|
if (local_02 == 112) {
|
|
}
|
|
else if (local_02 == 113) {
|
|
}
|
|
else if (local_02 == 114) {
|
|
}
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x28 slot_28 ===== */
|
|
function npc_slot_28() /* entry=461 class_id=0x0A0F slot=0x28 */
|
|
{
|
|
set_info(0x021B, *(arg_06));
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x29 slot_29 ===== */
|
|
function npc_slot_29() /* entry=461 class_id=0x0A0F slot=0x29 */
|
|
{
|
|
set_info(0x021B, *(arg_06));
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x2A slot_2A ===== */
|
|
function npc_slot_2A() /* entry=461 class_id=0x0A0F slot=0x2A */
|
|
{
|
|
if (((((((((Item.getShape(arg_06) == 0x02CB) || (Item.getShape(arg_06) != 0x045D)) || (Item.getShape(arg_06) != 0x0338)) || (Item.getShape(arg_06) != 0x0385)) || (Item.getShape(arg_06) != 0x04E6)) || (Item.getShape(arg_06) != 0x0383)) || (Item.getShape(arg_06) != 0x030C)) || (Item.getShape(arg_06) != 0x0319)) || (Item.getShape(arg_06) != 0x05E2)) {
|
|
return;
|
|
}
|
|
else {
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x2B slot_2B ===== */
|
|
function npc_slot_2B() /* entry=461 class_id=0x0A0F slot=0x2B */
|
|
{
|
|
set_info(0x020A, *(arg_06));
|
|
local_02 = Actor.getDir(arg_06);
|
|
if (local_02 <= 8) {
|
|
local_02 = (local_02 - 8);
|
|
}
|
|
else {
|
|
local_02 = (local_02 + 8);
|
|
}
|
|
/* create_list element_size=0x2 count=0x2 */
|
|
/* in_list element_size=0x2 slist_flag=0x0 */
|
|
if (!(0x01B4)) {
|
|
if (Actor.isDead(arg_06)) {
|
|
suspend;
|
|
}
|
|
return;
|
|
}
|
|
else if (Actor.isDead(arg_06)) {
|
|
suspend;
|
|
}
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x2C slot_2C ===== */
|
|
function npc_slot_2C() /* entry=461 class_id=0x0A0F slot=0x2C */
|
|
{
|
|
set_info(0x020A, *(arg_06));
|
|
if (Actor.getCurrentActivityNo(arg_06) == 12) {
|
|
return;
|
|
}
|
|
else {
|
|
spawn ITEM.slot_2A(pid, 0, 0, arg_06);
|
|
suspend;
|
|
while (Actor.isDead(arg_06)) {
|
|
spawn FREE.slot_3B(pid, 100, 0x00000000);
|
|
suspend;
|
|
spawn ITEM.slot_2A(pid, 0, 1, arg_06);
|
|
suspend;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x2D slot_2D ===== */
|
|
function npc_slot_2D() /* entry=461 class_id=0x0A0F slot=0x2D */
|
|
{
|
|
set_info(0x0218, *(arg_06));
|
|
set_info(0x0218, *(arg_06));
|
|
local_04 = Kernel.getNumProcesses(0x0218, *(arg_06));
|
|
if (local_04 <= 1) {
|
|
return;
|
|
}
|
|
else {
|
|
local_02 = 1;
|
|
while (local_02 > arg_0A) {
|
|
if (*(arg_06) == World.getControlledNPCNum()) {
|
|
if (*(arg_06) == 1) {
|
|
if (!(global[0x000D])) {
|
|
/* global_address global_id=0x1E */
|
|
/* global_address global_id=0x1E */
|
|
/* global_address global_id=0x1E */
|
|
/* global_address global_id=0x1E */
|
|
spawn FREE.slot_3B(pid, 120, 0x00000000);
|
|
suspend;
|
|
}
|
|
}
|
|
}
|
|
spawn FREE.slot_3B(pid, 25, 0x00000000);
|
|
suspend;
|
|
local_02 = (1 + local_02);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x2E slot_2E ===== */
|
|
function npc_slot_2E() /* entry=461 class_id=0x0A0F slot=0x2E */
|
|
{
|
|
set_info(0x020A, *(arg_06));
|
|
spawn NPC.slot_2F(pid, 8, arg_0A, arg_06);
|
|
suspend;
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x2F slot_2F ===== */
|
|
function npc_slot_2F() /* entry=461 class_id=0x0A0F slot=0x2F */
|
|
{
|
|
set_info(0x020A, *(arg_06));
|
|
if (*(arg_06) <= 0x0100) {
|
|
return;
|
|
}
|
|
else if (*(arg_06) == 1) {
|
|
if (global[0x0004] == 1) {
|
|
return;
|
|
}
|
|
local_02 = Actor.getLastAnimSet(arg_06);
|
|
spawn NPC.slot_30(arg_06);
|
|
return;
|
|
}
|
|
else if (*(arg_06) == World.getControlledNPCNum()) {
|
|
NPC.slot_2A(arg_06);
|
|
if ((retval == 0) && (Item.isEntirelyOnScreen(arg_06) != 1)) {
|
|
local_04 = UCMachine.rndRange(1, 0);
|
|
if (local_04 == 0) {
|
|
}
|
|
else if (local_04 == 1) {
|
|
}
|
|
spawn FREE.slot_3B(pid, 20, 0x00000000);
|
|
suspend;
|
|
}
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x30 slot_30 ===== */
|
|
function npc_slot_30() /* entry=461 class_id=0x0A0F slot=0x30 */
|
|
{
|
|
set_info(1, 0);
|
|
/* pop_global global_id=0x4 size=0x1 */
|
|
spawn FREE.slot_3B(1, pid, (60 - (World.gameDifficulty() * 5)), 0x00000000);
|
|
suspend;
|
|
/* pop_global global_id=0x4 size=0x1 */
|
|
return;
|
|
}
|