2020-08-04 08:49:11 +02:00
|
|
|
#include "common.h"
|
|
|
|
|
2020-08-16 07:13:03 +02:00
|
|
|
Npc* resolve_npc(ScriptInstance* script, NpcId npcIdOrPtr) {
|
2020-08-16 06:24:20 +02:00
|
|
|
if (npcIdOrPtr == NpcId_SELF) {
|
2020-08-15 06:25:36 +02:00
|
|
|
return get_npc_safe(script->ownerID);
|
2020-08-16 06:24:20 +02:00
|
|
|
} else if (npcIdOrPtr >= -270000000) {
|
|
|
|
return get_npc_safe(npcIdOrPtr);
|
2020-08-15 06:25:36 +02:00
|
|
|
} else {
|
2020-08-16 06:24:20 +02:00
|
|
|
return (Npc*) npcIdOrPtr;
|
2020-08-15 06:25:36 +02:00
|
|
|
}
|
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-17 19:44:41 +02:00
|
|
|
INCLUDE_ASM("code_f2470_len_27f0", set_npc_animation);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-16 08:55:51 +02:00
|
|
|
ApiStatus DeleteNpc(ScriptInstance* script, s32 isInitialCall) {
|
2020-08-16 05:23:40 +02:00
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
2020-08-20 00:48:15 +02:00
|
|
|
Npc* npc = get_npc_unsafe(get_variable(script, *ptrReadPos++));
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-20 00:48:15 +02:00
|
|
|
if (npc) {
|
|
|
|
free_npc(npc);
|
2020-08-16 08:55:51 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-15 18:57:33 +02:00
|
|
|
}
|
2020-08-16 08:55:51 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-15 18:57:33 +02:00
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-16 08:55:51 +02:00
|
|
|
ApiStatus GetNpcPointer(ScriptInstance* script, s32 isInitialCall) {
|
2020-08-16 05:23:40 +02:00
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
2020-08-16 06:24:20 +02:00
|
|
|
NpcId npcID = get_variable(script, *ptrReadPos++);
|
2020-08-16 05:23:40 +02:00
|
|
|
Bytecode varNPC = *ptrReadPos++;
|
2020-08-15 19:59:48 +02:00
|
|
|
|
2020-08-19 02:23:52 +02:00
|
|
|
set_variable(script, varNPC, (s32)get_npc_safe(npcID));
|
2020-08-16 08:55:51 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-15 19:59:48 +02:00
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-17 19:44:41 +02:00
|
|
|
INCLUDE_API_ASM("code_f2470_len_27f0", SetNpcPos);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-17 19:44:41 +02:00
|
|
|
INCLUDE_API_ASM("code_f2470_len_27f0", SetNpcRotation);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-18 23:12:26 +02:00
|
|
|
ApiStatus SetNpcScale(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
|
|
|
NpcId npcID = get_variable(script, *ptrReadPos++);
|
|
|
|
f32 sizeX = get_float_variable(script, *ptrReadPos++);
|
|
|
|
f32 sizeY = get_float_variable(script, *ptrReadPos++);
|
|
|
|
f32 sizeZ = get_float_variable(script, *ptrReadPos++);
|
2020-08-20 00:48:15 +02:00
|
|
|
Npc* npc = resolve_npc(script, npcID);
|
2020-08-18 23:12:26 +02:00
|
|
|
|
2020-08-20 00:48:15 +02:00
|
|
|
if (npc != NULL) {
|
2020-08-18 23:12:26 +02:00
|
|
|
s32 todo = 1; // TODO: Figure out why this variable and subsequent if block is required for matching
|
|
|
|
if (todo) {
|
2020-08-20 00:48:15 +02:00
|
|
|
npc->scale.x = sizeX;
|
|
|
|
npc->scale.y = sizeY;
|
|
|
|
npc->scale.z = sizeZ;
|
2020-08-18 23:12:26 +02:00
|
|
|
}
|
2020-08-19 03:24:56 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-18 23:12:26 +02:00
|
|
|
}
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-18 22:44:19 +02:00
|
|
|
ApiStatus SetNpcCollisionSize(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
|
|
|
NpcId npcID = get_variable(script, *ptrReadPos++);
|
|
|
|
s32 height = get_variable(script, *ptrReadPos++);
|
|
|
|
s32 radius = get_variable(script, *ptrReadPos++);
|
2020-08-20 00:48:15 +02:00
|
|
|
Npc* npc = resolve_npc(script, npcID);
|
2020-08-18 22:44:19 +02:00
|
|
|
|
2020-08-20 00:48:15 +02:00
|
|
|
if (npc != NULL) {
|
2020-08-18 22:47:06 +02:00
|
|
|
s32 todo = 1; // TODO: Figure out why this variable and subsequent if block is required for matching
|
2020-08-18 22:44:19 +02:00
|
|
|
if (todo) {
|
2020-08-20 00:48:15 +02:00
|
|
|
npc->collisionHeight = height;
|
|
|
|
npc->collisionRadius = radius;
|
2020-08-18 22:44:19 +02:00
|
|
|
}
|
2020-08-19 03:24:56 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-18 22:44:19 +02:00
|
|
|
}
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-16 08:55:51 +02:00
|
|
|
ApiStatus SetNpcSpeed(ScriptInstance* script, s32 isInitialCall) {
|
2020-08-18 21:38:25 +02:00
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
2020-08-16 08:55:51 +02:00
|
|
|
NpcId npcID = get_variable(script, *ptrReadPos++);
|
2020-08-15 22:11:31 +02:00
|
|
|
f32 speed = get_float_variable(script, *ptrReadPos);
|
2020-08-20 00:48:15 +02:00
|
|
|
Npc* npc = resolve_npc(script, npcID);
|
2020-08-15 22:11:31 +02:00
|
|
|
|
2020-08-20 04:51:36 +02:00
|
|
|
if (npc != NULL) {
|
2020-08-20 00:48:15 +02:00
|
|
|
npc->moveSpeed = speed;
|
2020-08-19 03:24:56 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-15 22:11:31 +02:00
|
|
|
}
|
2020-08-18 21:38:25 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-15 22:11:31 +02:00
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-18 23:12:26 +02:00
|
|
|
ApiStatus SetNpcJumpscale(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
|
|
|
NpcId npcID = get_variable(script, *ptrReadPos++);
|
|
|
|
f32 jumpScale = get_float_variable(script, *ptrReadPos);
|
2020-08-20 00:48:15 +02:00
|
|
|
Npc* npc = resolve_npc(script, npcID);
|
2020-08-18 23:12:26 +02:00
|
|
|
|
2020-08-20 04:51:36 +02:00
|
|
|
if (npc != NULL) {
|
2020-08-20 00:48:15 +02:00
|
|
|
npc->jumpScale = jumpScale;
|
2020-08-19 03:24:56 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-18 23:12:26 +02:00
|
|
|
}
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-18 23:29:25 +02:00
|
|
|
ApiStatus SetNpcAnimation(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
|
|
|
NpcId npcID = get_variable(script, *ptrReadPos++);
|
|
|
|
s32 animation = get_variable(script, *ptrReadPos);
|
2020-08-20 00:48:15 +02:00
|
|
|
Npc* npc = resolve_npc(script, npcID);
|
2020-08-18 23:29:25 +02:00
|
|
|
|
2020-08-20 00:48:15 +02:00
|
|
|
if (npc != NULL) {
|
|
|
|
set_npc_animation(npc, animation);
|
2020-08-19 03:24:56 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-18 23:29:25 +02:00
|
|
|
}
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
|
|
|
|
|
|
|
ApiStatus GetNpcAnimation(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
|
|
|
NpcId npcID = get_variable(script, *ptrReadPos++);
|
|
|
|
Bytecode outVar = *ptrReadPos++;
|
2020-08-20 00:48:15 +02:00
|
|
|
Npc* npc = resolve_npc(script, npcID);
|
2020-08-18 23:29:25 +02:00
|
|
|
|
2020-08-20 00:48:15 +02:00
|
|
|
if (npc != NULL) {
|
|
|
|
set_variable(script, outVar, npc->currentAnim);
|
2020-08-19 03:24:56 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-18 23:29:25 +02:00
|
|
|
}
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
|
|
|
|
2020-08-19 00:51:58 +02:00
|
|
|
ApiStatus SetNpcAnimationSpeed(ScriptInstance* script, s32 isInitialCall) {
|
2020-08-18 23:29:25 +02:00
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
|
|
|
NpcId npcID = get_variable(script, *ptrReadPos++);
|
2020-08-19 00:51:58 +02:00
|
|
|
f32 animationSpeed = get_float_variable(script, *ptrReadPos++);
|
2020-08-20 00:48:15 +02:00
|
|
|
Npc* npc = resolve_npc(script, npcID);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-20 00:48:15 +02:00
|
|
|
if (npc != NULL) {
|
|
|
|
npc->animationSpeed = animationSpeed;
|
2020-08-19 03:24:56 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-18 23:29:25 +02:00
|
|
|
}
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-17 19:44:41 +02:00
|
|
|
INCLUDE_API_ASM("code_f2470_len_27f0", NpcMoveTo);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-17 19:44:41 +02:00
|
|
|
INCLUDE_ASM("code_f2470_len_27f0", _npc_jump_to);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-19 02:31:39 +02:00
|
|
|
void NpcJump0(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
_npc_jump_to(script, isInitialCall, 0);
|
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-19 02:31:39 +02:00
|
|
|
void NpcJump1(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
_npc_jump_to(script, isInitialCall, 1);
|
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-17 19:44:41 +02:00
|
|
|
INCLUDE_API_ASM("code_f2470_len_27f0", NpcFlyTo);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-19 02:31:39 +02:00
|
|
|
ApiStatus GetNpcYaw(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
|
|
|
NpcId npcID = get_variable(script, *ptrReadPos++);
|
|
|
|
Bytecode outVar = *ptrReadPos++;
|
2020-08-20 00:48:15 +02:00
|
|
|
Npc* npc = resolve_npc(script, npcID);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-20 00:48:15 +02:00
|
|
|
if (npc != NULL) {
|
2020-08-19 02:31:39 +02:00
|
|
|
s32 todo = 1; // TODO: Figure out why this variable and subsequent if block is required for matching
|
|
|
|
if (todo) {
|
2020-08-20 00:48:15 +02:00
|
|
|
set_variable(script, outVar, clamp_angle(npc->yaw));
|
2020-08-19 02:31:39 +02:00
|
|
|
}
|
2020-08-19 03:24:56 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-19 02:31:39 +02:00
|
|
|
}
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
|
|
|
|
|
|
|
ApiStatus SetNpcYaw(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
|
|
|
NpcId npcID = get_variable(script, *ptrReadPos++);
|
2020-08-20 00:48:15 +02:00
|
|
|
Npc* npc = resolve_npc(script, npcID);
|
2020-08-20 04:51:36 +02:00
|
|
|
|
2020-08-20 00:48:15 +02:00
|
|
|
if (npc != NULL) {
|
|
|
|
set_npc_yaw(npc, get_variable(script, *ptrReadPos++));
|
2020-08-19 03:24:56 +02:00
|
|
|
return ApiStatus_DONE2;
|
2020-08-19 02:31:39 +02:00
|
|
|
}
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-17 19:44:41 +02:00
|
|
|
INCLUDE_API_ASM("code_f2470_len_27f0", InterpNpcYaw);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-17 19:44:41 +02:00
|
|
|
INCLUDE_API_ASM("code_f2470_len_27f0", NpcFacePlayer);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-17 19:44:41 +02:00
|
|
|
INCLUDE_API_ASM("code_f2470_len_27f0", NpcFaceNpc);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-17 19:44:41 +02:00
|
|
|
INCLUDE_API_ASM("code_f2470_len_27f0", SetNpcFlagBits);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-17 19:44:41 +02:00
|
|
|
INCLUDE_API_ASM("code_f2470_len_27f0", GetNpcPos);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-19 06:54:42 +02:00
|
|
|
ApiStatus EnableNpcShadow(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
|
|
|
NpcId npcID = get_variable(script, *ptrReadPos++);
|
|
|
|
s32 enableShadow = get_variable(script, *ptrReadPos++);
|
2020-08-20 00:48:15 +02:00
|
|
|
Npc* npc = resolve_npc(script, npcID);
|
2020-08-19 06:54:42 +02:00
|
|
|
|
2020-08-20 00:48:15 +02:00
|
|
|
if (npc != NULL) {
|
2020-08-19 06:54:42 +02:00
|
|
|
if (enableShadow) {
|
2020-08-20 00:48:15 +02:00
|
|
|
enable_npc_shadow(npc);
|
2020-08-19 06:54:42 +02:00
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
2020-08-20 04:32:54 +02:00
|
|
|
disable_npc_shadow(npc);
|
2020-08-19 06:54:42 +02:00
|
|
|
}
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
|
|
|
|
|
|
|
ApiStatus EnableNpcBlur(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
|
|
|
NpcId npcID = get_variable(script, *ptrReadPos++);
|
|
|
|
s32 enableBlur = get_variable(script, *ptrReadPos++);
|
2020-08-20 00:48:15 +02:00
|
|
|
Npc* npc = resolve_npc(script, npcID);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-20 00:48:15 +02:00
|
|
|
if (npc != NULL) {
|
2020-08-19 06:54:42 +02:00
|
|
|
if (enableBlur) {
|
2020-08-20 00:48:15 +02:00
|
|
|
enable_npc_blur(npc);
|
2020-08-19 06:54:42 +02:00
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
2020-08-20 00:48:15 +02:00
|
|
|
disable_npc_blur(npc);
|
2020-08-19 06:54:42 +02:00
|
|
|
}
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
|
|
|
|
|
|
|
ApiStatus ClearPartnerMoveHistory(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
|
|
|
NpcId npcID = get_variable(script, *ptrReadPos++);
|
2020-08-20 00:48:15 +02:00
|
|
|
Npc* npc = resolve_npc(script, npcID);
|
2020-08-19 06:54:42 +02:00
|
|
|
|
2020-08-20 00:48:15 +02:00
|
|
|
if (npc != NULL) {
|
|
|
|
clear_partner_move_history(npc);
|
2020-08-19 06:54:42 +02:00
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-17 19:44:41 +02:00
|
|
|
INCLUDE_API_ASM("code_f2470_len_27f0", NpcSetHomePosToCurrent);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-19 06:54:42 +02:00
|
|
|
ApiStatus GetPartnerPos(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
|
|
|
Bytecode posX = *ptrReadPos++;
|
|
|
|
Bytecode posY = *ptrReadPos++;
|
|
|
|
Bytecode posZ = *ptrReadPos++;
|
2020-08-20 00:48:15 +02:00
|
|
|
Npc* npc = get_npc_unsafe(-4);
|
2020-08-19 06:54:42 +02:00
|
|
|
|
2020-08-20 00:48:15 +02:00
|
|
|
if (npc != NULL) {
|
|
|
|
set_variable(script, posX, npc->pos.x);
|
|
|
|
set_variable(script, posY, npc->pos.y);
|
|
|
|
set_variable(script, posZ, npc->pos.z);
|
2020-08-19 06:54:42 +02:00
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-19 06:54:42 +02:00
|
|
|
ApiStatus DisablePartnerAI(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-19 06:54:42 +02:00
|
|
|
if (get_variable(script, *ptrReadPos++) == 0) {
|
|
|
|
func_800EF314();
|
|
|
|
} else {
|
|
|
|
func_800EF300();
|
|
|
|
}
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
|
|
|
|
|
|
|
ApiStatus EnablePartnerAI(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
enable_partner_ai();
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
|
|
|
|
|
|
|
ApiStatus func_802CF54C(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
func_800EF43C();
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
|
|
|
|
|
|
|
ApiStatus func_802CF56C(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
2020-08-20 04:51:36 +02:00
|
|
|
s32 value = get_variable(script, *ptrReadPos++);
|
2020-08-19 06:54:42 +02:00
|
|
|
|
2020-08-20 04:51:36 +02:00
|
|
|
if (value == 2) {
|
2020-08-19 06:54:42 +02:00
|
|
|
func_800EF3E4();
|
|
|
|
} else {
|
|
|
|
func_800EF3D4(value);
|
|
|
|
}
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-17 19:44:41 +02:00
|
|
|
INCLUDE_API_ASM("code_f2470_len_27f0", BringPartnerOut);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-17 19:44:41 +02:00
|
|
|
INCLUDE_API_ASM("code_f2470_len_27f0", PutPartnerAway);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-17 19:44:41 +02:00
|
|
|
INCLUDE_API_ASM("code_f2470_len_27f0", GetCurrentPartnerID);
|
2020-08-04 08:49:11 +02:00
|
|
|
|
2020-08-19 16:34:52 +02:00
|
|
|
ApiStatus SetNpcEffect(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
|
|
|
NpcId npcID = get_variable(script, *ptrReadPos++);
|
|
|
|
s32 value1 = get_variable(script, *ptrReadPos++);
|
|
|
|
s32 value2 = get_variable(script, *ptrReadPos++);
|
2020-08-20 00:48:15 +02:00
|
|
|
Npc* npc = resolve_npc(script, npcID);
|
2020-08-19 16:34:52 +02:00
|
|
|
|
2020-08-20 00:48:15 +02:00
|
|
|
if (npc != NULL) {
|
|
|
|
func_8003C3D8(npc, value1, value2);
|
2020-08-19 16:34:52 +02:00
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
|
|
|
|
|
|
|
ApiStatus PlaySoundAtNpc(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
|
|
|
NpcId npcID = get_variable(script, *ptrReadPos++);
|
|
|
|
SoundId soundID = get_variable(script, *ptrReadPos++);
|
|
|
|
s32 value2 = get_variable(script, *ptrReadPos++);
|
2020-08-20 00:48:15 +02:00
|
|
|
Npc* npc = resolve_npc(script, npcID);
|
2020-08-19 16:34:52 +02:00
|
|
|
|
2020-08-20 00:48:15 +02:00
|
|
|
if (npc != NULL) {
|
|
|
|
play_sound_at_position(soundID, value2, npc->pos.x, npc->pos.y, npc->pos.z);
|
2020-08-19 16:34:52 +02:00
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
|
|
|
|
|
|
|
ApiStatus SetNpcRenderMode(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
Bytecode* ptrReadPos = script->ptrReadPos;
|
|
|
|
NpcId npcID = get_variable(script, *ptrReadPos++);
|
|
|
|
u8 renderMode = get_variable(script, *ptrReadPos++);
|
2020-08-20 00:48:15 +02:00
|
|
|
Npc* npc = resolve_npc(script, npcID);
|
2020-08-19 16:34:52 +02:00
|
|
|
|
2020-08-20 00:48:15 +02:00
|
|
|
npc->renderMode = renderMode;
|
2020-08-19 16:34:52 +02:00
|
|
|
return ApiStatus_DONE2;
|
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|