summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-10-23 19:20:41 +0300
committerAndrei Karas <akaras@inbox.ru>2015-10-23 19:20:41 +0300
commita659c48f25245f32e53aaac320c8151770794c6b (patch)
tree5f3739a0988f6338d6e40c4c73aebf07d18a07f0
parent73ccd23e1ff25cb1194cde9fa5789e6a8f9ed547 (diff)
downloadserverdata-a659c48f25245f32e53aaac320c8151770794c6b.tar.gz
serverdata-a659c48f25245f32e53aaac320c8151770794c6b.tar.bz2
serverdata-a659c48f25245f32e53aaac320c8151770794c6b.tar.xz
serverdata-a659c48f25245f32e53aaac320c8151770794c6b.zip
Move timer logic for graph based npcs to function.
-rw-r--r--npc/001-1/flyingpiou.txt7
-rw-r--r--npc/001-1/juscare.txt7
-rw-r--r--npc/001-2-28/jenna.txt7
-rw-r--r--npc/functions/npcmovegraph.txt9
-rw-r--r--npc/test/npc5.txt7
5 files changed, 13 insertions, 24 deletions
diff --git a/npc/001-1/flyingpiou.txt b/npc/001-1/flyingpiou.txt
index 44e2cfce..5ed9ddbc 100644
--- a/npc/001-1/flyingpiou.txt
+++ b/npc/001-1/flyingpiou.txt
@@ -99,12 +99,7 @@ OnHour00:
end;
OnTimer1000:
- if (!isunitwalking())
- {
- movetonextpoint;
- }
- initnpctimer;
- end;
+ dographmovestep;
OnInit:
.sex = G_OTHER;
diff --git a/npc/001-1/juscare.txt b/npc/001-1/juscare.txt
index a81cbc27..e6cdc9cb 100644
--- a/npc/001-1/juscare.txt
+++ b/npc/001-1/juscare.txt
@@ -38,12 +38,7 @@
localClose;
OnTimer1000:
- if (!isunitwalking())
- {
- movetonextpoint;
- }
- initnpctimer;
- end;
+ dographmovestep;
OnInit:
.sex = G_MALE;
diff --git a/npc/001-2-28/jenna.txt b/npc/001-2-28/jenna.txt
index f46cdf3e..6685775a 100644
--- a/npc/001-2-28/jenna.txt
+++ b/npc/001-2-28/jenna.txt
@@ -27,12 +27,7 @@
close;
OnTimer1000:
- if (!isunitwalking())
- {
- movetonextpoint;
- }
- initnpctimer;
- end;
+ dographmovestep;
OnTouch:
SayRandomGreeting;
diff --git a/npc/functions/npcmovegraph.txt b/npc/functions/npcmovegraph.txt
index ff7b7d75..284c8c19 100644
--- a/npc/functions/npcmovegraph.txt
+++ b/npc/functions/npcmovegraph.txt
@@ -426,3 +426,12 @@ function script npc_turntoxy {
return 0;
}
+
+function script dographmovestep {
+ if (!isunitwalking())
+ {
+ movetonextpoint;
+ }
+ initnpctimer;
+ end;
+}
diff --git a/npc/test/npc5.txt b/npc/test/npc5.txt
index 9978447b..d62e8f54 100644
--- a/npc/test/npc5.txt
+++ b/npc/test/npc5.txt
@@ -13,12 +13,7 @@ test,45,25,0 script npc5 NPC_PLAYER,{
close;
OnTimer1000:
- if (!isunitwalking())
- {
- movetonextpoint;
- }
- initnpctimer;
- end;
+ dographmovestep;
OnInit:
// .debug = 1;