summaryrefslogtreecommitdiff
path: root/world/map/npc
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
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')
-rw-r--r--world/map/npc/006-2/npcs.txt18
-rw-r--r--world/map/npc/013-2/wizard.txt18
-rw-r--r--world/map/npc/020-2/baktar.txt18
-rw-r--r--world/map/npc/021-2/_import.txt1
-rw-r--r--world/map/npc/021-2/kps.txt164
-rw-r--r--world/map/npc/021-2/kylian.txt147
6 files changed, 351 insertions, 15 deletions
diff --git a/world/map/npc/006-2/npcs.txt b/world/map/npc/006-2/npcs.txt
index 90d5b176..547a0075 100644
--- a/world/map/npc/006-2/npcs.txt
+++ b/world/map/npc/006-2/npcs.txt
@@ -2,6 +2,24 @@
006-2.gat,49,25,0|script|Falkurn|178,
{
+ set @run, ((QUEST_NorthTulimshar & TWOBIT_8_MASK) >> TWOBIT_8_SHIFT);
+ set @state, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT);
+ if ((@run == 1) && (@state == 13))
+ goto L_Deliver;
+ goto L_Start;
+
+L_Deliver:
+ menu
+ "I have a delivery for you", L_Delivery;
+
+L_Delivery:
+ mes "[Falkurn]";
+ mes "\"Good now we can get to work on making some more leather goods.\"";
+ set @state, 14;
+ callfunc "SetKylianQuest";
+ goto L_Close;
+
+L_Start:
mes "[Falkurn]";
mes "\"Greetings traveler, what wind brings you to our door?\"";
menu
diff --git a/world/map/npc/013-2/wizard.txt b/world/map/npc/013-2/wizard.txt
index 73ca06ef..b6a60661 100644
--- a/world/map/npc/013-2/wizard.txt
+++ b/world/map/npc/013-2/wizard.txt
@@ -3,6 +3,24 @@
set @has_magic, getskilllv(SKILL_MAGIC);
set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_OLD_WIZARD;
+ set @run, ((QUEST_NorthTulimshar & TWOBIT_8_MASK) >> TWOBIT_8_SHIFT);
+ set @state, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT);
+ if ((@run == 2) && (@state == 13))
+ goto L_Deliver;
+ goto L_Start;
+
+L_Deliver:
+ menu
+ "I have a delivery for you", L_Delivery;
+
+L_Delivery:
+ mes "[Old Wizard]";
+ mes "\"Good now I can get to work on some stronger brew..\"";
+ set @state, 14;
+ callfunc "SetKylianQuest";
+ goto L_Close;
+
+L_Start:
mes "[Old Wizard]";
mes "\"Welcome, dear wanderer! Come into my humble home. Take a rest, eat and drink.\"";
next;
diff --git a/world/map/npc/020-2/baktar.txt b/world/map/npc/020-2/baktar.txt
index 63ce7ad0..33bae946 100644
--- a/world/map/npc/020-2/baktar.txt
+++ b/world/map/npc/020-2/baktar.txt
@@ -77,6 +77,24 @@
set @MONEY_BUGLEG, 20;
set @XP_BUGLEG, 130;
+ set @run, ((QUEST_NorthTulimshar & TWOBIT_8_MASK) >> TWOBIT_8_SHIFT);
+ set @state, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT);
+ if ((@run == 3) && (@state == 13))
+ goto L_Deliver;
+ goto L_Start;
+
+L_Deliver:
+ menu
+ "I have a delivery for you", L_Delivery;
+
+L_Delivery:
+ mes "[Baktar]";
+ mes "\"Ahh my delivery from Tulimshar, how nice it is to get some comforts from back home.\"";
+ set @state, 14;
+ callfunc "SetKylianQuest";
+ goto L_Close;
+
+L_Start:
if(sex)
set @type$, "man";
if(!sex)
diff --git a/world/map/npc/021-2/_import.txt b/world/map/npc/021-2/_import.txt
index 96da140d..67974f1a 100644
--- a/world/map/npc/021-2/_import.txt
+++ b/world/map/npc/021-2/_import.txt
@@ -9,6 +9,7 @@ npc: npc/021-2/forge_shops.txt
npc: npc/021-2/government_building.txt
npc: npc/021-2/heathin.txt
npc: npc/021-2/jhedia.txt
+npc: npc/021-2/kps.txt
npc: npc/021-2/kylian.txt
npc: npc/021-2/manakins.txt
npc: npc/021-2/mapflags.txt
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;
+}
diff --git a/world/map/npc/021-2/kylian.txt b/world/map/npc/021-2/kylian.txt
index fc8242c5..5109314d 100644
--- a/world/map/npc/021-2/kylian.txt
+++ b/world/map/npc/021-2/kylian.txt
@@ -24,7 +24,14 @@
// after the player answered this, @KylianNTSightSeeing is set.
// the player can only continue the quest when logging out and therefore setting that value to 0 again
// state 8: Kylian was in the casino and gives a desert hat as reward
-// state 9: To be continued here
+// state 9: Shop approved, go talk Kylian's shopkeeper if you are looking for work.
+// state 10: Meet Shop keeper
+// state 11: Start Time Trial
+// state 12: Return
+// state 13: Start Daily Timed
+// state 14: Return
+// state 15: Completed
+// Kylian_Timer is used to denote start time.
// temporary variables used to check if the player logged out or left the building in the meanwhile
// this is to ensure some 'time in between' different actions of the quest
@@ -38,10 +45,16 @@
OnInit:
// Nibble 4
+ // Used in Random Quest later as a Nibble
set $@knowYanisNT, (1 << 16);
set $@knowLatoyNT, (1 << 17);
set $@knowWeellosNT, (1 << 18);
set $@knowCasinoNT, (1 << 19);
+
+ // Random Quests for Later
+ setarray $@random_quests$, "None", "Falkurn", "Old Wizard", "Baktar";
+ set $@delivery_money, 100;
+ set $@delivery_exp_mod, 10;
end;
}
021-2.gat,25,67,0|script|#KylianOut|32767,1,1,
@@ -73,7 +86,10 @@ OnInit:
callfunc "ClearVarTMW_Quest";
set @bernard, ((QUEST_SouthTulimshar & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
- if (@state == 9) goto L_Done;
+ if (@state == 15) goto L_Done;
+ if (@state >= 11) goto L_Helping;
+ if (@state == 10) goto L_OfferedJob;
+ if (@state == 9) goto L_Shop;
if (@KylianNTCasino) goto L_CasinoDone;
if (@state == 8) goto L_DesertHat;
if (@state == 7) goto L_Clothes;
@@ -104,7 +120,7 @@ L_Luggage:
mes "\"I need someone to get my luggage from the docks. Show this paper to the sailor who's watching the luggage.\"";
mes "He gives you his ticket which you store in your pocket, separated from your inventory.";
set @state, 1;
- callsub S_Update_Mask;
+ callfunc "SetKylianQuest";
goto L_Close;
L_Suitcase: // @state >= 1, but below 3
@@ -123,7 +139,7 @@ L_Continue:
set Zeny, Zeny + @suitcase_money;
getexp @suitcase_exp, 0;
set @state, 3;
- callsub S_Update_Mask;
+ callfunc "SetKylianQuest";
mes "[Kylian]";
mes "\"Ah, very good. I really need to have a look at some of my papers in there.\"";
mes "He gives you some money.";
@@ -148,7 +164,7 @@ L_GovBuild:
set Zeny, Zeny + @license_money;
getexp @license_exp, 0;
set @state, 4;
- callsub S_Update_Mask;
+ callfunc "SetKylianQuest";
set @KylianNTLicense, 1;
mes "[Kylian]";
mes "\"Ah, excellent. That's very helpful. Could you tell me how to get to that building?\"";
@@ -174,7 +190,7 @@ L_HistBuild:
set Zeny, Zeny + @sightseeing_money;
getexp @sightseeing_exp, 0;
set @state, 5;
- callsub S_Update_Mask;
+ callfunc "SetKylianQuest";
mes "[Kylian]";
mes "\"This sounds interesting. Please tell me the way.\"";
mes "You tell him how to get to the historic building.";
@@ -194,7 +210,7 @@ L_SoupBer:
set Zeny, Zeny + @food_money;
getexp @food_exp, 0;
set @state, 6;
- callsub S_Update_Mask;
+ callfunc "SetKylianQuest";
set @KylianNTSightSeeing, 1;
goto L_SightSeeingDone;
@@ -218,7 +234,7 @@ L_CasinoFound:
set Zeny, Zeny + @casino_money;
getexp @casino_exp, 0;
set @state, 7;
- callsub S_Update_Mask;
+ callfunc "SetKylianQuest";
mes "[Kylian]";
mes "\"Oh, there's a casino in this city? That's a wonderful thing. Where can I find it?\"";
mes "You explain how to get to the casino.";
@@ -238,7 +254,7 @@ L_HarborDistrict:
set Zeny, Zeny + @clothes_money;
getexp @clothes_exp, 0;
set @state, 8;
- callsub S_Update_Mask;
+ callfunc "SetKylianQuest";
set @KylianNTCasino, 1;
mes "You explain about Latoy and his high quality shop.";
mes "[Kylian]";
@@ -261,14 +277,50 @@ L_DesertHat: // @state == 8
goto L_Inventory;
getitem "DesertHat", 1;
set @state, 9;
- callsub S_Update_Mask;
+ callfunc "SetKylianQuest";
+ next;
+ goto L_Close;
+
+L_Shop:
+ mes "[Kylian]";
+ mes "\"The Council of Wizards approved my shop license!\"";
+ mes "\"I purchased a store just acorss the way from the hotel exit.\"";
+ next;
+ mes "\"If you are looking for work, go see the shop keeper I have working for me.\"";
+ mes "\"Mention your name and he will know I sent you.\"";
+ set @state, 10;
+ callfunc "SetKylianQuest";
+ goto L_Close;
+
+L_OfferedJob:
+ mes "[Kylian]";
+ mes "\"I spoke with the shopkeeper, They said you haven't stopped in yet.\"";
+ next;
+ mes "\"I wish you would consider working for KPS.\"";
next;
- goto L_Done;
+ mes "\"KPS needs a well-traveled go getter like you.\"";
+ goto L_Close;
+
+L_Helping:
+ mes "[Kylian]";
+ mes "\"I've heard you decided to come work for me. That is great news.\"";
+ mes "\"Keep up the good work and I might have something a little extra for you.\"";
+ goto L_Close;
L_Done:
mes "[Kylian]";
- mes "\"I hope to get a positive response about my shop license soon. I might have more things to do for you then, if you're interested.";
- mes "Just stop by later.\"";
+ mes "\"Thanks a bunch, buisness is booming!\"";
+ mes "\"For your hard work take this.\"";
+ next;
+ set Zeny, Zeny + $@delivery_money;
+ getexp ($@delivery_exp_mod * BaseLevel), 0;
+ set @run_cnt, 0;
+ callfunc "SetKylianRunCnt";
+ set @state, 12;
+ callfunc "SetKylianQuest";
+ mes "[" + $@delivery_money + " money]";
+ mes "[" + ($@delivery_exp_mod * BaseLevel) + " experience points]";
+ next;
goto L_Close;
L_Inventory:
@@ -300,8 +352,73 @@ L_Close:
// NOT set to zero: @KylianNTLicense, @KylianNTSightSeeing and @KylianNTCasino
// those are used to check if the player logged out in the meanwhile
close;
-
-S_Update_Mask:
+}
+function|script|SetKylianQuest|,
+{
set QUEST_NorthTulimshar, (QUEST_NorthTulimshar & ~(NIBBLE_5_MASK)) | (@state << NIBBLE_5_SHIFT);
return;
}
+function|script|KylianDebug|,
+{
+ set @state, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT);
+ callfunc "ClearVarTMW_Quest";
+ set @bernard, ((QUEST_SouthTulimshar & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
+ set @run, ((QUEST_NorthTulimshar & TWOBIT_8_MASK) >> TWOBIT_8_SHIFT);
+ set @run_cnt, ((QUEST_NorthTulimshar & TWOBIT_9_MASK) >> TWOBIT_9_SHIFT);
+ goto L_Menu;
+
+L_Menu:
+ mes "[Kylian Debug]";
+ menu
+ "Show Quest State", L_ShowState,
+ "Set Quest State", L_SetState,
+ "Reset Timer to now", L_WorkTimer,
+ "Reset Timer + 24 hours", L_MoreWorkTimer,
+ "Close.", L_Close;
+
+L_ShowState:
+ mes "State: " + @state;
+ mes "Timer: " + Kylian_Timer;
+ mes "Time: " + gettimetick(2);
+ mes "Elapsed Time: " + (gettimetick(2) - Kylian_Timer);
+ mes "Reset Timer: 86400 > " + (gettimetick(2) - Kylian_Timer);
+ mes "Run: " + @run;
+ mes "Run NPC: " + $@random_quests$[@run];
+ mes "Run Count: " + @run_cnt;
+ goto L_Menu;
+
+L_SetState:
+ mes "\"Input the quest state desired.\"";
+ input @state;
+ callfunc "SetKylianQuest";
+ goto L_Menu;
+
+L_WorkTimer:
+ set Kylian_Timer, gettimetick(2);
+ goto L_Menu;
+
+L_MoreWorkTimer:
+ set Kylian_Timer, (gettimetick(2) - 86401);
+ goto L_Menu;
+
+L_Close:
+ close;
+}
+021-2.gat,87,55,0|script|KylianDebug#1|193,
+{
+ callfunc "KylianDebug";
+ end;
+OnInit:
+ if (!debug)
+ disablenpc "KylianDebug#1";
+ end;
+}
+021-2.gat,29,124,0|script|KylianDebug#2|193,
+{
+ callfunc "KylianDebug";
+ end;
+OnInit:
+ if (!debug)
+ disablenpc "KylianDebug#2";
+ end;
+}