From ed4d67b0cb75d4b396be7464ba679d2c2bf0b2ce Mon Sep 17 00:00:00 2001 From: cuckydev Date: Thu, 31 Jan 2019 10:58:04 -0500 Subject: [PATCH 1/2] nope --- src/Main.cpp | 6 ++ src/MyChar.cpp | 2 +- src/NpcAct.h | 3 +- src/NpcAct000.cpp | 37 +++++++++++ src/NpcAct060.cpp | 130 ++++++++++++++++++++++++++++++++++++++ src/NpcAct140.cpp | 156 ++++++++++++++++++++++++++++++++++++++++++++++ src/NpcTbl.cpp | 4 +- src/TextScr.cpp | 23 +++++++ 8 files changed, 357 insertions(+), 4 deletions(-) diff --git a/src/Main.cpp b/src/Main.cpp index b3f16c89..3e87a65b 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -9,6 +9,7 @@ #include "Draw.h" #include "Input.h" +#include "Profile.h" #include "Organya.h" #include "Sound.h" #include "Game.h" @@ -400,6 +401,11 @@ bool SystemTask() break; } break; + + case SDL_DROPFILE: + LoadProfile(event.drop.file); + SDL_free(event.drop.file); + break; case SDL_KEYDOWN: switch (event.key.keysym.sym) diff --git a/src/MyChar.cpp b/src/MyChar.cpp index 315c96e6..db5d6e78 100644 --- a/src/MyChar.cpp +++ b/src/MyChar.cpp @@ -151,7 +151,7 @@ void ShowMyChar(bool bShow) void PutMyChar(int fx, int fy) { - if ((gMC.cond & 0x80u) && !(gMC.cond & 2)) + if ((gMC.cond & 0x80) && !(gMC.cond & 2)) { //Draw weapon gMC.rect_arms.left = 24 * (gArmsData[gSelectedArms].code % 13); diff --git a/src/NpcAct.h b/src/NpcAct.h index ca40f6ea..530c88ea 100644 --- a/src/NpcAct.h +++ b/src/NpcAct.h @@ -46,7 +46,7 @@ void ActNpc059(NPCHAR *npc); void ActNpc060(NPCHAR *npc); void ActNpc061(NPCHAR *npc); void ActNpc062(NPCHAR *npc); - +void ActNpc063(NPCHAR *npc); void ActNpc064(NPCHAR *npc); void ActNpc065(NPCHAR *npc); @@ -78,6 +78,7 @@ void ActNpc125(NPCHAR *npc); void ActNpc145(NPCHAR *npc); +void ActNpc150(NPCHAR *npc); void ActNpc151(NPCHAR *npc); void ActNpc211(NPCHAR *npc); diff --git a/src/NpcAct000.cpp b/src/NpcAct000.cpp index 52ec9f45..0bed9ba7 100644 --- a/src/NpcAct000.cpp +++ b/src/NpcAct000.cpp @@ -802,6 +802,43 @@ void ActNpc008(NPCHAR *npc) npc->rect = rcRight[npc->ani_no]; } +//Balrog (cutscene) +void ActNpc012(NPCHAR *npc) +{ + RECT rect_left[14]; + RECT rect_right[14]; + + rect_left[0] = {0, 0, 40, 24}; + rect_left[1] = {160, 0, 200, 24}; + rect_left[2] = {80, 0, 120, 24}; + rect_left[3] = {120, 0, 160, 24}; + rect_left[4] = {240, 0, 280, 24}; + rect_left[5] = {200, 0, 240, 24}; + rect_left[6] = {280, 0, 320, 24}; + rect_left[7] = {0, 0, 0, 0}; + rect_left[8] = {80, 48, 120, 72}; + rect_left[9] = {0, 48, 40, 72}; + rect_left[10] = {0, 0, 40, 24}; + rect_left[11] = {40, 48, 80, 72}; + rect_left[12] = {0, 0, 40, 24}; + rect_left[13] = {280, 0, 320, 24}; + + rect_right[0] = {0, 24, 40, 48}; + rect_right[1] = {160, 24, 200, 48}; + rect_right[2] = {80, 24, 120, 48}; + rect_right[3] = {120, 24, 160, 48}; + rect_right[4] = {240, 24, 280, 48}; + rect_right[5] = {200, 24, 240, 48}; + rect_right[6] = {280, 24, 320, 48}; + rect_right[7] = {0, 0, 0, 0}; + rect_right[8] = {80, 72, 120, 96}; + rect_right[9] = {0, 72, 40, 96}; + rect_right[10] = {0, 24, 40, 48}; + rect_right[11] = {40, 72, 80, 96}; + rect_right[12] = {0, 24, 40, 48}; + rect_right[13] = {280, 24, 320, 48}; +} + //Chest (closed) void ActNpc015(NPCHAR *npc) { diff --git a/src/NpcAct060.cpp b/src/NpcAct060.cpp index 573e8b60..386f6680 100644 --- a/src/NpcAct060.cpp +++ b/src/NpcAct060.cpp @@ -481,6 +481,136 @@ void ActNpc062(NPCHAR *npc) npc->rect = rcLeft[npc->ani_no]; } +//Toroko with stick +void ActNpc063(NPCHAR *npc) +{ + RECT rcRight[6]; + RECT rcLeft[6]; + + rcLeft[0] = {64, 64, 80, 80}; + rcLeft[1] = {80, 64, 96, 80}; + rcLeft[2] = {64, 64, 80, 80}; + rcLeft[3] = {96, 64, 112, 80}; + rcLeft[4] = {112, 64, 128, 80}; + rcLeft[5] = {128, 64, 144, 80}; + + rcRight[0] = {64, 80, 80, 96}; + rcRight[1] = {80, 80, 96, 96}; + rcRight[2] = {64, 80, 80, 96}; + rcRight[3] = {96, 80, 112, 96}; + rcRight[4] = {112, 80, 128, 96}; + rcRight[5] = {128, 80, 144, 96}; + + switch ( npc->act_no ) + { + case 0: + npc->act_no = 1; + npc->act_wait = 0; + npc->ani_wait = 0; + npc->ym = -1024; + case 1: + if (npc->ym > 0) + npc->bits &= ~npc_ignoreSolid; + + if (++npc->ani_wait > 2) + { + npc->ani_wait = 0; + ++npc->ani_no; + } + + if (npc->ani_no > 3) + npc->ani_no = 0; + + if (npc->direct) + npc->xm = 0x100; + else + npc->xm = -0x100; + + if (npc->act_wait != 0 && npc->flag & 8) + npc->act_no = 2; + npc->act_wait++; + break; + case 2: + npc->act_no = 3; + npc->act_wait = 0; + npc->ani_no = 0; + npc->ani_wait = 0; + case 3: + if (++npc->ani_wait > 2) + { + npc->ani_wait = 0; + ++npc->ani_no; + } + + if (npc->ani_no > 3) + npc->ani_no = 0; + + if (++npc->act_wait > 50) + { + npc->act_wait = 40; + npc->xm = -npc->xm; + if (npc->direct) + npc->direct = 0; + else + npc->direct = 2; + } + + if (npc->act_wait > 35) + npc->bits |= npc_shootable; + + if (npc->direct) + npc->xm += 0x40; + else + npc->xm -= 0x40; + + if (npc->shock) + { + npc->act_no = 4; + npc->ani_no = 4; + npc->ym = -0x400; + npc->bits &= ~npc_shootable; + npc->damage = 0; + } + break; + case 4: + if (npc->direct) + npc->xm = 0x100; + else + npc->xm = -0x100; + + if (npc->act_wait != 0 && npc->flag & 8) + { + npc->act_no = 5; + npc->bits |= npc_interact; + } + npc->act_wait++; + break; + case 5: + npc->xm = 0; + npc->ani_no = 5; + break; + default: + break; + } + + npc->ym += 0x40; + + if (npc->xm > 0x400) + npc->xm = 0x400; + if (npc->xm < -0x400) + npc->xm = -0x400; + if (npc->ym > 0x5FF) + npc->ym = 0x5FF; + + npc->x += npc->xm; + npc->y += npc->ym; + + if (npc->direct) + npc->rect = rcRight[npc->ani_no]; + else + npc->rect = rcLeft[npc->ani_no]; +} + //First Cave Critter void ActNpc064(NPCHAR *npc) { diff --git a/src/NpcAct140.cpp b/src/NpcAct140.cpp index 7a83e0d6..125c4d5b 100644 --- a/src/NpcAct140.cpp +++ b/src/NpcAct140.cpp @@ -49,6 +49,162 @@ void ActNpc145(NPCHAR *npc) npc->rect = rcRight[npc->ani_no]; } +//Quote +void ActNpc150(NPCHAR *npc) +{ + RECT rcLeft[9]; + RECT rcRight[9]; + + rcLeft[0] = {0, 0, 16, 16}; + rcLeft[1] = {48, 0, 64, 16}; + rcLeft[2] = {144, 0, 160, 16}; + rcLeft[3] = {16, 0, 32, 16}; + rcLeft[4] = {0, 0, 16, 16}; + rcLeft[5] = {32, 0, 48, 16}; + rcLeft[6] = {0, 0, 16, 16}; + rcLeft[7] = {160, 0, 176, 16}; + rcLeft[8] = {112, 0, 128, 16}; + + rcRight[0] = {0, 16, 16, 32}; + rcRight[1] = {48, 16, 64, 32}; + rcRight[2] = {144, 16, 160, 32}; + rcRight[3] = {16, 16, 32, 32}; + rcRight[4] = {0, 16, 16, 32}; + rcRight[5] = {32, 16, 48, 32}; + rcRight[6] = {0, 16, 16, 32}; + rcRight[7] = {160, 16, 176, 32}; + rcRight[8] = {112, 16, 128, 32}; + + switch (npc->act_no) + { + case 0: + npc->act_no = 1; + npc->ani_no = 0; + + if (npc->direct > 10) + { + npc->x = gMC.x; + npc->y = gMC.y; + npc->direct -= 10; + } + break; + case 2: + npc->ani_no = 1; + break; + case 10: + npc->act_no = 11; + for (int i = 0; i < 4; i++) + SetNpChar(4, npc->x, npc->y, Random(-0x155, 0x155), Random(-0x600, 0), 0, 0, 0x100); + PlaySoundObject(71, 1); + case 11: + npc->ani_no = 2; + break; + case 20: + npc->act_no = 21; + npc->act_wait = 64; + PlaySoundObject(29, 1); + case 21: + if (!--npc->act_wait) + npc->cond = 0; + break; + case 50: + npc->act_no = 51; + npc->ani_no = 3; + npc->ani_wait = 0; + case 51: + if (++npc->ani_wait > 4) + { + npc->ani_wait = 0; + ++npc->ani_no; + } + if (npc->ani_no > 6) + npc->ani_no = 3; + + if ( npc->direct ) + npc->x += 0x200; + else + npc->x -= 0x200; + break; + case 60: + npc->act_no = 61; + npc->ani_no = 7; + npc->tgt_x = npc->x; + npc->tgt_y = npc->y; + case 61: + npc->tgt_y += 0x100; + npc->x = npc->tgt_x + (Random(-1, 1) << 9); + npc->y = npc->tgt_y + (Random(-1, 1) << 9); + break; + case 70: + npc->act_no = 71; + npc->act_wait = 0; + npc->ani_no = 3; + npc->ani_wait = 0; + case 0x47: + if ( npc->direct ) + npc->x -= 0x100; + else + npc->x += 0x100; + + if (++npc->ani_wait > 8) + { + npc->ani_wait = 0; + ++npc->ani_no; + } + if (npc->ani_no > 6) + npc->ani_no = 3; + break; + case 80: + npc->ani_no = 8; + break; + case 99: + case 100: + npc->act_no = 101; + npc->ani_no = 3; + npc->ani_wait = 0; + case 101: + npc->ym += 0x40; + if (npc->ym > 0x5FF) + npc->ym = 0x5FF; + if (npc->flag & 8) + { + npc->ym = 0; + npc->act_no = 102; + } + npc->y += npc->ym; + break; + case 102: + if (++npc->ani_wait > 8) + { + npc->ani_wait = 0; + ++npc->ani_no; + } + if (npc->ani_no > 6) + npc->ani_no = 3; + break; + default: + break; + } + + if (npc->direct) + npc->rect = rcRight[npc->ani_no]; + else + npc->rect = rcLeft[npc->ani_no]; + + if (npc->act_no == 21) + { + npc->rect.bottom = npc->act_wait / 4 + npc->rect.top; + if (npc->act_wait / 2 & 1) + ++npc->rect.left; + } + + if (gMC.equip & 0x40) + { + npc->rect.top += 32; + npc->rect.bottom += 32; + } +} + //Blue robot (standing) void ActNpc151(NPCHAR *npc) { diff --git a/src/NpcTbl.cpp b/src/NpcTbl.cpp index 0b79d230..c01b54f3 100644 --- a/src/NpcTbl.cpp +++ b/src/NpcTbl.cpp @@ -119,7 +119,7 @@ NPCFUNCTION gpNpcFuncTbl[361] = ActNpc060, ActNpc061, ActNpc062, - nullptr, + ActNpc063, ActNpc064, ActNpc065, nullptr, @@ -206,7 +206,7 @@ NPCFUNCTION gpNpcFuncTbl[361] = nullptr, nullptr, nullptr, - nullptr, + ActNpc150, ActNpc151, nullptr, nullptr, diff --git a/src/TextScr.cpp b/src/TextScr.cpp index c1353781..958f0c31 100644 --- a/src/TextScr.cpp +++ b/src/TextScr.cpp @@ -785,6 +785,12 @@ int TextScriptProc() gTS.p_read += 8; bExit = true; } + else if (IS_COMMAND('W','A','S')) + { + gTS.mode = 7; + gTS.p_read += 4; + bExit = true; + } else if (IS_COMMAND('T','U','R')) { gTS.p_read += 4; @@ -977,6 +983,23 @@ int TextScriptProc() MoveNpChar(w, x << 13, y << 13, z); gTS.p_read += 23; } + else if (IS_COMMAND('M','Y','D')) + { + z = GetTextScriptNo(gTS.p_read + 4); + SetMyCharDirect(z); + gTS.p_read += 8; + } + else if (IS_COMMAND('M','Y','B')) + { + z = GetTextScriptNo(gTS.p_read + 4); + BackStepMyChar(z); + gTS.p_read += 8; + } + else if (IS_COMMAND('M','M','0')) + { + ZeroMyCharXMove(); + gTS.p_read += 4; + } else if (IS_COMMAND('I','N','I')) { InitializeGame(); From be3056c8bb07f629a7427a98db558370beb33506 Mon Sep 17 00:00:00 2001 From: cuckydev Date: Thu, 31 Jan 2019 11:35:05 -0500 Subject: [PATCH 2/2] FRig --- src/NpcAct.h | 4 +- src/NpcAct000.cpp | 319 +++++++++++++++++++++++++++++++++++++++++++++- src/NpcTbl.cpp | 4 +- src/TextScr.cpp | 16 +++ 4 files changed, 338 insertions(+), 5 deletions(-) diff --git a/src/NpcAct.h b/src/NpcAct.h index 530c88ea..b037ea09 100644 --- a/src/NpcAct.h +++ b/src/NpcAct.h @@ -12,11 +12,13 @@ void ActNpc006(NPCHAR *npc); void ActNpc007(NPCHAR *npc); void ActNpc008(NPCHAR *npc); +void ActNpc012(NPCHAR *npc); + void ActNpc015(NPCHAR *npc); void ActNpc016(NPCHAR *npc); void ActNpc017(NPCHAR *npc); void ActNpc018(NPCHAR *npc); - +void ActNpc019(NPCHAR *npc); void ActNpc020(NPCHAR *npc); void ActNpc021(NPCHAR *npc); void ActNpc022(NPCHAR *npc); diff --git a/src/NpcAct000.cpp b/src/NpcAct000.cpp index 0bed9ba7..fd4d26be 100644 --- a/src/NpcAct000.cpp +++ b/src/NpcAct000.cpp @@ -5,7 +5,9 @@ #include "MyChar.h" #include "NpChar.h" #include "Game.h" +#include "Map.h" #include "Sound.h" +#include "Frame.h" #include "Back.h" #include "Triangle.h" @@ -805,6 +807,230 @@ void ActNpc008(NPCHAR *npc) //Balrog (cutscene) void ActNpc012(NPCHAR *npc) { + int x, y; + switch (npc->act_no) + { + case 0: + if (npc->direct == 4) + { + if (npc->x <= gMC.x) + npc->direct = 2; + else + npc->direct = 0; + } + npc->act_no = 1; + npc->ani_no = 0; + case 1: + if (Random(0, 100) == 0) + { + npc->act_no = 2; + npc->act_wait = 0; + npc->ani_no = 1; + } + break; + case 2: + if (++npc->act_wait > 16) + { + npc->act_no = 1; + npc->ani_no = 0; + } + break; + case 10: + if (npc->direct == 4) + { + if (npc->x <= gMC.x) + npc->direct = 2; + else + npc->direct = 0; + } + npc->act_no = 11; + npc->ani_no = 2; + npc->act_wait = 0; + npc->tgt_x = 0; + case 11: + if ( ++npc->act_wait > 30 ) + { + npc->act_no = 12; + npc->act_wait = 0; + npc->ani_no = 3; + npc->ym = -0x800; + npc->bits |= npc_ignoreSolid; + } + break; + case 12: + if (npc->flag & 5) + npc->xm = 0; + if (npc->y < 0) + { + npc->code_char = 0; + PlaySoundObject(26, 1); + SetQuake(30); + } + break; + case 20: + if (npc->direct == 4) + { + if (npc->x <= gMC.x) + npc->direct = 2; + else + npc->direct = 0; + } + npc->act_no = 21; + npc->ani_no = 5; + npc->act_wait = 0; + npc->count1 = 0; + for (int i = 0; i < 4; i++) + SetNpChar(4, npc->x + (Random(-12, 12) << 9), npc->y + (Random(-12, 12) << 9), Random(-0x155, 0x155), Random(-0x600, 0), 0, 0, 0x100); + PlaySoundObject(72, 1); + case 21: + npc->tgt_x = 1; + if (npc->flag & 8) + ++npc->act_wait; + if (++npc->count1 / 2 & 1) + npc->x += 0x200; + else + npc->x -= 0x200; + if (npc->act_wait > 100) + { + npc->act_no = 11; + npc->act_wait = 0; + npc->ani_no = 2; + } + npc->ym += 0x20; + if (npc->ym > 0x5FF) + npc->ym = 0x5FF; + break; + case 30: + npc->ani_no = 4; + if (++npc->act_wait > 100) + { + npc->act_no = 0; + npc->ani_no = 0; + } + break; + case 40: + if (npc->direct == 4) + { + if (npc->x <= gMC.x) + npc->direct = 2; + else + npc->direct = 0; + } + npc->act_no = 41; + npc->act_wait = 0; + npc->ani_no = 5; + case 41: + if (++npc->ani_wait / 2 & 1) + npc->ani_no = 5; + else + npc->ani_no = 6; + break; + case 42: + if (npc->direct == 4) + { + if (npc->x <= gMC.x) + npc->direct = 2; + else + npc->direct = 0; + } + npc->act_no = 43; + npc->act_wait = 0; + npc->ani_no = 6; + case 43: + if (++npc->ani_wait / 2 & 1) + npc->ani_no = 7; + else + npc->ani_no = 6; + break; + case 50: + npc->ani_no = 8; + npc->xm = 0; + break; + case 60: + npc->act_no = 61; + npc->ani_no = 9; + npc->ani_wait = 0; + case 61: + if (++npc->ani_wait > 3) + { + npc->ani_wait = 0; + if (++npc->ani_no == 10 || npc->ani_no == 11) + PlaySoundObject(23, 1); + } + if (npc->ani_no > 12) + npc->ani_no = 9; + if (npc->direct) + npc->xm = 0x200; + else + npc->xm = -0x200; + break; + case 70: + npc->act_no = 71; + npc->act_wait = 64; + PlaySoundObject(29, 1); + npc->ani_no = 13; + case 71: + if (!--npc->act_wait) + npc->cond = 0; + break; + case 80: + npc->count1 = 0; + npc->act_no = 81; + case 81: + if (++npc->count1 / 2 & 1) + npc->x += 0x200; + else + npc->x -= 0x200; + npc->ani_no = 5; + npc->xm = 0; + npc->ym += 32; + break; + case 100: + npc->act_no = 101; + npc->act_wait = 0; + npc->ani_no = 2; + case 101: + if (++npc->act_wait > 20) + { + npc->act_no = 102; + npc->act_wait = 0; + npc->ani_no = 3; + npc->ym = -0x800; + npc->bits |= npc_ignoreSolid; + DeleteNpCharCode(150, 0); + DeleteNpCharCode(117, 0); + SetNpChar(355, 0, 0, 0, 0, 0, npc, 0x100); + SetNpChar(355, 0, 0, 0, 0, 1, npc, 0x100); + } + break; + case 102: + x = npc->x / 0x2000; + y = npc->y / 0x2000; + if (y >= 0 && y <= 34 && ChangeMapParts(x, y, 0)) + { + ChangeMapParts(x - 1, y, 0); + ChangeMapParts(x + 1, y, 0); + PlaySoundObject(44, 1); + SetQuake2(10); + } + if (npc->y < -0x4000) + { + npc->code_char = 0; + SetQuake(30); + } + break; + default: + break; + } + + if (npc->tgt_x && !Random(0, 10)) + SetNpChar(4, npc->x + (Random(-12, 12) << 9), npc->y + (Random(-12, 12) << 9), Random(-0x155, 0x155), Random(-0x600, 0), 0, 0, 0x100); + + if (npc->ym > 0x5FF) + npc->ym = 0x5FF; + npc->x += npc->xm; + npc->y += npc->ym; + RECT rect_left[14]; RECT rect_right[14]; @@ -837,6 +1063,18 @@ void ActNpc012(NPCHAR *npc) rect_right[11] = {40, 72, 80, 96}; rect_right[12] = {0, 24, 40, 48}; rect_right[13] = {280, 24, 320, 48}; + + if (npc->direct) + npc->rect = rect_right[npc->ani_no]; + else + npc->rect = rect_left[npc->ani_no]; + + if (npc->act_no == 71) + { + npc->rect.bottom = npc->act_wait / 2 + npc->rect.top; + if (npc->act_wait & 1) + ++npc->rect.left; + } } //Chest (closed) @@ -1049,11 +1287,88 @@ void ActNpc018(NPCHAR *npc) break; case 1: - for (int i = 0; i < 4; ++i) + for (int i = 0; i < 4; i++) SetNpChar(4, npc->x, npc->y, Random(-341, 341), Random(-0x600, 0), 0, 0, 0x100); npc->act_no = 0; npc->rect = rect[0]; break; } -} \ No newline at end of file +} + +//Balrog (burst) +void ActNpc019(NPCHAR *npc) +{ + switch ( npc->act_no ) + { + case 0: + for (int i = 0; i < 16; i++) + SetNpChar(4, npc->x, npc->y, Random(-341, 341), Random(-0x600, 0), 0, 0, 0x100); + npc->y += 0x1400; + npc->act_no = 1; + npc->ani_no = 3; + npc->ym = -0x100; + PlaySoundObject(12, 1); + PlaySoundObject(26, 1); + SetQuake(30); + case 1: + npc->ym += 0x10; + if (npc->ym > 0 && npc->flag & 8) + { + npc->act_no = 2; + npc->ani_no = 2; + npc->act_wait = 0; + PlaySoundObject(26, 1); + SetQuake(30); + } + break; + case 2: + if (++npc->act_wait > 16) + { + npc->act_no = 3; + npc->ani_no = 0; + npc->ani_wait = 0; + } + break; + case 3: + if (Random(0, 100) == 0) + { + npc->act_no = 4; + npc->act_wait = 0; + npc->ani_no = 1; + } + break; + case 4: + if (++npc->act_wait > 16) + { + npc->act_no = 3; + npc->ani_no = 0; + } + break; + default: + break; + } + + if (npc->ym > 0x5FF) + npc->ym = 0x5FF; + if (npc->ym < -0x5FF) + npc->ym = -0x5FF; + npc->x += npc->xm; + npc->y += npc->ym; + + RECT rect_left[4]; + RECT rect_right[4]; + rect_left[0] = {0, 0, 40, 24}; + rect_left[1] = {160, 0, 200, 24}; + rect_left[2] = {80, 0, 120, 24}; + rect_left[3] = {120, 0, 160, 24}; + rect_right[0] = {0, 24, 40, 48}; + rect_right[1] = {160, 24, 200, 48}; + rect_right[2] = {80, 24, 120, 48}; + rect_right[3] = {120, 24, 160, 48}; + + if (npc->direct) + npc->rect = rect_right[npc->ani_no]; + else + npc->rect = rect_left[npc->ani_no]; +} diff --git a/src/NpcTbl.cpp b/src/NpcTbl.cpp index c01b54f3..110bdfba 100644 --- a/src/NpcTbl.cpp +++ b/src/NpcTbl.cpp @@ -68,14 +68,14 @@ NPCFUNCTION gpNpcFuncTbl[361] = nullptr, nullptr, nullptr, - nullptr, + ActNpc012, nullptr, nullptr, ActNpc015, ActNpc016, ActNpc017, ActNpc018, - nullptr, + ActNpc019, ActNpc020, ActNpc021, ActNpc022, diff --git a/src/TextScr.cpp b/src/TextScr.cpp index 958f0c31..66c916db 100644 --- a/src/TextScr.cpp +++ b/src/TextScr.cpp @@ -15,6 +15,7 @@ #include "MycParam.h" #include "Flags.h" #include "Profile.h" +#include "Map.h" #include "MapName.h" #include "KeyControl.h" #include "NpChar.h" @@ -983,6 +984,21 @@ int TextScriptProc() MoveNpChar(w, x << 13, y << 13, z); gTS.p_read += 23; } + else if (IS_COMMAND('S','M','P')) + { + x = GetTextScriptNo(gTS.p_read + 4); + y = GetTextScriptNo(gTS.p_read + 9); + ShiftMapParts(x, y); + gTS.p_read += 13; + } + else if (IS_COMMAND('C','M','P')) + { + x = GetTextScriptNo(gTS.p_read + 4); + y = GetTextScriptNo(gTS.p_read + 9); + z = GetTextScriptNo(gTS.p_read + 14); + ChangeMapParts(x, y, z); + gTS.p_read += 18; + } else if (IS_COMMAND('M','Y','D')) { z = GetTextScriptNo(gTS.p_read + 4);