From 7c6c2416bc152de0758d7441a373e260b40c4d5b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 27 Sep 2015 19:06:59 +0300 Subject: Replace getnpcdir and setnpcdir with one or zero parameters to variable '.dir'. --- npc/000-1/chest.txt | 10 +++++----- npc/000-1/tarlan.txt | 4 ++-- npc/000-2-1/chest.txt | 10 +++++----- npc/000-2-3/piourocket.txt | 4 ++-- npc/001-1/beuss.txt | 4 ++-- npc/001-1/treeleaf.txt | 4 ++-- npc/001-2-22/chest.txt | 8 ++++---- npc/001-2-24/piourocket.txt | 4 ++-- npc/001-2-26/flask.txt | 4 ++-- npc/001-2-4/terry.txt | 4 ++-- npc/functions/doors.txt | 10 +++++----- npc/functions/hammocks.txt | 10 +++++----- npc/functions/harbours.txt | 12 ++++++------ npc/functions/npcmovegraph.txt | 2 +- npc/test/npc1.txt | 2 +- 15 files changed, 46 insertions(+), 46 deletions(-) diff --git a/npc/000-1/chest.txt b/npc/000-1/chest.txt index c11180f6a..15e9c922f 100644 --- a/npc/000-1/chest.txt +++ b/npc/000-1/chest.txt @@ -12,9 +12,9 @@ // 1 Treasure Chest has been opened. 000-1,83,70,0 script #chest NPC_CHEST,{ - if (getnpcdir ("") != 4) + if (.dir != 4) { - setnpcdir 2; + .dir = 2; initnpctimer; startnpctimer; close; @@ -30,15 +30,15 @@ npctalk3 l("You open the treasure chest."); } - setnpcdir 6; + .dir = 6; initnpctimer; startnpctimer; close; OnTimer160: stopnpctimer; - if (getnpcdir ("") == 2) setnpcdir 4; - if (getnpcdir ("") == 6) setnpcdir 0; + if (.dir == 2) .dir = 4; + if (.dir == 6) .dir = 0; end; OnInit: diff --git a/npc/000-1/tarlan.txt b/npc/000-1/tarlan.txt index bae3109f4..fb5cec58d 100644 --- a/npc/000-1/tarlan.txt +++ b/npc/000-1/tarlan.txt @@ -5,7 +5,7 @@ // Sailor hitting a crocotree, then being struck by a falling croconut. 000-1,33,37,0 script Tarlan NPC_TARLAN,{ - setnpcdir 2; + .dir = 2; mesn; .@a = rand(4); @@ -55,7 +55,7 @@ L_DoYou: goto L_Quit; L_Quit: - setnpcdir 4; + .dir = 4; close; OnInit: diff --git a/npc/000-2-1/chest.txt b/npc/000-2-1/chest.txt index 70b72c9b0..563e4fdea 100644 --- a/npc/000-2-1/chest.txt +++ b/npc/000-2-1/chest.txt @@ -14,9 +14,9 @@ .@q = getq(ShipQuests_Arpan); if (.@q == 0) goto L_Talk; - if (getnpcdir ("") == 4) goto L_Give; + if (.dir == 4) goto L_Give; - setnpcdir 2; + .dir = 2; initnpctimer; startnpctimer; close; @@ -35,8 +35,8 @@ L_Give: OnTimer220: stopnpctimer; - if (getnpcdir ("") == 2) setnpcdir 4; - if (getnpcdir ("") == 6) setnpcdir 0; + if (.dir == 2) .dir = 4; + if (.dir == 6) .dir = 0; end; L_Talk: @@ -45,7 +45,7 @@ L_Talk: close; L_Quit: - setnpcdir 6; + .dir = 6; initnpctimer; startnpctimer; close; diff --git a/npc/000-2-3/piourocket.txt b/npc/000-2-3/piourocket.txt index f12cf8076..8fa0f0453 100644 --- a/npc/000-2-3/piourocket.txt +++ b/npc/000-2-3/piourocket.txt @@ -5,13 +5,13 @@ // Jumping piou. 000-2-3,27,23,4 script #piourocket NPC_PIOU_ROCKET,{ - setnpcdir 2; + .dir = 2; stopnpctimer; initnpctimer; close; OnTimer1420: - setnpcdir 4; + .dir = 4; stopnpctimer; end; diff --git a/npc/001-1/beuss.txt b/npc/001-1/beuss.txt index 404d28a8e..a91c00456 100644 --- a/npc/001-1/beuss.txt +++ b/npc/001-1/beuss.txt @@ -7,7 +7,7 @@ 001-1,45,52,0 script Beuss NPC_BEUSS,{ stopnpctimer; initnpctimer; - setnpcdir 4; + .dir = 4; mesn; mesq l("You are too weak, what is a piece of bone like you doing around here?"); @@ -17,7 +17,7 @@ L_Close: close; OnTimer10000: - setnpcdir 2; + .dir = 2; stopnpctimer; end; diff --git a/npc/001-1/treeleaf.txt b/npc/001-1/treeleaf.txt index b8577496c..dea3ce81f 100644 --- a/npc/001-1/treeleaf.txt +++ b/npc/001-1/treeleaf.txt @@ -5,13 +5,13 @@ // Falling tree leaf 001-1,39,54,4 script #treeleaf0 NPC_TREE_LEAF,{ - setnpcdir 2; + .dir = 2; stopnpctimer; initnpctimer; close; OnTimer2800: - setnpcdir 4; + .dir = 4; stopnpctimer; end; diff --git a/npc/001-2-22/chest.txt b/npc/001-2-22/chest.txt index 4ee4ae442..e20a00da2 100644 --- a/npc/001-2-22/chest.txt +++ b/npc/001-2-22/chest.txt @@ -7,19 +7,19 @@ 001-2-22,51,37,0 script Chest#Artis NPC_CHEST_BIG,{ - setnpcdir 2; + .dir = 2; initnpctimer; startnpctimer; close; OnTimer220: stopnpctimer; - if (getnpcdir ("") == 2) setnpcdir 4; - if (getnpcdir ("") == 6) setnpcdir 0; + if (.dir == 2) .dir = 4; + if (.dir == 6) .dir = 0; end; L_Quit: - setnpcdir 6; + .dir = 6; initnpctimer; startnpctimer; close; diff --git a/npc/001-2-24/piourocket.txt b/npc/001-2-24/piourocket.txt index 7f56a3733..6aab9fb8d 100644 --- a/npc/001-2-24/piourocket.txt +++ b/npc/001-2-24/piourocket.txt @@ -5,13 +5,13 @@ // Jumping piou. 001-2-24,27,23,4 script #piourocketArtis NPC_PIOU_ROCKET,{ - setnpcdir 2; + .dir = 2; stopnpctimer; initnpctimer; close; OnTimer1420: - setnpcdir 4; + .dir = 4; stopnpctimer; end; diff --git a/npc/001-2-26/flask.txt b/npc/001-2-26/flask.txt index 1db45c5fd..8afa58c3f 100644 --- a/npc/001-2-26/flask.txt +++ b/npc/001-2-26/flask.txt @@ -5,13 +5,13 @@ // Alchemy animation. 001-2-26,32,27,4 script #FlaskAlchemyLab NPC_FLASK,{ - setnpcdir 2; + .dir = 2; stopnpctimer; initnpctimer; close; OnTimer12920: - setnpcdir 4; + .dir = 4; stopnpctimer; end; diff --git a/npc/001-2-4/terry.txt b/npc/001-2-4/terry.txt index 7509246a0..feaa0dfa5 100644 --- a/npc/001-2-4/terry.txt +++ b/npc/001-2-4/terry.txt @@ -14,10 +14,10 @@ OnInit: .sex = G_MALE; .distance = 2; - setnpcdir 2; + .dir = 2; end; L_Quit: - setnpcdir 2; + .dir = 2; close; } diff --git a/npc/functions/doors.txt b/npc/functions/doors.txt index 1ddc0d122..49b2846ea 100644 --- a/npc/functions/doors.txt +++ b/npc/functions/doors.txt @@ -9,7 +9,7 @@ function script doorTouch { if (getareausers() <= 1) { - setnpcdir 2; + .dir = 2; stopnpctimer; initnpctimer; } @@ -19,7 +19,7 @@ function script doorTouch { function script doorUnTouch { if (getareausers() == 0) { - setnpcdir 4; + .dir = 4; initnpctimer; startnpctimer; } @@ -28,15 +28,15 @@ function script doorUnTouch { function script doorTimer { stopnpctimer; - if (getnpcdir() == 2) setnpcdir 6; - if (getnpcdir() == 4) setnpcdir 8; + if (.dir == 2) .dir = 6; + if (.dir == 4) .dir = 8; end; } function script open_door { .@door$ = getarg(0); - setnpcdir .@door$, 2; + setnpcdir.@door$, 2; sleep 300; setnpcdir .@door$, 6; sleep 300; diff --git a/npc/functions/hammocks.txt b/npc/functions/hammocks.txt index 79b9328da..8e1c2fec4 100644 --- a/npc/functions/hammocks.txt +++ b/npc/functions/hammocks.txt @@ -10,7 +10,7 @@ function script hamTouchLeft { if (getareausers() <= 1) { - setnpcdir 0; + .dir = 0; stopnpctimer; initnpctimer; } @@ -20,7 +20,7 @@ function script hamTouchLeft { function script hamUnTouch { if (getareausers() == 0) { - setnpcdir 2; + .dir = 2; initnpctimer; startnpctimer; } @@ -29,14 +29,14 @@ function script hamUnTouch { function script hamTimerLeft { stopnpctimer; - if (getnpcdir() == 2) setnpcdir 0; + if (.dir == 2) .dir = 0; end; } function script hamTouchRight { if (getareausers() <= 1) { - setnpcdir 0; + .dir = 0; stopnpctimer; initnpctimer; } @@ -45,6 +45,6 @@ function script hamTouchRight { function script hamTimerRight { stopnpctimer; - if (getnpcdir() == 2) setnpcdir 0; + if (.dir == 2) .dir = 0; end; } diff --git a/npc/functions/harbours.txt b/npc/functions/harbours.txt index eae24e24d..0cb91bab9 100644 --- a/npc/functions/harbours.txt +++ b/npc/functions/harbours.txt @@ -12,18 +12,18 @@ // 8 Hook up. function script harbourClic { - if (getnpcdir () == 0) + if (.dir == 0) { - setnpcdir 2; + .dir = 2; initnpctimer; startnpctimer; close; } - if (getnpcdir () == 6) + if (.dir == 6) { - setnpcdir 4; + .dir = 4; initnpctimer; startnpctimer; @@ -33,7 +33,7 @@ function script harbourClic { function script harbourTimer { stopnpctimer; - if (getnpcdir () == 2) setnpcdir 6; - if (getnpcdir () == 4) setnpcdir 0; + if (.dir == 2) .dir = 6; + if (.dir == 4) .dir = 0; end; } diff --git a/npc/functions/npcmovegraph.txt b/npc/functions/npcmovegraph.txt index 9bfebc99a..cb2c3471f 100644 --- a/npc/functions/npcmovegraph.txt +++ b/npc/functions/npcmovegraph.txt @@ -102,7 +102,7 @@ function script execmovecmd { } else if (.@cmd$[0] == "dir") { - setnpcdir atoi(.@cmd$[1]); + .dir = atoi(.@cmd$[1]); } else if (.@cmd$[0] == "sit") { diff --git a/npc/test/npc1.txt b/npc/test/npc1.txt index 0a52a2790..4cd766a12 100644 --- a/npc/test/npc1.txt +++ b/npc/test/npc1.txt @@ -85,7 +85,7 @@ L_Start: for (.@f = 0; .@f < 9; .@f ++) { mes "" + .@f; - setnpcdir .@f; + .dir = .@f; next; } break; -- cgit v1.2.3-70-g09d2