summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWushin <pasekei@gmail.com>2016-04-25 14:21:28 -0500
committerWushin <pasekei@gmail.com>2016-04-25 14:21:28 -0500
commit9a022915b5a3415c342284ba4c925f85b4c6bd99 (patch)
treef9884766855a1c6fb1897c2dba1fc426ad988cd3
parent4a93f69c74e80111c0b4fe9f5875ff2ed83c4b94 (diff)
parent7c21e91ca9dc319e16611e90ca64371c9a2678ab (diff)
downloadserverdata-9a022915b5a3415c342284ba4c925f85b4c6bd99.tar.gz
serverdata-9a022915b5a3415c342284ba4c925f85b4c6bd99.tar.bz2
serverdata-9a022915b5a3415c342284ba4c925f85b4c6bd99.tar.xz
serverdata-9a022915b5a3415c342284ba4c925f85b4c6bd99.zip
Merge pull request #486 from mekolat/improve-ferry
Improve ferry
-rw-r--r--world/map/npc/001-1/dock.txt30
-rw-r--r--world/map/npc/002-1/_import.txt1
-rw-r--r--world/map/npc/002-1/dock.txt5
-rw-r--r--world/map/npc/008-1/dock.txt60
-rw-r--r--world/map/npc/009-1/_import.txt1
-rw-r--r--world/map/npc/009-1/dock.txt8
-rw-r--r--world/map/npc/020-1/_import.txt1
-rw-r--r--world/map/npc/020-1/dock.txt6
-rw-r--r--world/map/npc/029-1/dock.txt30
-rw-r--r--world/map/npc/031-1/dock.txt27
-rw-r--r--world/map/npc/functions/ferry.txt68
11 files changed, 150 insertions, 87 deletions
diff --git a/world/map/npc/001-1/dock.txt b/world/map/npc/001-1/dock.txt
index 0aacdcdb..077e3ce6 100644
--- a/world/map/npc/001-1/dock.txt
+++ b/world/map/npc/001-1/dock.txt
@@ -1,27 +1,47 @@
// The ferry dock
// Author: Wushin
-// Ferry Sign
-001-1,61,71,0|script|Ferry Schedule#2|396
+001-1,75,70,0|script|Tulimshar Koga|395,9,4
{
- callfunc "FerryManifest";
+ set @npc_distance, 10;
+ callfunc "PCtoNPCRange";
+ if(@npc_check) end;
+ callfunc "BoardFerry";
+ end;
+
+OnTouch:
+ addtimer get(.warp_delay, "#FerryConfig"), strnpcinfo(0)+"::OnBoard";
+ end;
+
+OnBoard:
+ callfunc "BoardFerry";
end;
}
-001-1,75,70,0|script|Tulimshar Koga|395,8,3
+001-1,68,72,0|script|Tulimshar Dock|400,2,2
{
+ set @npc_distance, 3;
+ callfunc "PCtoNPCRange";
+ if(@npc_check) end;
callfunc "BoardFerry";
- close;
+ end;
}
001-1,70,70,0|script|#TulimsharDock|32767
{
end;
OnCommandArrive:
+ disablenpc "Tulimshar Dock";
enablenpc "Tulimshar Koga";
+ areatimer 0, "001-1", 66, 71, 77, 73, get(.warp_delay, "#FerryConfig"), strnpcinfo(0)+"::OnAreaWarp"; // warp players on dock
+ end;
+
+OnAreaWarp:
+ callfunc "BoardFerry";
end;
OnCommandWarp:
disablenpc "Tulimshar Koga";
+ enablenpc "Tulimshar Dock";
end;
}
diff --git a/world/map/npc/002-1/_import.txt b/world/map/npc/002-1/_import.txt
index 1e4e50cf..b052f96e 100644
--- a/world/map/npc/002-1/_import.txt
+++ b/world/map/npc/002-1/_import.txt
@@ -6,7 +6,6 @@ npc: npc/002-1/_nodes.txt
npc: npc/002-1/_warps.txt
npc: npc/002-1/anwar.txt
npc: npc/002-1/bard.txt
-npc: npc/002-1/dock.txt
npc: npc/002-1/elanore.txt
npc: npc/002-1/gaurds.txt
npc: npc/002-1/itka.txt
diff --git a/world/map/npc/002-1/dock.txt b/world/map/npc/002-1/dock.txt
deleted file mode 100644
index db947145..00000000
--- a/world/map/npc/002-1/dock.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-002-1,67,65,0|script|Ferry Schedule#3|396
-{
- callfunc "FerryManifest";
- end;
-}
diff --git a/world/map/npc/008-1/dock.txt b/world/map/npc/008-1/dock.txt
index 42763609..acb3a23e 100644
--- a/world/map/npc/008-1/dock.txt
+++ b/world/map/npc/008-1/dock.txt
@@ -1,43 +1,91 @@
// The ferry dock
-008-1,134,69,0|script|Ferry Schedule#5|397
+008-1,147,64,0|script|Hurnscald North Koga|395,10,3
{
- callfunc "FerryManifest";
+ set @npc_distance, 11;
+ callfunc "PCtoNPCRange";
+ if(@npc_check) end;
+ callfunc "BoardFerry";
+ end;
+
+OnTouch:
+ addtimer get(.warp_delay, "#FerryConfig"), strnpcinfo(0)+"::OnBoard";
+ end;
+
+OnBoard:
+ callfunc "BoardFerry";
end;
}
-008-1,147,64,0|script|Hurnscald North Koga|395,8,3
+008-1,139,65,0|script|Hurnscald North Dock|400,2,1
{
+ set @npc_distance, 3;
+ callfunc "PCtoNPCRange";
+ if(@npc_check) end;
callfunc "BoardFerry";
- close;
+ end;
}
008-1,120,44,0|script|#Hurnscald NorthDock|32767
{
end;
OnCommandArrive:
+ disablenpc "Hurnscald North Dock";
enablenpc "Hurnscald North Koga";
+ areatimer 0, "008-1", 137, 64, 141, 65, get(.warp_delay, "#FerryConfig"), strnpcinfo(0)+"::OnAreaWarp"; // warp players on dock
+ end;
+
+OnAreaWarp:
+ callfunc "BoardFerry";
end;
OnCommandWarp:
disablenpc "Hurnscald North Koga";
+ enablenpc "Hurnscald North Dock";
+ end;
+}
+
+008-1,147,75,0|script|Hurnscald South Koga|395,10,3
+{
+ set @npc_distance, 10;
+ callfunc "PCtoNPCRange";
+ if(@npc_check) end;
+ callfunc "BoardCandorFerry";
+ end;
+
+OnTouch:
+ addtimer get(.warp_delay, "#FerryConfig"), strnpcinfo(0)+"::OnBoard";
+ end;
+
+OnBoard:
+ callfunc "BoardCandorFerry";
end;
}
-008-1,147,75,0|script|Hurnscald South Koga|395,8,3
+008-1,139,76,0|script|Hurnscald South Dock|400,2,1
{
+ set @npc_distance, 3;
+ callfunc "PCtoNPCRange";
+ if(@npc_check) end;
callfunc "BoardCandorFerry";
- close;
+ end;
}
008-1,65,25,0|script|#Hurnscald SouthDock|32767
{
end;
OnCommandArrive:
+ disablenpc "Hurnscald South Dock";
enablenpc "Hurnscald South Koga";
+ areatimer 0, "008-1", 137, 75, 141, 76, get(.warp_delay, "#FerryConfig"), strnpcinfo(0)+"::OnAreaWarp"; // warp players on dock
+ end;
+
+OnAreaWarp:
+ callfunc "BoardCandorFerry";
end;
OnCommandWarp:
disablenpc "Hurnscald South Koga";
+ enablenpc "Hurnscald South Dock";
end;
}
diff --git a/world/map/npc/009-1/_import.txt b/world/map/npc/009-1/_import.txt
index 6c27b6c5..2e6b551f 100644
--- a/world/map/npc/009-1/_import.txt
+++ b/world/map/npc/009-1/_import.txt
@@ -5,7 +5,6 @@ npc: npc/009-1/_mobs.txt
npc: npc/009-1/_nodes.txt
npc: npc/009-1/_warps.txt
npc: npc/009-1/constable.txt
-npc: npc/009-1/dock.txt
npc: npc/009-1/guide.txt
npc: npc/009-1/jack.txt
npc: npc/009-1/mapflags.txt
diff --git a/world/map/npc/009-1/dock.txt b/world/map/npc/009-1/dock.txt
deleted file mode 100644
index fab8f3d0..00000000
--- a/world/map/npc/009-1/dock.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-// Ferry Sign
-
-009-1,46,34,0|script|FerrySchedule#4|397
-{
- callfunc "FerryManifest";
- end;
-}
-
diff --git a/world/map/npc/020-1/_import.txt b/world/map/npc/020-1/_import.txt
index a48fad5d..dec7f1d5 100644
--- a/world/map/npc/020-1/_import.txt
+++ b/world/map/npc/020-1/_import.txt
@@ -5,7 +5,6 @@ npc: npc/020-1/KrickKrackKrock.txt
npc: npc/020-1/_mobs.txt
npc: npc/020-1/_nodes.txt
npc: npc/020-1/_warps.txt
-npc: npc/020-1/dock.txt
npc: npc/020-1/mapflags.txt
npc: npc/020-1/rockscissor.txt
npc: npc/020-1/soul-menhir.txt
diff --git a/world/map/npc/020-1/dock.txt b/world/map/npc/020-1/dock.txt
deleted file mode 100644
index 46d7de73..00000000
--- a/world/map/npc/020-1/dock.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-// Ferry Sign
-020-1,81,76,0|script|Ferry Schedule#7|398
-{
- callfunc "FerryManifest";
- end;
-}
diff --git a/world/map/npc/029-1/dock.txt b/world/map/npc/029-1/dock.txt
index f0628440..fcb27b6c 100644
--- a/world/map/npc/029-1/dock.txt
+++ b/world/map/npc/029-1/dock.txt
@@ -1,26 +1,46 @@
// The ferry dock
-// Ferry Sign
-029-1,43,104,0|script|Ferry Schedule#8|397
+029-1,46,111,0|script|Candor Dock|400,1,0
{
- callfunc "FerryManifest";
+ set @npc_distance, 1;
+ callfunc "PCtoNPCRange";
+ if(@npc_check) end;
+ callfunc "BoardCandorFerry";
+ end;
+
+OnTouch:
+ addtimer get(.warp_delay, "#FerryConfig"), strnpcinfo(0)+"::OnBoard";
+ end;
+
+OnBoard:
+ callfunc "BoardCandorFerry";
end;
}
-029-1,51,118,0|script|Candor Koga|395,8,8
+029-1,51,118,0|script|Candor Koga|395,8,7
{
+ set @npc_distance, 8;
+ callfunc "PCtoNPCRange";
+ if(@npc_check) end;
callfunc "BoardCandorFerry";
- close;
+ end;
}
029-1,55,110,0|script|#CandorDock|32767
{
end;
OnCommandArrive:
+ disablenpc "Candor Dock";
enablenpc "Candor Koga";
+ areatimer 0, "029-1", 39, 111, 53, 113, get(.warp_delay, "#FerryConfig"), strnpcinfo(0)+"::OnAreaWarp"; // warp players on dock
+ end;
+
+OnAreaWarp:
+ callfunc "BoardCandorFerry";
end;
OnCommandWarp:
disablenpc "Candor Koga";
+ enablenpc "Candor Dock";
end;
}
diff --git a/world/map/npc/031-1/dock.txt b/world/map/npc/031-1/dock.txt
index b19cf271..1904487e 100644
--- a/world/map/npc/031-1/dock.txt
+++ b/world/map/npc/031-1/dock.txt
@@ -1,16 +1,26 @@
// The ferry dock
-// Ferry Sign
-031-1,95,107,0|script|Ferry Schedule#6|398
+031-1,110,108,0|script|Nivalis Koga|395,12,2
{
- callfunc "FerryManifest";
+ callfunc "BoardFerry";
+ end;
+
+OnTouch:
+ addtimer get(.warp_delay, "#FerryConfig"), strnpcinfo(0)+"::OnBoard";
+ end;
+
+OnBoard:
+ callfunc "BoardFerry";
end;
}
-031-1,110,108,0|script|Nivalis Koga|395,6,2
+031-1,99,109,0|script|Nivalis Dock|400,2,1
{
+ set @npc_distance, 3;
+ callfunc "PCtoNPCRange";
+ if(@npc_check) end;
callfunc "BoardFerry";
- close;
+ end;
}
031-1,100,100,0|script|#NivalisDock|32767
@@ -18,10 +28,17 @@
end;
OnCommandArrive:
+ disablenpc "Nivalis Dock";
enablenpc "Nivalis Koga";
+ areatimer 0, "031-1", 97, 108, 108, 110, get(.warp_delay, "#FerryConfig"), strnpcinfo(0)+"::OnAreaWarp"; // warp players on dock
+ end;
+
+OnAreaWarp:
+ callfunc "BoardFerry";
end;
OnCommandWarp:
disablenpc "Nivalis Koga";
+ enablenpc "Nivalis Dock";
end;
}
diff --git a/world/map/npc/functions/ferry.txt b/world/map/npc/functions/ferry.txt
index eb7196d1..5f9e57f7 100644
--- a/world/map/npc/functions/ferry.txt
+++ b/world/map/npc/functions/ferry.txt
@@ -18,9 +18,10 @@ OnInit:
setarray $@CandorDocks$, "Candor", "Hurnscald South";
donpcevent "#"+$@MainDocks$[$@MainCurrentDock]+"Dock::OnCommandArrive";
donpcevent "#"+$@CandorDocks$[$@CandorCurrentDock]+"Dock::OnCommandArrive";
+ set .warp_delay, 430;
if (debug >= 2) end;
initnpctimer;
- end;
+ goto L_k1city2;
L_NextDock:
set $@MainLastDock, $@MainCurrentDock;
@@ -47,7 +48,7 @@ L_NextDock:
if($@MainCurrentDock == 1) goto L_k1city3;
end;
-OnTimer8000:
+OnTimer5000:
if ($@DockTickCount > $@DockLeaveCount)
goto L_NextDock;
set $@DockTickCount, $@DockTickCount + 1;
@@ -99,60 +100,39 @@ function|script|FerryHelp
mes "\"We also have some slot machines in case you get bored.\"";
return;
}
-function|script|FerryManifest
-{
- mes "Which Ferry do you want to check the schedule for?";
- menu
- "World Ferry.", L_WorldFerry,
- "Candor Ferry.", L_CandorFerry;
-
-L_CandorFerry:
- mes "The ferry is currently at "+$@CandorDocks$[$@CandorCurrentDock];
- set @NextDock, ($@CandorCurrentDock + 1);
- if(@NextDock == getarraysize($@CandorDocks$))
- set @NextDock, 0;
- mes "The ferry will be arriving at "+$@CandorDocks$[@NextDock]+" next";
- goto L_Close;
-
-L_WorldFerry:
- mes "The ferry is currently at "+$@MainDocks$[$@MainCurrentDock];
- set @NextDock, ($@MainCurrentDock + 1);
- if(@NextDock == getarraysize($@MainDocks$))
- set @NextDock, 0;
- mes "The ferry will be arriving at "+$@MainDocks$[@NextDock]+" next";
- goto L_Close;
-
-L_Close:
- close2;
- return;
-}
function|script|BoardFerry
{
- mes "Board the ferry?";
- menu
- "Yes.", L_Board,
- "No.", L_Return;
+ if ($@MainCurrentDock == 0 && getmap() == "008-1") goto L_Board;
+ elif ($@MainCurrentDock == 1 && getmap() == "031-1") goto L_Board;
+ elif ($@MainCurrentDock == 2 && getmap() == "001-1") goto L_Board;
+
+ set @NextDock, $@MainCurrentDock + 1;
+ if(@NextDock == getarraysize($@MainDocks$)) set @NextDock, 0;
+ message strcharinfo(0),
+ "Ferry : ##3The ferry is currently at ##B"+$@MainDocks$[$@MainCurrentDock]+"##b. "
+ +"It will be arriving at ##B"+$@MainDocks$[@NextDock]+"##b next.";
+ return;
L_Board:
- close2;
- warp "035-2",39,29;
- goto L_Return;
-
-L_Return:
+ warp "035-2",32,29;
return;
}
function|script|BoardCandorFerry
{
- mes "Board the ferry?";
- menu
- "Yes.", L_Board,
- "No.", L_Return;
+ if ($@CandorCurrentDock == 0 && getmap() == "029-1") goto L_Board;
+ elif ($@CandorCurrentDock == 1 && getmap() == "008-1") goto L_Board;
+
+ set @NextDock, $@CandorCurrentDock + 1;
+ if(@NextDock == getarraysize($@CandorDocks$)) set @NextDock, 0;
+ message strcharinfo(0),
+ "Ferry : ##3The ferry is currently at ##B"+$@CandorDocks$[$@CandorCurrentDock]+"##b. "
+ +"It will be arriving at ##B"+$@CandorDocks$[@NextDock]+"##b next.";
+ return;
L_Board:
- close2;
- warp "036-2",39,29;
+ warp "036-2",32,29;
goto L_Return;
L_Return: