summaryrefslogtreecommitdiff
path: root/world/map/npc/021-2/kps.txt
diff options
context:
space:
mode:
authorwushin <pasekei@gmail.com>2014-10-27 14:25:49 -0500
committerwushin <pasekei@gmail.com>2014-10-27 14:43:28 -0500
commit2749e3987af5685988a0119f15f6f476319b5561 (patch)
tree1af6f0d54e2d360c242f2421e9a5caec775a96f3 /world/map/npc/021-2/kps.txt
parent0bc1c20799c9b01e60035ce1c82fd8a38c110c4c (diff)
downloadserverdata-2749e3987af5685988a0119f15f6f476319b5561.tar.gz
serverdata-2749e3987af5685988a0119f15f6f476319b5561.tar.bz2
serverdata-2749e3987af5685988a0119f15f6f476319b5561.tar.xz
serverdata-2749e3987af5685988a0119f15f6f476319b5561.zip
Extension to Kylian Quest Line
Daily Delivery
Diffstat (limited to 'world/map/npc/021-2/kps.txt')
-rw-r--r--world/map/npc/021-2/kps.txt164
1 files changed, 164 insertions, 0 deletions
diff --git a/world/map/npc/021-2/kps.txt b/world/map/npc/021-2/kps.txt
new file mode 100644
index 00000000..ccfd1d8d
--- /dev/null
+++ b/world/map/npc/021-2/kps.txt
@@ -0,0 +1,164 @@
+// KPS (Killian Parcel Service)
+// Author: Wushin
+// Kylian_Timer denotes current quest time & holds last completed.
+// reuse the 4 bits
+// To Mark 4 Different NPCs.
+// setarray $@kps_npc_bits, $@knowYanisNT, $@knowLatoyNT, $@knowWeellosNT, $@knowCasinoNT;
+021-2.gat,27,124,0|script|KPS Manager|191,
+{
+ set @state, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT);
+ set @run, ((QUEST_NorthTulimshar & TWOBIT_8_MASK) >> TWOBIT_8_SHIFT);
+ set @run_cnt, ((QUEST_NorthTulimshar & TWOBIT_9_MASK) >> TWOBIT_9_SHIFT);
+ if (@state == 15)
+ goto L_SeeKylian;
+ if (@state == 14)
+ goto L_RunComplete;
+ if (@state == 13)
+ goto L_RunStarted;
+ if (@state == 12)
+ goto L_JobSelect;
+ if (@state == 11)
+ goto L_AcceptJob;
+ if (@state == 10)
+ goto L_OfferJob;
+ goto L_Default;
+
+L_Default:
+ mes "[KPS Manager]";
+ mes "\"Kylian staying at the Inn bought this shop recently.\"";
+ mes "\"I'm waiting for him to open the shop.\"";
+ next;
+ mes "\"I wonder if he needs any help?\"";
+ goto L_Close;
+
+L_OfferJob:
+ mes "[KPS Manager]";
+ mes "\"Hello and what how can I help you today?\"";
+ menu
+ "My name is " + strcharinfo(0), L_MyName,
+ "Nothing.", L_Close;
+
+L_MyName:
+ set @state, 11;
+ callfunc "SetKylianQuest";
+ mes "\"Ahhh, Kylian said you would be dropping by.\"";
+ next;
+ mes "\"I assume you are looking for some work?\"";
+ menu
+ "Yes.", L_StartJob,
+ "No.", L_Close;
+
+L_AcceptJob:
+ mes "[KPS Manager]";
+ mes "\"Interested in some work?\"";
+ menu
+ "Yes.", L_StartJob,
+ "No.", L_Close;
+
+L_StartJob:
+ set @run, 0;
+ callfunc "SetKylianRun";
+ set @run_cnt, 0;
+ callfunc "SetKylianRunCnt";
+ set @state, 12;
+ callfunc "SetKylianQuest";
+ goto L_JobSelect;
+
+L_StartJobAgain:
+ set @run, 0;
+ callfunc "SetKylianRun";
+ set @state, 12;
+ callfunc "SetKylianQuest";
+ goto L_JobSelect;
+
+L_JobSelect:
+ if ((gettimetick(2) - Kylian_Timer) < 86400)
+ goto L_NoPackages;
+ mes "[KPS Manager]";
+ mes "\"We have a number of deliveries that need to go all over the world.\"";
+ next;
+ goto L_RandJob;
+
+L_RandJob:
+ set @rand_quest, rand(1,3);
+ goto L_JobInfo;
+
+L_JobInfo:
+ mes "\"We have a delivery for : " + $@random_quests$[@rand_quest] + "\"";
+ menu
+ "Take It.", L_StartRun,
+ "Anything Else?", L_RandJob,
+ "I need a break.", L_Close;
+
+L_StartRun:
+ set @state, 13;
+ callfunc "SetKylianQuest";
+ set @run, @rand_quest;
+ callfunc "SetKylianRun";
+ set Kylian_Timer, gettimetick(2);
+ goto L_Close;
+
+L_RunStarted:
+ mes "Deliver this package to : " + $@random_quests$[@run] + "\"";
+ goto L_Close;
+
+L_RunComplete:
+ set @elapsed_time, (gettimetick(2) - Kylian_Timer);
+ if (@elapsed_time > 600)
+ goto L_Failed;
+ set @run_cnt, (@run_cnt + 1);
+ callfunc "SetKylianRunCnt";
+ // Set Kylian wants to see you reward state
+ if (@run_cnt > 3)
+ goto L_KylianReward;
+ goto L_RunAgain;
+
+L_SeeKylian:
+ mes "\"You need to go see Kylian before I can give you any more work.\"";
+ goto L_Close;
+
+L_Failed:
+ mes "\"You need to be faster next time to earn a bonus.\"";
+ next;
+ goto L_RunAgain;
+
+L_KylianReward:
+ set Zeny, Zeny + $@delivery_money;
+ getexp ($@delivery_exp_mod * BaseLevel), 0;
+ callfunc "SetKylianRun";
+ set @state, 15;
+ callfunc "SetKylianQuest";
+ mes "[" + $@delivery_money + " money]";
+ mes "[" + ($@delivery_exp_mod * BaseLevel) + " experience points]";
+ next;
+ mes "\"I have a message Kylian wants me to send you over right away.\"";
+ goto L_Close;
+
+L_RunAgain:
+ set Zeny, Zeny + $@delivery_money;
+ getexp ($@delivery_exp_mod * BaseLevel), 0;
+ callfunc "SetKylianRun";
+ mes "[" + $@delivery_money + " money]";
+ mes "[" + ($@delivery_exp_mod * BaseLevel) + " experience points]";
+ next;
+ mes "\"Good job, keep up the nice work and I'm sure the bonus will give you a bonus.\"";
+ next;
+ goto L_StartJobAgain;
+
+L_NoPackages:
+ mes "\"Come back tomorrow, maybe we will have some more work.\"";
+ goto L_Close;
+
+L_Close:
+ close;
+}
+function|script|SetKylianRun|,
+{
+ set QUEST_NorthTulimshar, (QUEST_NorthTulimshar & ~(TWOBIT_8_MASK)) | (@run << TWOBIT_8_SHIFT);
+ return;
+}
+function|script|SetKylianRunCnt|,
+{
+ set QUEST_NorthTulimshar, (QUEST_NorthTulimshar & ~(TWOBIT_9_MASK)) | (@run_cnt << TWOBIT_9_SHIFT);
+ return;
+}