summaryrefslogtreecommitdiff
path: root/world/map/npc
diff options
context:
space:
mode:
Diffstat (limited to 'world/map/npc')
-rw-r--r--world/map/npc/004-5/_import.txt1
-rw-r--r--world/map/npc/004-5/chest.txt31
-rw-r--r--world/map/npc/006-2/npcs.txt18
-rw-r--r--world/map/npc/010-2/_import.txt1
-rw-r--r--world/map/npc/010-2/band.txt42
-rw-r--r--world/map/npc/010-2/dimonds.txt30
-rw-r--r--world/map/npc/010-2/loratay.txt200
-rw-r--r--world/map/npc/011-4/bl_barrier.txt6
-rw-r--r--world/map/npc/011-6/_import.txt2
-rw-r--r--world/map/npc/011-6/_warps.txt1
-rw-r--r--world/map/npc/011-6/barrier.txt16
-rw-r--r--world/map/npc/011-6/crastur.txt221
-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/020-2/furquest.txt134
-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
-rw-r--r--world/map/npc/042-2/barrels.txt2
-rw-r--r--world/map/npc/055-3/_mobs.txt10
-rw-r--r--world/map/npc/068-2/hetchel.txt335
-rw-r--r--world/map/npc/annuals/halloween/config.txt8
-rw-r--r--world/map/npc/annuals/halloween/trick_or_treat.txt17
-rw-r--r--world/map/npc/functions/barber.txt20
-rw-r--r--world/map/npc/functions/clear_vars.txt4
-rw-r--r--world/map/npc/functions/headstyles.txt55
-rw-r--r--world/map/npc/items/mirror.txt4
27 files changed, 1237 insertions, 269 deletions
diff --git a/world/map/npc/004-5/_import.txt b/world/map/npc/004-5/_import.txt
index 4d0d3afb..a96bcd25 100644
--- a/world/map/npc/004-5/_import.txt
+++ b/world/map/npc/004-5/_import.txt
@@ -3,4 +3,5 @@
map: 004-5.gat
npc: npc/004-5/_mobs.txt
npc: npc/004-5/_warps.txt
+npc: npc/004-5/chest.txt
npc: npc/004-5/mapflags.txt
diff --git a/world/map/npc/004-5/chest.txt b/world/map/npc/004-5/chest.txt
new file mode 100644
index 00000000..1d0e9d32
--- /dev/null
+++ b/world/map/npc/004-5/chest.txt
@@ -0,0 +1,31 @@
+004-5.gat,89,67,0|script|Old Chest#crastur|111,
+{
+ setarray @npc_loc, 89, 67, 1;
+ callfunc "PCtoNPCRange";
+ if(@npc_check == 1) goto L_Closer;
+ set @spants_state, ((QUEST_WG_state & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT);
+ if(@spants_state > 5) goto L_Looted;
+ if(@spants_state != 5) goto L_Unknown;
+ set @spants_state, 6;
+ getitem "Bandana", 1;
+ set Zeny, (Zeny + rand(8000,20000)); // give some random loot
+ mes "This must be the treasure that Crastur was talking about.";
+ mes "You see a pile of gold and a Bandana on top.";
+ set QUEST_WG_state, (QUEST_WG_state & ~(NIBBLE_2_MASK) | (@spants_state << NIBBLE_2_SHIFT));
+ goto L_Close;
+
+L_Looted:
+ mes "You have already looted this chest.";
+ goto L_Close;
+
+L_Unknown:
+ mes "You have no idea how to open this chest.";
+ goto L_Close;
+
+L_Closer:
+ mes "You need to move closer to open the chest.";
+ goto L_Close;
+
+L_Close:
+ close;
+}
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/010-2/_import.txt b/world/map/npc/010-2/_import.txt
index 1aeba756..c5080ede 100644
--- a/world/map/npc/010-2/_import.txt
+++ b/world/map/npc/010-2/_import.txt
@@ -3,6 +3,7 @@
map: 010-2.gat
npc: npc/010-2/_mobs.txt
npc: npc/010-2/_warps.txt
+npc: npc/010-2/band.txt
npc: npc/010-2/chef.txt
npc: npc/010-2/dimonds.txt
npc: npc/010-2/doug.txt
diff --git a/world/map/npc/010-2/band.txt b/world/map/npc/010-2/band.txt
new file mode 100644
index 00000000..d0783d8d
--- /dev/null
+++ b/world/map/npc/010-2/band.txt
@@ -0,0 +1,42 @@
+// dimonds band
+010-2.gat,40,35,0|script|Phil|157,
+{
+ callfunc "DimondBand";
+ end;
+}
+
+010-2.gat,40,37,0|script|Jerry|160,
+{
+ callfunc "DimondBand";
+ end;
+}
+
+010-2.gat,42,36,0|script|Robert|162,
+{
+ callfunc "DimondBand";
+ end;
+}
+function|script|DimondBand|,
+{
+ npctalk $@SongLyrics$[$@LyricSpot];
+ set $@LyricSpot, ($@LyricSpot + 1);
+ if (getarraysize($@SongLyrics$) <= $@LyricSpot)
+ set $@LyricSpot, 0;
+ goto L_Return;
+
+L_Return:
+ return;
+}
+-|script|#BandConfig|-1,
+{
+ end;
+
+OnInit:
+ set $@LyricSpot, 0;
+ setarray $@SongLyrics$, "Laid back in Hurnscald, with a GP in my hand,",
+ "Watchin' GMs and players on the street,",
+ "And I catch a glimpse of cheap rares on ManaMarket once a while,",
+ "There's a woman who wants me to save their child.",
+ "I got the Argean blues!";
+ end;
+}
diff --git a/world/map/npc/010-2/dimonds.txt b/world/map/npc/010-2/dimonds.txt
index 09c585e2..6f158c65 100644
--- a/world/map/npc/010-2/dimonds.txt
+++ b/world/map/npc/010-2/dimonds.txt
@@ -12,36 +12,6 @@
close;
}
-010-2.gat,40,35,0|script|Phil|157,
-{
- mes "[Phil]";
- mes "\"We're having problems with our equipment!\"";
- next;
- mes "[Phil]";
- mes "\"I don't know if we can play any songs!\"";
- close;
-}
-
-010-2.gat,40,37,0|script|Jerry|160,
-{
- mes "[Jerry]";
- mes "\"I don't know what's wrong.\"";
- next;
- mes "[Jerry]";
- mes "\"We should be able to play you music in the future!\"";
- close;
-}
-
-010-2.gat,42,36,0|script|Robert|162,
-{
- mes "[Robert]";
- mes "\"I hope we can figure something out!\"";
- next;
- mes "[Robert]";
- mes "\"We are kinda useless if we can't play music.\"";
- close;
-}
-
010-2.gat,35,35,0|script|Shannon|193,
{
set @month, 1;
diff --git a/world/map/npc/010-2/loratay.txt b/world/map/npc/010-2/loratay.txt
index f49da102..9d98cdaa 100644
--- a/world/map/npc/010-2/loratay.txt
+++ b/world/map/npc/010-2/loratay.txt
@@ -9,25 +9,26 @@
set @SORCERER_ROBE_SEW_ZENY, 25000;
set @SORCERER_ROBE_NUM_COTTON_CLOTH, 2;
setarray @item_colors$, "red", "green", "dark blue", "yellow", "light blue", "pink", "black", "orange", "purple", "dark green", "white";
+ set @wg_state, ((QUEST_WG_state & BYTE_0_MASK) >> BYTE_0_SHIFT);
if (@loratay_asking_robe == 1) goto L_ExamineSorcererRobe;
- if (QUEST_WG_state == 10) goto L_agostine_menu;
- if (QUEST_WG_state == 11 || QUEST_WG_state == 12) goto L_regular_intro;
- if (QUEST_WG_state == 13) goto L_proposal_intro;
- if (QUEST_WG_state == 14) goto L_proposal_show_materials;
- if (QUEST_WG_state == 15) goto L_proposal_search_items;
- if (QUEST_WG_state == 16) goto L_proposal_retrieve_design;
- if (QUEST_WG_state == 17) goto L_proposal_bringing_design;
- if (QUEST_WG_state == 18) goto L_proposal_wait_dress_finished;
- if (QUEST_WG_state == 19) goto L_proposal_dress_finished;
- if (QUEST_WG_state >= 20 && QUEST_WG_state < 23) goto L_proposal_deliver_dress;
- if (QUEST_WG_state >= 23) goto L_regular_intro;
+ if (@wg_state == 10) goto L_agostine_menu;
+ if (@wg_state == 11 || @wg_state == 12) goto L_regular_intro;
+ if (@wg_state == 13) goto L_proposal_intro;
+ if (@wg_state == 14) goto L_proposal_show_materials;
+ if (@wg_state == 15) goto L_proposal_search_items;
+ if (@wg_state == 16) goto L_proposal_retrieve_design;
+ if (@wg_state == 17) goto L_proposal_bringing_design;
+ if (@wg_state == 18) goto L_proposal_wait_dress_finished;
+ if (@wg_state == 19) goto L_proposal_dress_finished;
+ if (@wg_state >= 20 && @wg_state < 23) goto L_proposal_deliver_dress;
+ if (@wg_state >= 23) goto L_regular_intro;
set @t, rand(3);
if (@t == 0) goto L_intro_0;
if (@t == 1) goto L_intro_1;
- mes "You see a middle-aged woman furiously sewing away at what appears to be a very expensive dress. Her fingers are moving so nimbly that you find it near-impossible to follow the needle.";
+ mes "You see a middle-aged woman furiously sewing away at what appears to be a very expensive dress. Her fingers are moving so nimbly that you find it near-impossible to follow the needle.";
goto L_intro_over;
L_intro_0:
@@ -35,7 +36,7 @@ L_intro_0:
goto L_intro_over;
L_intro_1:
- mes "You see a middle-aged woman cautiously but surprisingly swiftly cutting out shapes from a huge cotton sheet. The scissors glide along the cloth as if it were butter, never leaving the premarked lines.";
+ mes "You see a middle-aged woman cautiously but surprisingly swiftly cutting out shapes from a huge cotton sheet. The scissors glide along the cloth as if it were butter, never leaving the premarked lines.";
goto L_intro_over;
L_intro_over:
@@ -49,9 +50,9 @@ L_intro_over:
set @agostine_msg0$, "";
set @agostine_msg1$, "";
- if (QUEST_WG_state >= 1)
+ if (@wg_state >= 1)
set @agostine_msg0$, "Do you know Agostine?";
- if ((QUEST_WG_state >= 9) && (countitem("FurBoots")))
+ if ((@wg_state >= 9) && (countitem("FurBoots")))
set @agostine_msg1$, "Can you make fur boots, like Agostine?";
menu
@@ -63,40 +64,40 @@ L_intro_over:
L_hello_0:
mes "She raises an eyebrow.";
- mes "\"That,\", she notes dryly, \"is hardly my fault. And now I would greatly appreciate it if you were to get out of here and leave me to my work!\"";
- close;
+ mes "\"That,\", she notes dryly, \"is hardly my fault. And now I would greatly appreciate it if you were to get out of here and leave me to my work!\"";
+ goto L_Close;
L_hello_1:
mes "She frowns.";
mes "\"No, I am an accupuncturist, I just happen to practice on cloth! Get out of here with your silly questions!\"";
- close;
+ goto L_Close;
L_hello_2:
mes "She glares at you indignantly.";
mes "\"Do you even know whom you are talking to? I am Lora Tay, greatest of the seven seamstresses of the South!\"";
next;
mes "[Lora Tay the Seamstress]";
- mes "\"I do not work for petty peasants or arrogant adventurers. Get out of my sight!\"";
+ mes "\"I do not work for petty peasants or arrogant adventurers. Get out of my sight!\"";
mes "She waves you away and returns to her work.";
- close;
+ goto L_Close;
L_agostine_0:
- if (QUEST_WG_state < 1)
- close;
+ if (@wg_state < 1)
+ goto L_Close;
mes "She shoots an incensed glare at you.";
mes "\"Ah, Agostine! The 'legendary tailor'! Now who has not heard of him, been inspired by him! Such charisma! Such popularity! Such unprecedented lack of talent!\"";
mes "You notice that she prononuces the 't's as if she were trying to slap someone.";
next;
- mes "\"Please spare me your tales of this fool. He couldn't mend a sock without getting himself trapped inside!\"";
+ mes "\"Please spare me your tales of this fool. He couldn't mend a sock without getting himself trapped inside!\"";
mes "She frowns and turns back to her work, clearly not interested in discussing the matter further.";
- close;
+ goto L_Close;
L_agostine_1:
- if ((QUEST_WG_state < 9) || (countitem (655) == 0))
- close;
+ if ((@wg_state < 9) || (countitem (655) == 0))
+ goto L_Close;
mes "[Lora Tay the Seamstress]";
- mes "She glares at your boots, her lips forming barely more than a thin line. Deep furrows form above her brows.";
- mes "\"I can't believe it! He copied Illana's design but used fluffy fur in place of ice wolvern fur – Fluffy fur! Of all things! Who would wear such an atrocity of fashion! Everyone knows that you need ice-white, not pale-white, to go with such leather!\"";
+ mes "She glares at your boots, her lips forming barely more than a thin line. Deep furrows form above her brows.";
+ mes "\"I can't believe it! He copied Illana's design but used fluffy fur in place of ice wolvern fur-- Fluffy fur! Of all things! Who would wear such an atrocity of fashion! Everyone knows that you need ice-white, not pale-white, to go with such leather!\"";
next;
mes "[Lora Tay the Seamstress]";
mes "She looks at them more closely.";
@@ -105,9 +106,13 @@ L_agostine_1:
mes "[Lora Tay the Seamstress]";
mes "Angry red spots begin to form on her cheeks.";
mes "\"Get those... things out of my sight before I forget myself!\"";
- if (QUEST_WG_state == 9)
- set QUEST_WG_state, 10;
- close;
+ if (@wg_state == 9) goto L_Next13;
+ goto L_Close;
+
+L_Next13:
+ set @wg_state, 10;
+ callsub S_Update;
+ goto L_Close;
L_agostine_menu:
mes "[Lora Tay the Seamstress]";
@@ -126,8 +131,8 @@ L_agostine_menu:
"No, none, really.", L_agostine_5;
L_agostine_2:
- if ((QUEST_WG_state < 9) || (countitem("WinterGloves") == 0))
- close;
+ if ((@wg_state < 9) || (countitem("WinterGloves") == 0))
+ goto L_Close;
mes "[Lora Tay the Seamstress]";
mes "Lora inspects your gloves, shock apparent on her face.";
mes "\"Winter gloves? And he managed the join stitches without adding a single crease... no, that can't be the Agostine we were talking about...\"";
@@ -172,36 +177,36 @@ L_NextMenu:
L_Next:
mes "[Lora Tay the Seamstress]";
- mes "She holds out your gloves for you to pick up, then waves you out of the room. Fortunately, her cough seems to be slowly subsiding.";
- close;
+ mes "She holds out your gloves for you to pick up, then waves you out of the room. Fortunately, her cough seems to be slowly subsiding.";
+ goto L_Close;
L_agostine_3:
mes "[Lora Tay the Seamstress]";
mes "She frowns at you.";
mes "\"What other self-absorbed tailor-pretends with the sewing skill of a mouboo are there around? Stop wasting my time.\"";
- close;
+ goto L_Close;
L_agostine_4:
mes "[Lora Tay the Seamstress]";
mes "\"Is it not obvious? We are talking about someone so self-absorbed that he chose to ignore the advice of myself, greatest of the seven southern seamstresses! I cannot stand such arrogance.\"";
- close;
+ goto L_Close;
L_agostine_5:
mes "[Lora Tay the Seamstress]";
- mes "\"Good for you. That arrogant good-for-nothing couldn't tell a piece of cotton from chain mail if he wiped his nose with it!\"";
- close;
+ mes "\"Good for you. That arrogant good-for-nothing couldn't tell a piece of cotton from chain mail if he wiped his nose with it!\"";
+ goto L_Close;
L_no_water:
mes "Checking more closely, you realize that you are out of water.";
mes "You apologise to Lora, though it fortunately seems that her cough is subsiding.";
mes "She waves you out of the room.";
- close;
+ goto L_Close;
L_regular_intro:
mes "[Lora Tay the Seamstress]";
- mes "\"Ah, you again. Is there anything in particular you need?\"";
+ mes "\"Ah, you again. Is there anything in particular you need?\"";
next;
- if (QUEST_WG_state == 12)
+ if (@wg_state == 12)
goto L_main_menu2;
goto L_main_menu;
@@ -209,25 +214,26 @@ L_give_water:
if (countitem("BottleOfWater") == 0)
goto L_no_water;
delitem "BottleOfWater", 1;
- set QUEST_WG_state, 11;
+ set @wg_state, 11;
+ callsub S_Update;
set @xpval, 50000;
getexp @xpval, 0;
mes "[Lora Tay the Seamstress]";
- mes "Lora grabs your water bottle and take a deep sip. Slowly, her head regains a more natural color. As she puts the bottle down, her cough seems to have subsided.";
+ mes "Lora grabs your water bottle and take a deep sip. Slowly, her head regains a more natural color. As she puts the bottle down, her cough seems to have subsided.";
mes "\"Thank you, dear; that was just the right thing at the right time.\"";
mes "[You gain " + @xpval + " experience points]";
next;
mes "[Lora Tay the Seamstress]";
mes "She hands you the winter gloves again.";
- mes "\"Now what happened I don't know, but this wasn't made by the Agostine I remember. But I shan't be made a fool out of by one such as him.\"";
+ mes "\"Now what happened I don't know, but this wasn't made by the Agostine I remember. But I shan't be made a fool out of by one such as him.\"";
next;
mes "[Lora Tay the Seamstress]";
- mes "\"If HE can sew petty every-day items for ordinary peasants, then so can I. Very well, is there anything in particular that you need made? I shall show you how a proper seamstress operates!\"";
+ mes "\"If HE can sew petty every-day items for ordinary peasants, then so can I. Very well, is there anything in particular that you need made? I shall show you how a proper seamstress operates!\"";
next;
- if (QUEST_WG_state == 12)
+ if (@wg_state == 12)
goto L_main_menu2;
goto L_main_menu;
@@ -295,9 +301,9 @@ L_Next2:
mes "\"Well it depends what he wants from me.";
mes "Go see Agostine, ask him what he's planning and I will think about it.\"";
- set QUEST_WG_state, 13;
-
- close;
+ set @wg_state, 13;
+ callsub S_Update;
+ goto L_Close;
L_proposal_intro:
mes "Lora Tay seems lost in her thoughts... ";
@@ -346,19 +352,21 @@ L_proposal_search_items:
@FINEDRESS_COCOONS+" silk cocoons for a dress? Find somebody else.", L_end;
L_Next5:
- set QUEST_WG_state, 15;
- close;
+ set @wg_state, 15;
+ callsub S_Update;
+ goto L_Close;
L_proposal_not_enough_items:
mes "[Lora Tay the Seamstress]";
mes "\"This is not funny. I need " + @FINEDRESS_COCOONS + " silk cocoons. No less.";
- close;
+ goto L_Close;
L_proposal_give_items:
if (countitem ("SilkCocoon") < @FINEDRESS_COCOONS)
goto L_proposal_not_enough_items;
delitem "SilkCocoon", @FINEDRESS_COCOONS;
- set QUEST_WG_state, 16;
+ set @wg_state, 16;
+ callsub S_Update;
mes "[Lora Tay the Seamstress]";
mes "\"Great, now I can spin the silk threading and fix this mess made of these fine materials.";
@@ -387,7 +395,8 @@ L_Next6:
mes "\"Wonderful, this dress design is magnificent!";
mes "I am done with the threading but I will now need to sew these materials together into the design.\"";
next;
- set QUEST_WG_state, 18;
+ set @wg_state, 18;
+ callsub S_Update;
goto L_proposal_wait_dress_finished;
L_proposal_wait_dress_finished:
@@ -399,10 +408,11 @@ L_proposal_wait_dress_finished:
mes "[Lora Tay the Seamstress]";
mes "\"It will take some time to have the dress finished.";
mes "Meanwhile, why don't you go take some air outside?\"";
- close;
+ goto L_Close;
L_proposal_dress_finished:
- set QUEST_WG_state, 19;
+ set @wg_state, 19;
+ callsub S_Update;
mes "[Lora Tay the Seamstress]";
mes "\"Well it was difficult seaming with such fragile materials.";
mes "But I have done it. The design is finished except for one part of it.\"";
@@ -425,8 +435,9 @@ L_Next7:
"Okay, can't wait to see the finished product! Thanks for your help!", L_Next8;
L_Next8:
- set QUEST_WG_state, 20;
- close;
+ set @wg_state, 20;
+ callsub S_Update;
+ goto L_Close;
L_proposal_deliver_dress:
mes "[Lora Tay the Seamstress]";
@@ -438,7 +449,7 @@ L_proposal_deliver_dress:
L_desert_hat:
mes "[Lora Tay the Seamstress]";
mes "The seamstress sighs.";
- mes "\"One of these days it would be nice to have an actual challenge... yes, of course I can make a desert hat. A Cotton Headband, three pieces of cotton cloth. Hmm. And let's add 300 GP to that.\"";
+ mes "\"One of these days it would be nice to have an actual challenge... yes, of course I can make a desert hat. A Cotton Headband, three pieces of cotton cloth. Hmm. And let's add 300 GP to that.\"";
next;
set @default_choice$, "Never mind.";
setarray @items, 724, 2140, 2141, 2142, 2143, 2144, 2145, 2146, 2147, 2148, 2149;
@@ -468,33 +479,33 @@ L_desert_hat:
next;
mes "[Lora Tay the Seamstress]";
mes "The result resembles a huge knot.";
- mes "Lora picks two ends and pulls, hard – to your amazement, the knot unfolds, yielding a Desert Hat.";
+ mes "Lora picks two ends and pulls, hard-- to your amazement, the knot unfolds, yielding a Desert Hat.";
mes "\"Here you are.\"";
next;
goto L_main_menu;
L_desert_hat_nocotton:
mes "[Lora Tay the Seamstress]";
- mes "\"You're asking me to make a desert hat without enough cloth? Here, have your headband back – see, that's how much I can do without cloth! And since I'm generous today, you can even keep your GP...\"";
+ mes "\"You're asking me to make a desert hat without enough cloth? Here, have your headband back-- see, that's how much I can do without cloth! And since I'm generous today, you can even keep your GP...\"";
next;
goto L_main_menu;
L_desert_hat_nogp:
mes "[Lora Tay the Seamstress]";
- mes "\"No, no, no. 300 GP. That's not that much, I've been told. I can't just work for free, now can I?\"";
+ mes "\"No, no, no. 300 GP. That's not that much, I've been told. I can't just work for free, now can I?\"";
next;
goto L_main_menu;
L_desert_hat_noheadband:
mes "[Lora Tay the Seamstress]";
- mes "\"Now that is odd. Where did your headband vanish to? Well, I'm not going to make you something as silly as a headband, so get one from elsewhere.\"";
+ mes "\"Now that is odd. Where did your headband vanish to? Well, I'm not going to make you something as silly as a headband, so get one from elsewhere.\"";
next;
goto L_main_menu;
L_trim:
mes "[Lora Tay the Seamstress]";
mes "\"Trimming... you mean that you can't do that yourself? Well, alright... I suppose I should charge 100 GP and do it.\"";
- mes "\"Alright. What is it that you want trimmed?\"";
+ mes "\"Alright. What is it that you want trimmed?\"";
next;
set @default_choice$, "Never mind.";
@@ -546,14 +557,14 @@ L_trim_impossible:
L_trim_nozeny:
mes "[Lora Tay the Seamstress]";
- mes "\"Not enough GP? Well, just do it yourself – trimming really is trivial.\"";
+ mes "\"Not enough GP? Well, just do it yourself-- trimming really is trivial.\"";
next;
goto L_main_menu;
L_lengthen:
mes "[Lora Tay the Seamstress]";
mes "\"Naturally, I will need a piece of Cotton Cloth to sew onto it; I must also charge you some... hmm... does 500 GP sound reasonable? Yes, I think I shall charge that.\"";
- mes "\"Now, let me see. What is it that you want lengthened?\"";
+ mes "\"Now, let me see. What is it that you want lengthened?\"";
next;
set @default_choice$, "Never mind.";
@@ -597,9 +608,9 @@ L_lengthen:
getitem @genitem, 1;
set Zeny, Zeny - 500;
mes "[Lora Tay the Seamstress]";
- mes "The seamstress cuts your piece of cotton cloth into stripes and sews them on. Using some odd liquid, she flattens the seams and borders.";
+ mes "The seamstress cuts your piece of cotton cloth into stripes and sews them on. Using some odd liquid, she flattens the seams and borders.";
if (@delitem > 2000) // dyed
- mes "She then applies another liquid – smelling strangely of fermented apples – to the result, wraps it up, and wrings it tightly. As she unwraps it, you observe to your amazement that the dye has spread to the newly attached area.";
+ mes "She then applies another liquid-- smelling strangely of fermented apples-- to the result, wraps it up, and wrings it tightly. As she unwraps it, you observe to your amazement that the dye has spread to the newly attached area.";
mes "\"There you are, dear.\"";
next;
goto L_main_menu;
@@ -624,13 +635,13 @@ L_lengthen_impossible:
L_shirt:
mes "[Lora Tay the Seamstress]";
- mes "\"Oh, how silly. You can buy those everywhere. Please don't bore me with such trifles, dear.\"";
+ mes "\"Oh, how silly. You can buy those everywhere. Please don't bore me with such trifles, dear.\"";
next;
goto L_main_menu;
L_tanktop:
mes "[Lora Tay the Seamstress]";
- mes "\"A tank top? Well, hardly a challenge, but I suppose I could do that. Please get me some cloth – plain cotton will do – and, let's see, how does 100,000 GP for my efforts sound?\"";
+ mes "\"A tank top? Well, hardly a challenge, but I suppose I could do that. Please get me some cloth-- plain cotton will do-- and, let's see, how does 100,000 GP for my efforts sound?\"";
mes "\"Wait, I keep forgetting, you are just an adventurer... let's make that 1000 GP, then.\"";
next;
goto L_tanktop_menu;
@@ -657,7 +668,7 @@ L_tanktop_short:
mes "You watch as Lora sews the pieces of cloth together, then flattens the seams and ends with some odd liquid.";
mes "Amazingly, the result looks like a single piece of cloth.";
mes "After little more than a few elegant cuts and folds, your tank top is ready.";
- mes "\"Oh dear, it seems that I am done already. Do you need anything else?\"";
+ mes "\"Oh dear, it seems that I am done already. Do you need anything else?\"";
next;
goto L_tanktop_menu;
@@ -673,28 +684,28 @@ L_tanktop_long:
delitem "CottonCloth", 6;
getitem "TankTop", 1;
mes "[Lora Tay the Seamstress]";
- mes "After combining your pieces of cloth into one – miraculously making the seams and stitches vanish – the seamstress cuts out all that doesn't belong into a tank top, then folds and stabilises the edges with additional seam lines.";
- mes "\"There you are. Don't worry, I have trimmed it to match your size perfectly.\"";
+ mes "After combining your pieces of cloth into one-- miraculously making the seams and stitches vanish-- the seamstress cuts out all that doesn't belong into a tank top, then folds and stabilises the edges with additional seam lines.";
+ mes "\"There you are. Don't worry, I have trimmed it to match your size perfectly.\"";
next;
goto L_tanktop_menu;
L_tanktop_insufficient_cloth:
mes "[Lora Tay the Seamstress]";
- mes "\"No, no, no, count again – how much Cotton Cloth did I say I needed? That's not enough.\"";
+ mes "\"No, no, no, count again-- how much Cotton Cloth did I say I needed? That's not enough.\"";
next;
goto L_tanktop_menu;
L_tanktop_insufficient_Zeny:
mes "[Lora Tay the Seamstress]";
mes "As you note that you don't have enough GP on you, Lora rolls her eyes.";
- mes "\"I don't work for free, you know. I already gave you a discounted peasant price.\"";
+ mes "\"I don't work for free, you know. I already gave you a discounted peasant price.\"";
next;
goto L_main_menu;
L_cape:
mes "[Lora Tay the Seamstress]";
mes "She shakes her head.";
- mes "\"No capes. You're an adventurer, right? Do you want to get caught by a closing portcullis? Or strangled when your cape gets tangled in a tree? Or brought down by a mushroom stomping on your cape while you're trying to run away? No capes.\"";
+ mes "\"No capes. You're an adventurer, right? Do you want to get caught by a closing portcullis? Or strangled when your cape gets tangled in a tree? Or brought down by a mushroom stomping on your cape while you're trying to run away? No capes.\"";
next;
goto L_main_menu;
@@ -726,11 +737,11 @@ L_Next9:
L_Next10:
mes "[Lora Tay the Seamstress]";
mes "Lora frowns.";
- mes "\"It's not all that easy to get properly processed silk around here. Easier for me than for you, I admit...\"";
+ mes "\"It's not all that easy to get properly processed silk around here. Easier for me than for you, I admit...\"";
next;
mes "[Lora Tay the Seamstress]";
mes "She sighs.";
- mes "\"All right, very well then. I have enough spare silk sheets right now, but you pay the silk processing for your cocoons.\"";
+ mes "\"All right, very well then. I have enough spare silk sheets right now, but you pay the silk processing for your cocoons.\"";
next;
mes "[Lora Tay the Seamstress]";
mes "\"Let's see... " + @ROBE_COCOONS_NR + " silk cocoons and " + @ROBE_ZENY + " GP should just about cover that.\"";
@@ -750,7 +761,7 @@ L_Next11:
set Zeny, Zeny - @ROBE_ZENY;
delitem "SilkCocoon", @ROBE_COCOONS_NR;
mes "[Lora Tay the Seamstress]";
- mes "The seamstress puts your cocoons and GP away, takes your measurements and pulls out several silk sheets. She asks you to stretch out your arms, then pins the silk sheets in place all over your body.";
+ mes "The seamstress puts your cocoons and GP away, takes your measurements and pulls out several silk sheets. She asks you to stretch out your arms, then pins the silk sheets in place all over your body.";
next;
goto L_get_robe;
@@ -774,24 +785,24 @@ L_Next12:
set Zeny, Zeny - @ROBE_SHEETS_ZENY;
delitem "SilkSheet", @ROBE_SHEETS_NR;
mes "[Lora Tay the Seamstress]";
- mes "The seamstress puts your GP away, takes your measurements and puts the silk sheets on the table. She asks you to stretch out your arms, then pins the silk sheets in place all over your body.";
+ mes "The seamstress puts your GP away, takes your measurements and puts the silk sheets on the table. She asks you to stretch out your arms, then pins the silk sheets in place all over your body.";
next;
goto L_get_robe;
L_get_robe:
mes "[Lora Tay the Seamstress]";
- mes "She proceeds to make a number of mysterious marks on the sheets with a charcoal pen. Meanwhile, your arms are getting tired, but you're afraid to lower them – she used a lot of pins to put everything into place, and you lost track of where they went...";
+ mes "She proceeds to make a number of mysterious marks on the sheets with a charcoal pen. Meanwhile, your arms are getting tired, but you're afraid to lower them-- she used a lot of pins to put everything into place, and you lost track of where they went...";
next;
mes "[Lora Tay the Seamstress]";
mes "\"Splendid.\"";
mes "After removing the sheets (and pins!), she picks up a pair of scissors and plows through the cloth at her usual amazing pace, only stopping briefly to sew together parts here and there.";
next;
mes "[Lora Tay the Seamstress]";
- mes "She then treats the seams with some odorless liquid, making them vanish completely. Finally she hands you the finished robe.";
+ mes "She then treats the seams with some odorless liquid, making them vanish completely. Finally she hands you the finished robe.";
getitem "SilkRobe", 1;
if (@Robe_with_sheets == 1)
goto L_robe_sheet_end;
- mes "\"Here you are now, this will fit. And don't you dare tell anyone that I did this! I'm not about to start a silk cocoon collection!\"";
+ mes "\"Here you are now, this will fit. And don't you dare tell anyone that I did this! I'm not about to start a silk cocoon collection!\"";
next;
goto L_main_menu;
@@ -809,7 +820,7 @@ L_robe_missing_cocoons:
L_robe_missing_Zeny:
mes "[Lora Tay the Seamstress]";
- mes "\"No, no no. The way this works is that you give me the GP first and I give you the robe afterwards. You're " + (@ROBE_ZENY - Zeny) + " GP short, so come back when you can afford the robe!\"";
+ mes "\"No, no no. The way this works is that you give me the GP first and I give you the robe afterwards. You're " + (@ROBE_ZENY - Zeny) + " GP short, so come back when you can afford the robe!\"";
next;
goto L_main_menu;
@@ -822,7 +833,7 @@ L_robe_missing_sheets:
L_robe_sheet_missing_Zeny:
mes "[Lora Tay the Seamstress]";
- mes "\"No, no no. The way this works is that you give me the GP first and I give you the robe afterwards. You're " + (@ROBE_SHEETS_ZENY - Zeny) + " GP short, so come back when you can afford the robe!\"";
+ mes "\"No, no no. The way this works is that you give me the GP first and I give you the robe afterwards. You're " + (@ROBE_SHEETS_ZENY - Zeny) + " GP short, so come back when you can afford the robe!\"";
next;
goto L_main_menu;
@@ -832,7 +843,7 @@ L_where_silk:
next;
mes "[Lora Tay the Seamstress]";
mes "She hesitates.";
- mes "\"I didn't see her there the last time I visited, though. She may be visiting family. Tough luck.\"";
+ mes "\"I didn't see her there the last time I visited, though. She may be visiting family. Tough luck.\"";
next;
goto L_robe_menu;
@@ -844,7 +855,7 @@ L_how_much_silk:
L_robe_nosilk:
mes "[Lora Tay the Seamstress]";
- mes "\"What is that? You don't have any silk? Well, you're out of luck, I would say. I shan't make one out of those cotton rags; you might as well be wearing an apple sack.\"";
+ mes "\"What is that? You don't have any silk? Well, you're out of luck, I would say. I shan't make one out of those cotton rags; you might as well be wearing an apple sack.\"";
next;
goto L_main_menu;
@@ -854,7 +865,7 @@ L_end:
set @ROBE_SHEETS_NR, 0;
set @ROBE_SHEETS_ZENY, 0;
set @Robe_with_sheets, 0;
- close;
+ goto L_Close;
// Input: @items (array of items you want to choose from)
// @item_names (names of the items in @items)
@@ -980,7 +991,7 @@ L_SUB_choice_join:
L_TooMany:
mes "[Lora Tay the Seamstress]";
mes "\"You don't have anywhere to put this. Come back when you have more room.\"";
- close;
+ goto L_Close;
L_sorcerer_robe_linecolor:
mes "[Lora Tay the Seamstress]";
@@ -992,7 +1003,7 @@ L_sorcerer_robe_linecolor:
next;
mes "\"Ok. Now please wear the robe you want me to change.\"";
set @loratay_asking_robe, 1;
- close;
+ goto L_Close;
L_ExamineSorcererRobe:
set @loratay_asking_robe, 0;
@@ -1128,8 +1139,13 @@ L_CleanSorcererRobe:
set @new_sorcerer_robe_id, 0;
set @chosen_color, 0;
set @cotton_cloth_id, 0;
- close;
+ goto L_Close;
+
+S_Update:
+ set QUEST_WG_state, (QUEST_WG_state & ~(BYTE_0_MASK) | (@wg_state << BYTE_0_SHIFT));
+ return;
L_Close:
+ set @wg_state, 0;
close;
}
diff --git a/world/map/npc/011-4/bl_barrier.txt b/world/map/npc/011-4/bl_barrier.txt
index 07cc5678..fd33b9fd 100644
--- a/world/map/npc/011-4/bl_barrier.txt
+++ b/world/map/npc/011-4/bl_barrier.txt
@@ -4,11 +4,17 @@
{
set @state, ((QUEST_Hurnscald & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
+ if (@state >= 6) goto L_Bandit_Cave_Abandoned;
if (@state >= 4) goto L_Bandit_Lord_Barrier_Open;
message strcharinfo(0), "This entrance appears to be locked.";
goto L_End;
+L_Bandit_Cave_Abandoned:
+ message strcharinfo(0), "This place looks like it was abandoned.";
+ warp "011-6.gat",251,275;
+ goto L_End;
+
L_Bandit_Lord_Barrier_Open:
message strcharinfo(0), "You insert the silver arrow key and unlock the entrance.";
warp "011-6.gat",251,275;
diff --git a/world/map/npc/011-6/_import.txt b/world/map/npc/011-6/_import.txt
index 731325cd..b8e7e693 100644
--- a/world/map/npc/011-6/_import.txt
+++ b/world/map/npc/011-6/_import.txt
@@ -3,5 +3,7 @@
map: 011-6.gat
npc: npc/011-6/_mobs.txt
npc: npc/011-6/_warps.txt
+npc: npc/011-6/barrier.txt
npc: npc/011-6/bryant.txt
+npc: npc/011-6/crastur.txt
npc: npc/011-6/mapflags.txt
diff --git a/world/map/npc/011-6/_warps.txt b/world/map/npc/011-6/_warps.txt
index fd5828ca..f4a1c05f 100644
--- a/world/map/npc/011-6/_warps.txt
+++ b/world/map/npc/011-6/_warps.txt
@@ -23,4 +23,3 @@
011-6.gat,186,182|warp|To Lake Cave|0,-1,011-4.gat,32,6
011-6.gat,266,182|warp|To Lake Cave|-1,-1,011-4.gat,45,119
011-6.gat,174,256|warp|To Bandit Lord Cave|-1,-1,011-6.gat,264,237
-011-6.gat,264,236|warp|To Isolated Storage Room|-1,-1,011-6.gat,174,255
diff --git a/world/map/npc/011-6/barrier.txt b/world/map/npc/011-6/barrier.txt
new file mode 100644
index 00000000..cf5908e4
--- /dev/null
+++ b/world/map/npc/011-6/barrier.txt
@@ -0,0 +1,16 @@
+011-6.gat,264,236,0|script|#BL_Barrier2|45,0,0,
+{
+ set @state, ((QUEST_Hurnscald & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
+
+ if (@state >= 6) goto L_Bandit_Lord_Hideout_Open;
+ message strcharinfo(0), "You have a feeling that you should not enter this place now.";
+ goto L_End;
+
+L_Bandit_Lord_Hideout_Open:
+ warp "011-6.gat",174,255;
+ goto L_End;
+
+L_End:
+ set @state, 0;
+ end;
+}
diff --git a/world/map/npc/011-6/crastur.txt b/world/map/npc/011-6/crastur.txt
new file mode 100644
index 00000000..f9acb0bf
--- /dev/null
+++ b/world/map/npc/011-6/crastur.txt
@@ -0,0 +1,221 @@
+011-6.gat,172,250,0|script|Crastur the Ugly|418,
+{
+ set @spants_state, ((QUEST_WG_state & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT);
+ set @inspector, ((QUEST_Hurnscald & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);
+ if @spants_state < 3 goto L_Regular;
+ if @spants_state == 3 goto L_Ask;
+ if (@spants_state == 4 || @spants_state == 5 || @spants_state == 6) goto L_Ask_Again;
+ goto L_Main;
+
+
+L_Ask:
+ mes "[Crastur]";
+ mes "";
+ mes "\"Well, well, well\"";
+ next;
+ mes "[Crastur]";
+ mes "";
+ mes "\"Just look who arrived here\"";
+ emotion EMOTE_EVIL;
+ next;
+ mes "[Crastur]";
+ mes "";
+ mes "\"If this isn't the person that cleared my way to success\"";
+ menu
+ "\"Who? Me?\"", L_Unsure,
+ "\"Yes I killed the Bandit Lord, but not to make room for more scumbags\"", L_Insult,
+ "\"I heard you know a lot\"", L_Ask_Cont,
+ "\"Ugh, no. I have to leave now. Bye.\"", L_Close;
+
+L_Ask_Again:
+ mes "[Crastur]";
+ mes "";
+ mes "\"Hello again\"";
+ mes "\"Did you do your part of the deal yet?\"";
+ menu
+ "\"No, I wanted to know if you can tell me anything about me\"", L_Personal,
+ "\"Probably not, what was that again?\"", L_Pirate_Proof,
+ "\"Yes, check this Bandana I brought.\"", L_Bandana,
+ "\"No Idea, Bye.\"", L_Close;
+
+L_Ask_Cont:
+ mes "[Crastur]";
+ mes "";
+ mes "\"Yes I do, for a price.\"";
+ menu
+ "Explain Hetchels story", L_Jibber,
+ "Interesting", L_Main;
+
+L_Jibber:
+ mes "You begin to tell Crastur about Hetchel and her Problems";
+ next;
+ mes "Crastur interrupts you";
+ mes "[Crastur]";
+ mes "";
+ mes "\"I do not care about petty problems, get to the point!\"";
+ set @spants_state, 4;
+ callsub S_Update_Spants;
+ menu
+ "\"Hetchel needs the Plans for Cotton Trousers Stolen from Lora Tay\"", L_Jibber_Cont,
+ "\"Don't talk to me like that\" (Leave)", L_Close;
+
+L_Jibber_Cont:
+ mes "[Crastur]";
+ mes "";
+ mes "\"this can be done quickly\"";
+ next;
+ mes "Crastur pauses and checks his papers";
+ mes "\"...\"";
+ next;
+ mes "[Crastur]";
+ mes "";
+ mes "\"The issue here is\"";
+ mes "\"you have literally nothing that is of any value to me\"";
+ next;
+ mes "[Crastur]";
+ mes "";
+ mes "\"Although... Since you claim to be a hero and everything...\"";
+ mes "\"I do have a problem with those pirates in Tulimshar. They are ruining my Business\"";
+ next;
+ mes "[Crastur]";
+ mes "";
+ mes "\"Bring me proof that you killed all of the pirates!\"";
+ next;
+ menu
+ "\"I have it right here\"", L_Bandana,
+ "\"What kind of proof?\"", L_Pirate_Proof;
+
+
+L_Pirate_Proof:
+ mes "[Crastur]";
+ mes "";
+ mes "\"It is for sure the Pirates give their souls for the rescue of their booty.\"";
+ mes "\"Bring me something unique from their treasure and I will give you those plans in return.\"";
+ set @spants_state, 5;
+ callsub S_Update_Spants;
+ menu
+ "\"I have it with me.\"", L_Bandana,
+ "\"I will try my best.\"", L_Close;
+
+L_Bandana:
+ getinventorylist;
+ if (countitem("Bandana") < 1) goto L_No_Item;
+ if (@spants_state != 6) goto L_Wrong_Item;
+ mes "Crasturs gazes at the bandana in your hand. He scratches his right arm, then he nods";
+ mes "[Crastur]";
+ mes "";
+ mes "\"I am a man of honour, I always pay my debt\"";
+ next;
+ mes "[Crastur]";
+ mes "";
+ mes "\"Here, I couldnt get the original Sheet but this copy should do well enough\"";
+ next;
+ mes "\"Crastur hands you a page ripped out of his Almanach that has dotted lines in green and red Ink all over it";
+ next;
+ mes "You put the plans into a hidden pocket";
+ set @spants_state, 7;
+ callsub S_Update_Spants;
+ goto L_Close;
+
+L_No_Item:
+ mes "[Crastur]";
+ mes "";
+ mes "\"What Bandana are we talking about? - Next time you come to me, bring your stuff.\"";
+ goto L_Close;
+
+L_Wrong_Item:
+ mes "Crastur takes a look at the bandana.";
+ next;
+ mes "[Crastur]";
+ mes "THIS IS NOT FROM THE PIRATES FROM TULIMSHAR, it is a cheap scam.";
+ emotion EMOTE_PERTURBED;
+ mes "As far as you can tell through his mask he seems very mad";
+ goto L_Insult;
+
+L_Regular:
+ mes "[Crastur]";
+ mes "";
+ mes "\"Well, well, well\"";
+ next;
+ mes "[Crastur]";
+ mes "";
+ mes "\"Just look who arrived here\"";
+ next;
+ mes "[Crastur]";
+ mes "";
+ mes "\"If this isn't the person that cleared my way to success\"";
+ menu
+ "\"Who? Me?\"", L_Unsure,
+ "\"Yes I killed the Bandit Lord, but not to make room for more scumbags\"", L_Insult,
+ "\"Ugh, no. I have to leave now. Bye.\"", L_Close;
+
+L_Insult:
+ mes "Die " + strcharinfo(0) + "!";
+ heal -10000, 0;
+ emotion EMOTE_VICIOUS;
+ mes "[Crastur]";
+ mes "";
+ mes "\"Oh I am so sorry, my Dagger must have slipped\"";
+ goto L_Close;
+
+L_Unsure:
+ mes "[Crastur]";
+ mes "";
+ mes "\"Yes I hid in a corner while you killed my former master\"";
+ mes "\"When he left I claimed command over Argaeses Rats, Caves and Dungeons.\"";
+ mes "\"Do not underestimate me, I do know a lot more than you might guess\"";
+ goto L_Main;
+
+L_Main:
+ if((@inspector >= 1 && @inspector <= 7) || @inspector == 9) goto L_Main_Inspector;
+ menu
+ "\"What things do you know about me?\"", L_Personal,
+ "\"Bye\"", L_Close;
+
+L_Main_Inspector:
+ menu
+ "\"What things do you know about me?\"", L_Personal,
+ "\"Do you know anything about the Robberies in Hurnscald?\"", L_Hurnscald,
+ "\"Bye\"", L_Close;
+
+L_Personal:
+ mes "";
+ mes "Crastur digs in a pile of old paper";
+ next;
+ mes "[Crastur]";
+ mes "";
+ mes "\"Ah. Here it is:\"";
+ mes "\"Today you have accomplished tasks that are worth " + DailyQuestPoints + " Hours in the Northern Mines\"";
+ next;
+ if BOSSPOINTS < 1000 goto L_Worm;
+ emotion EMOTE_DEAD;
+ mes "[Crastur]";
+ mes "";
+ mes "\"Also you seem to be quite a hero, it appears you have a record in the Almanach\"";
+ mes "Crastur turns a giant book upside down";
+ mes "\"According to this you have gained " + BOSSPOINTS / 1000 + "thousand Points in the eternal charts already.\"";
+ mes "Crastur shudders";
+ goto L_Close;
+
+L_Worm:
+ emotion EMOTE_SUSPICIOUS;
+ mes "[Crastur]";
+ mes "\"Other than that you have not done anything notable for the mana world.\"";
+ goto L_Close;
+
+L_Hurnscald:
+ emotion EMOTE_FACEPALM;
+ mes "Crastur makes a barking sound that probably was meant as a laugh.";
+ mes "[Crastur]";
+ mes "";
+ mes "\"I am sorry but it is not in my best interest to talk about my business with you.\"";
+ goto L_Close;
+
+S_Update_Spants:
+ set QUEST_WG_state, (QUEST_WG_state & ~(NIBBLE_2_MASK) | (@spants_state << NIBBLE_2_SHIFT));
+ return;
+
+L_Close:
+ set @spants_state, 0;
+ close;
+}
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/020-2/furquest.txt b/world/map/npc/020-2/furquest.txt
index 9d694716..1fd7fa09 100644
--- a/world/map/npc/020-2/furquest.txt
+++ b/world/map/npc/020-2/furquest.txt
@@ -8,26 +8,28 @@
set @CUTFUR_EXP, 10;
set @FINEDRESS_COTTON_CLOTHS, 20;
set @FINEDRESS_GP, 20000;
-
- if (QUEST_WG_state == 1) goto L_State_0_3;
- if (QUEST_WG_state == 2) goto L_State_1;
- if (QUEST_WG_state == 3) goto L_State_2;
- if (QUEST_WG_state == 4) goto L_State_4;
- if (QUEST_WG_state == 5) goto L_State_4_success;
- if (QUEST_WG_state == 6) goto L_State_6;
- if (QUEST_WG_state == 7) goto L_State_11;
- if (QUEST_WG_state == 8) goto L_State_12;
- if (QUEST_WG_state >= 9 && QUEST_WG_state < 11) goto L_State_13;
- if (QUEST_WG_state == 11) goto L_State_14;
- if (QUEST_WG_state == 12) goto L_State_14_AlreadyAccepted;
- if (QUEST_WG_state == 13) goto L_State_15;
- if (QUEST_WG_state > 13 && QUEST_WG_state < 16) goto L_State_15_Repeat;
- if (QUEST_WG_state == 16) goto L_State_16;
- if (QUEST_WG_state > 16 && QUEST_WG_state < 20) goto L_State_16_Repeat;
- if (QUEST_WG_state == 20) goto L_State_17;
- if (QUEST_WG_state == 21) goto L_State_17_AskItems;
- if (QUEST_WG_state == 22) goto L_State_17_ProposeBuyDress;
- if (QUEST_WG_state >= 23) goto L_State_18;
+ set @wg_state, ((QUEST_WG_state & BYTE_0_MASK) >> BYTE_0_SHIFT);
+
+
+ if (@wg_state == 1) goto L_State_0_3;
+ if (@wg_state == 2) goto L_State_1;
+ if (@wg_state == 3) goto L_State_2;
+ if (@wg_state == 4) goto L_State_4;
+ if (@wg_state == 5) goto L_State_4_success;
+ if (@wg_state == 6) goto L_State_6;
+ if (@wg_state == 7) goto L_State_11;
+ if (@wg_state == 8) goto L_State_12;
+ if (@wg_state >= 9 && @wg_state < 11) goto L_State_13;
+ if (@wg_state == 11) goto L_State_14;
+ if (@wg_state == 12) goto L_State_14_AlreadyAccepted;
+ if (@wg_state == 13) goto L_State_15;
+ if (@wg_state > 13 && @wg_state < 16) goto L_State_15_Repeat;
+ if (@wg_state == 16) goto L_State_16;
+ if (@wg_state > 16 && @wg_state < 20) goto L_State_16_Repeat;
+ if (@wg_state == 20) goto L_State_17;
+ if (@wg_state == 21) goto L_State_17_AskItems;
+ if (@wg_state == 22) goto L_State_17_ProposeBuyDress;
+ if (@wg_state >= 23) goto L_State_18;
mes "\"This goes up, this goes left...\"";
next;
@@ -66,8 +68,8 @@ L_State_0_2:
L_State_Accept:
mes "[Agostine, The Legendary Tailor]";
mes "\"Thanks so much.\"";
- set QUEST_WG_state, 1;
- close;
+ set @wg_state, 1;
+ goto L_Close;
L_State_0_3:
mes "[Agostine, The Legendary Tailor]";
@@ -131,18 +133,18 @@ L_State_0_9:
set Zeny, Zeny + 500;
mes "[Agostine, The Legendary Tailor]";
mes "\"This is a little reward for your help. Take 500 GP, my friend!\"";
- set QUEST_WG_state, 2;
- close;
+ set @wg_state, 2;
+ goto L_Close;
L_State_neg:
next;
mes "\"Seems that you lied. You don't have the drink you told me.\"";
- close;
+ goto L_Close;
L_State_bad:
next;
mes "\"Well, I don't like it so much. Bring me something else.\"";
- close;
+ goto L_Close;
// First Quest: edited version of Forest Bow Quest - Needed: about 30 White Furs and 15.000 GP
@@ -160,7 +162,7 @@ L_State_2:
mes "\"Well, Winter Gloves are so fashionable for their lovable fur!";
mes "Only the best furs can be used for these gloves!";
mes "But, as you see, I am a tailor, not a hunter! So, why don't you bring me the best fluffy's fur you can find?\"";
- set QUEST_WG_state, 3;
+ set @wg_state, 3;
next;
menu
"You are crazy! I won't kill any animal for this!", L_Close,
@@ -169,13 +171,13 @@ L_State_2:
L_State_3:
mes "[Agostine, The Legendary Tailor]";
mes "\"Remember, I want the best of fur!\"";
- set QUEST_WG_state, 4;
- close;
+ set @wg_state, 4;
+ goto L_Close;
L_State_4:
mes "[Agostine, The Legendary Tailor]";
mes "\"Oh, my friend! Have you brought me some good furs?\"";
- if (countitem("WhiteFur") < 1) close;
+ if (countitem("WhiteFur") < 1) goto L_Close;
next;
menu
"Here, take a look!", L_State_4_try,
@@ -195,7 +197,7 @@ L_State_4_try:
next;
mes "[Agostine, The Legendary Tailor]";
mes "\"It was awfully cut! You should pay more attention when you kill fluffies!\"";
- if (countitem("WhiteFur") < 1) close;
+ if (countitem("WhiteFur") < 1) goto L_Close;
next;
menu
"Here I have another one!", L_State_4_try,
@@ -207,7 +209,7 @@ L_State_4_success:
mes "[Agostine, The Legendary Tailor]";
mes "\"It's perfect! Perfect! Good job, my friend! I will prepare your gloves right now!\"";
next;
- set QUEST_WG_state, 5;
+ set @wg_state, 5;
goto L_State_5;
L_State_5:
@@ -224,15 +226,15 @@ L_State_5_pay:
if (@inventorylist_count == 100) goto L_TooMany;
set Zeny, Zeny - 15000;
getitem "WinterGloves", 1;
- set QUEST_WG_state, 6;
+ set @wg_state, 6;
mes "[Agostine, The Legendary Tailor]";
mes "\"Here they are. You will have the most fashionable hands in the world!\"";
- close;
+ goto L_Close;
L_State_5_nocash:
mes "[Agostine, The Legendary Tailor]";
mes "\"Seems like you are out of cash. Come back when you have the money.\"";
- close;
+ goto L_Close;
L_State_6:
mes "[Agostine, The Legendary Tailor]";
@@ -251,13 +253,13 @@ L_State_10:
mes "\"Perfect! For satisfying your request I need another perfect White Fur";
mes "and a pair of Boots, like those you can find in the mines.";
mes "They will make you lovely, my friend!\"";
- set QUEST_WG_state, 7;
- close;
+ set @wg_state, 7;
+ goto L_Close;
L_State_11:
mes "[Agostine, The Legendary Tailor]";
mes "\"So, my friend, have you brought me the right Fur?\"";
- if (countitem("WhiteFur") < 1) close;
+ if (countitem("WhiteFur") < 1) goto L_Close;
next;
menu
"Sure, I'm a fluffy hunter!", L_State_11_try,
@@ -278,7 +280,7 @@ L_State_11_try:
next;
mes "[Agostine, The Legendary Tailor]";
mes "\"That fur was terrible. I won't work with it!\"";
- if (countitem("WhiteFur") < 1) close;
+ if (countitem("WhiteFur") < 1) goto L_Close;
next;
menu
"Well, maybe this is better!", L_State_11_try,
@@ -289,7 +291,7 @@ L_State_11_success:
next;
mes "[Agostine, The Legendary Tailor]";
mes "\"This one is good enough, my friend. Good job.\"";
- set QUEST_WG_state, 8;
+ set @wg_state, 8;
goto L_State_12;
L_State_12:
@@ -308,32 +310,32 @@ L_State_12_pay:
set Zeny, Zeny - 15000;
delitem "Boots", 1;
getitem "FurBoots", 1;
- set QUEST_WG_state, 9;
+ set @wg_state, 9;
mes "[Agostine, The Legendary Tailor]";
mes "\"Enjoy your new boots, my friend!\"";
- close;
+ goto L_Close;
L_State_12_missing:
mes "[Agostine, The Legendary Tailor]";
mes "\"Seems you have forgotten something. Check your inventory";
mes "and your pockets!\"";
- close;
+ goto L_Close;
L_State_13:
mes "[Agostine, The Legendary Tailor]";
mes "\"You are so glamourous, my dear friend!";
mes "I have done a very good job on your clothes!\"";
- close;
+ goto L_Close;
L_TooMany:
mes "[Agostine, The Legendary Tailor]";
mes "\"You don't have anywhere to put them. Come back when you do.\"";
- close;
+ goto L_Close;
L_No_Fur:
mes "[Agostine, The Legendary Tailor]";
mes "\"You don't have any white fur! Stop talking nonsense.\"";
- close;
+ goto L_Close;
L_State_14:
if (BaseLevel < 60)
@@ -378,13 +380,13 @@ L_Next2:
"It will never happen. I won't waste my time.", L_Close;
L_State_14_Accept:
- set QUEST_WG_state, 12;
- close;
+ set @wg_state, 12;
+ goto L_Close;
L_State_14_AlreadyAccepted:
mes "[Agostine, The Legendary Tailor]";
mes "\"Please my friend, go talk to Lora Tay about our possible collaboration!\"";
- close;
+ goto L_Close;
L_State_15:
mes "[Agostine, The Legendary Tailor]";
@@ -418,15 +420,15 @@ L_Next4:
mes "[Agostine, The Legendary Tailor]";
mes "\"Hurry back my friend!\"";
- set QUEST_WG_state, 14;
+ set @wg_state, 14;
- close;
+ goto L_Close;
L_State_15_Repeat:
mes "[Agostine, The Legendary Tailor]";
mes "\"Please take these materials with you to show Lora Tay the kind of vision I have!";
mes "Hurry back my friend!\"";
- close;
+ goto L_Close;
L_State_16:
mes "[Agostine, The Legendary Tailor]";
@@ -460,17 +462,17 @@ L_Next6:
"... I'll take a nap first.", L_Close;
L_Next7:
- set QUEST_WG_state, 17;
+ set @wg_state, 17;
message strcharinfo(0), "Agostine gives you a folio containing his designs, that you put in a hidden compartment in your backpack.";
mes "Agostine gives you a folio containing his designs, that you put in a hidden compartment in your backpack.";
- close;
+ goto L_Close;
L_State_16_Repeat:
mes "[Agostine, The Legendary Tailor]";
mes "\"Please my friend, bring my designs to Lora Tay.\"";
- close;
+ goto L_Close;
L_State_17:
mes "[Agostine, The Legendary Tailor]";
@@ -501,20 +503,20 @@ L_State_17_AskItems:
"Here you are!", L_State_17_GiveItems;
L_Next9:
- set QUEST_WG_state, 21;
- close;
+ set @wg_state, 21;
+ goto L_Close;
L_State_17_NotEnoughItems:
mes "[Agostine, The Legendary Tailor]";
mes "\"My friend, sorry to disappoint you, but you are lacking some cloth.";
mes "I need exactly " + @FINEDRESS_COTTON_CLOTHS + " cotton cloths to finish this master piece.\"";
- close;
+ goto L_Close;
L_State_17_GiveItems:
if (countitem ("CottonCloth") < @FINEDRESS_COTTON_CLOTHS)
goto L_State_17_NotEnoughItems;
delitem "CottonCloth", @FINEDRESS_COTTON_CLOTHS;
- set QUEST_WG_state, 22;
+ set @wg_state, 22;
mes "[Agostine, The Legendary Tailor]";
mes "\"Great now just a little cloth here........\"";
@@ -571,27 +573,29 @@ L_Next11:
set Zeny, Zeny - @FINEDRESS_GP;
getitem "FineDress", 1;
- set QUEST_WG_state, 23;
- close;
+ set @wg_state, 23;
+ goto L_Close;
L_State_17_NoMoney:
mes "[Agostine, The Legendary Tailor]";
mes "\"Check your pockets my friend,";
mes "and come back when you have the money.\"";
- close;
+ goto L_Close;
L_State_17_InventoryFull:
mes "[Agostine, The Legendary Tailor]";
mes "\"My friend, you don't have room to carry my master piece. Come back when you do.\"";
- close;
+ goto L_Close;
L_State_18:
- // Same dialog than on state 13, but we could add something about the dress
+ // Same dialog as on state 13, but we could add something about the dress
mes "[Agostine, The Legendary Tailor]";
mes "\"You are so glamourous, my dear friend!";
mes "I have done a very good job on your clothes!\"";
- close;
+ goto L_Close;
L_Close:
+ set QUEST_WG_state, (QUEST_WG_state & ~(BYTE_0_MASK) | (@wg_state << BYTE_0_SHIFT));
+ set @wg_state, 0;
close;
}
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;
+}
diff --git a/world/map/npc/042-2/barrels.txt b/world/map/npc/042-2/barrels.txt
index 540027ac..8e5b6c49 100644
--- a/world/map/npc/042-2/barrels.txt
+++ b/world/map/npc/042-2/barrels.txt
@@ -8,6 +8,8 @@
end;
OnMaggotDeath:
+ set @mobID, 1050;
+ callfunc "MobPoints";
end;
}
042-2.gat,28,86,0|script|Barrel#1|400,
diff --git a/world/map/npc/055-3/_mobs.txt b/world/map/npc/055-3/_mobs.txt
index d7787303..2e54c2c9 100644
--- a/world/map/npc/055-3/_mobs.txt
+++ b/world/map/npc/055-3/_mobs.txt
@@ -1,12 +1,14 @@
// This file is generated automatically. All manually changes will be removed when running the Converter.
// Cave mobs
-055-3.gat,45,44,20,14|monster|RedSlime|1008,13,10000,60000,Mob055-3::On1008
+055-3.gat,45,44,20,14|monster|RedSlime|1008,10,10000,60000,Mob055-3::On1008
055-3.gat,0,0,1,1|monster|Bat|1017,20,10000,45000,Mob055-3::On1017
-055-3.gat,53,75,28,40|monster|YellowSlime|1007,13,10000,60000,Mob055-3::On1007
-055-3.gat,0,0,1,1|monster|BlackScorpion|1009,10,10000,35000,Mob055-3::On1009
-055-3.gat,0,0,1,1|monster|Spider|1012,10,10000,35000,Mob055-3::On1012
+055-3.gat,53,75,28,40|monster|YellowSlime|1007,10,10000,60000,Mob055-3::On1007
+055-3.gat,0,0,1,1|monster|BlackScorpion|1009,8,10000,35000,Mob055-3::On1009
+055-3.gat,0,0,1,1|monster|Spider|1012,8,10000,35000,Mob055-3::On1012
055-3.gat,0,0,1,1|monster|Snake|1010,3,10000,20000,Mob055-3::On1010
+055-3.gat,46,44,14,18|monster|Spider|1012,3,50000,100000,Mob055-3::On1012
+055-3.gat,52,78,36,23|monster|BlackScorpion|1009,3,50000,100000,Mob055-3::On1009
055-3.gat,0,0,0|script|Mob055-3|-1,
diff --git a/world/map/npc/068-2/hetchel.txt b/world/map/npc/068-2/hetchel.txt
index 87c3d5af..a14b64bd 100644
--- a/world/map/npc/068-2/hetchel.txt
+++ b/world/map/npc/068-2/hetchel.txt
@@ -7,50 +7,294 @@
// She could also sell, dyed sheets, Silk robes from Lora Tay.
// (6000 with cocoons, 40000 (?) with no cocoons).
//
-// Hetchel's workshop is actually under repair, Shé'll be back in 021-2 when workers have finished their job.
-//
-// QUEST_WG_state: Global variable indicating winter gloves status.
-// Lora Tay proposes silk Robe if (QUEST_WG_state>= 11).
+// @wg_state: variable indicating winter gloves status.
+// Lora Tay proposes silk Robe if (@wg_state>= 11).
// @SHEET_COCOONS_NR : Number of cocoons required per sheet.
// Might ne calculated from @ROBE_COCOONS_NR/@ROBE_SHEETS_NR
// Actually: 150∕6 = 25
// @SHEET_ZENY : Money to pay per sheet: A sixth of 10000-2*500-6000
// @SheetCount Number of sheets to buy (variable).
+//
+// @silkpants_state: variable indicating silkpant quest status.
068-2.gat,62,83,0|script|Hetchel|376,
{
+ set @wg_state, ((QUEST_WG_state & BYTE_0_MASK) >> BYTE_0_SHIFT);
+ set @spants_state, ((QUEST_WG_state & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT);
set @SHEET_COCOONS_NR, 25;
set @SHEET_ZENY, 500;
+ set @spants_minlvl, 45;
+ setarray @spants_req_hmn$, "Silk Cocoons", "Pieces of Cotton Cloth", "Silk Headbands";
+ setarray @spants_req$, "SilkCocoon", "CottonCloth", "SilkHeadband";
+ setarray @spants_req_amt, 154, 14, 2;
+ set @spants_reward, 45000;
+ set @spants_job_reward, 10000;
set @SheetCount, 0;
- if (QUEST_WG_state < 11)
+ if (@wg_state < 11)
goto L_WG_quest_not_done;
+ if ( BaseLevel > @spants_minlvl && @spants_state < 1 ) goto L_Spants_Cry;
+ if ( @spants_state == 1 ) goto L_Spants_Cry_2;
+ if ( @spants_state == 2 ) goto L_Spants_Start;
+ if ( @spants_state > 2 && @spants_state < 8 ) goto L_Spants_Steal;
+ if ( @spants_state == 8 ) goto L_Spants_Make;
+
mes "[Hetchel the weaver]";
+ mes "";
mes "\"Hello I am Hetchel, I weave fine textiles, what can I do for you?\"";
menu
- "Sorry to bother, I'm just visiting.", L_end,
+ "Sorry to bother, I'm just visiting.", L_Close,
"I am looking for silk sheets, Lora Tay told me that I could find some in this market. Can you help?", L_main_menu;
L_WG_quest_not_done:
mes "[Hetchel the weaver]";
+ mes "";
mes "\"Hello I am Hetchel, I weave fine textiles.";
mes "My best client is Lora Tay, at Dimond's.";
mes "What can I do for you?\"";
menu
- "Sorry to bother, I'm new to this country, just visting.", L_end,
+ "Sorry to bother, I'm new to this country, just visting.", L_Close,
"What are you selling?", L_main_menu;
+L_Spants_Cry:
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "\"Hello I am Hetchel, I weave fine textiles, what can I do for you?\"";
+ menu
+ "Sorry to bother, I'm just visiting.", L_Close,
+ "I am looking for silk sheets, Lora Tay told me that I could find some in this market. Can you help?", L_Spants_Cry_Cont_1;
+
+L_Spants_Cry_2:
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "\"Hello I am Hetchel, I weave fine textiles, what can I do for you?\"";
+ menu
+ "Sorry to bother, I'm just visiting.", L_Close,
+ "I am looking for silk sheets, Lora Tay told me that I could find some in this market. Can you help?", L_main_menu,
+ "Hey you have been crying so badly, can I help you somehow?", L_Spants_Reply_Cry,
+ "Give Hetchel something to dry her tears", L_Spants_Wipe_Tears;
+
+L_Spants_Start:
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "\"Hello I am Hetchel, I weave fine textiles, what can I do for you?\"";
+ menu
+ "Sorry to bother, I'm just visiting.", L_Close,
+ "I am looking for silk sheets, Lora Tay told me that I could find some in this market. Can you help?", L_main_menu,
+ "So you are looking for new goals in your life?", L_Spants_No_Cry;
+
+L_Spants_Steal:
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "\"Hello I am Hetchel, I weave fine textiles, what can I do for you?\"";
+ menu
+ "Sorry to bother, I'm just visiting.", L_Close,
+ "I am looking for silk sheets, Lora Tay told me that I could find some in this market. Can you help?", L_main_menu,
+ "About the Pants...", L_Spants_Steal_Cont;
+
+L_Spants_Make:
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "\"Hello I am Hetchel, I weave fine textiles, what can I do for you?\"";
+ menu
+ "Sorry to bother, I'm just visiting.", L_Close,
+ "I am looking for silk sheets, Lora Tay told me that I could find some in this market. Can you help?", L_main_menu,
+ "Hey what about the Pants you were planning to make?", L_Spants_Make_Cont;
+
+L_Spants_Cry_Cont_1:
+ mes "You notice how the tiny woman blushes, she suddenly bursts into tears.";
+ next;
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "\"Hello\"";
+ mes "Hetchel hides her face in her hands";
+ mes "";
+ mes "";
+ menu
+ "\"Hey, what is the problem?\"", L_Spants_Reply_Cry,
+ "Give Hetchel something to dry her tears", L_Spants_Wipe_Tears,
+ "\"Oh really? Just sell me some Silk Sheets if you have them\"", L_main_menu;
+
+L_Spants_Wipe_Tears:
+ mes "Hand Hetchel a (please type the Item you want to give her)";
+ next;
+ mes "This is case sensitive. Also do not enter whitespaces.";
+ input @spants_wipe_thingy$;
+ if (@spants_wipe_thingy$ == "") goto L_Spants_Wrong;
+ if (countitem(@spants_wipe_thingy$) < 1) goto L_Spants_No_Item;
+ if (@spants_wipe_thingy$ == "RedCottonCloth") goto L_Spants_Wipe_Tears_Cont;
+ if (@spants_wipe_thingy$ == "RedHitchhikersTowel") goto L_Spants_Wipe_Tears_Towel;
+ mes "Hetchel looks at you, then looks at the" + @spants_wipe_thingy$ + ".";
+ mes "She hangs her head and weeps more";
+ mes "Red is the only color I have ever loved, bring me something red to dry my tears";
+ goto L_Close;
+
+L_Spants_Wipe_Tears_Towel:
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "\"No, I recognize this towel, it is one of those warping towels, are you trying to mess with me?\"";
+ goto L_Close;
+
+L_Spants_Wrong:
+ mes "It appears you forgot to type the item you want to give.";
+ goto L_Close;
+
+L_Spants_No_Item:
+ mes "Oh you do not have it.";
+ goto L_Close;
+
+L_Spants_Wipe_Tears_Cont:
+ mes "Hetchel dries her tears with the Red Piece of Cloth you gave her.";
+ mes "This seems to have consoled her.";
+ delitem "RedCottonCloth", 1;
+ set @spants_state, 2;
+ callsub S_Update_Spants;
+ goto L_Spants_No_Cry;
+
+L_Spants_No_Cry:
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "\"Oh thank you my dear friend.";
+ mes "Yes, to some extent.";
+ next;
+ mes "I am just so sad because I realized that this is going to be the thing I will be doing for the rest of my life\"";
+ menu
+ "\"You are still young, Hetchel, You can still accomplish things\"", L_Spants_Cry_Cont_2,
+ "\"Yes, you are probably correct.\"", L_Close;
+
+L_Spants_Cry_Cont_2:
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "Hetchel thinks for a while";
+ mes "";
+ mes "\"Oh my friend, I have been dreaming of making a garment of my own.";
+ mes "It always bothered me to see all those wizards and witches here being naked under their cloaks\"";
+ mes "\"They must be so embarrassed - they are true heros to give up their dignity to be able to fight the perils of this world\"";
+ mes "Hetchel sobs";
+ menu
+ "\"So you want to make pants for mages?\"", L_Spants_Cry_Cont_3,
+ "\"This sounds ridiculous. Good Bye.\"", L_Close;
+
+L_Spants_Cry_Cont_3:
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "\"Ok, so I figured I could make some trousers like Lora Tay makes but from the much finer Material the Silk Worms are making for us\"";
+ mes "\"But I really need the base plans for the trousers, otherwise I do not know how to attempt this.";
+ mes "Can you get me those plans from her?\"";
+ menu
+ "\"No, sorry I am too busy for that\"", L_Close,
+ "\"Of course!\"", L_Spants_Cry_Cont_4;
+
+L_Spants_Cry_Cont_4:
+ set @spants_state, 3;
+ callsub S_Update_Spants;
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "\"Oh wait! I am not sure if it is such a good idea to ask her about that, I think she would not give the plans to you anyway.";
+ mes "Maybe you can find a way to get those plans on a different way?";
+ mes "I think there are some people in Hurnscald who have their means of getting you every possible item there is\"";
+ next;
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "Please please please - I need those plans";
+ goto L_Close;
+
+L_Spants_Reply_Cry:
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "\"...\"";
+ set @spants_state, 1;
+ callsub S_Update_Spants;
+ goto L_Close;
+
+
+L_Spants_Steal_Cont:
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "\"Have you gotten hold of the plans?\"";
+ menu
+ "Yes I have them somewhere here", L_Spants_Steal_Cont2,
+ "No, not yet", L_Close;
+
+L_Spants_Steal_Cont2:
+ if @spants_state < 7 goto L_Spants_No_Item;
+ set @spants_state, 8;
+ callsub S_Update_Spants;
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "\"Oh this is miraculous\"";
+ mes "";
+ mes "Hetchel sheds some tears of joy";
+ next;
+ mes "You hand her the crumpled plans Crastur the Ugly gave you.";
+ next;
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "\"I need to figure out how to do this now... \"";
+ next;
+ mes "Hetchel adjusts her glasses and reads carefully";
+ next;
+ mes "She seems to be very busy, maybe you should come back later.";
+ goto L_Close;
+
+L_Spants_Make_Cont:
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "\"Yes, I already made a prototype but it cost me a lot of time and effort.";
+ mes "I can give it to you if you are willing to pay for my expenses though.\"";
+ menu
+ "What do you want for those silken pants?", L_Spants_Make_Cont_2,
+ "No, I am not particularly interested.", L_Close;
+
+L_Spants_Make_Cont_2:
+ if(getarraysize(@spants_req_amt) < 3 || getarraysize(@spants_req$) < 3 || getarraysize(@spants_req_hmn$) < 3)
+ goto L_Spants_Error;
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "\"I need you to bring me " + @spants_req_amt[0] +" "+ @spants_req_hmn$[0] + ", " + @spants_req_amt[1] +" "+ @spants_req_hmn$[1] + " and " + @spants_req_amt[2] +" "+ @spants_req_hmn$[2];
+ next;
+ mes "You will not have to pay for my time, I am so proud to have accomplished this on my own!\"";
+ menu
+ "\"I have those items with me\"", L_Spants_Pay,
+ "\"I am still looking for them\"", L_Close,
+ "\"What do you need again?\"", L_Spants_Make_Cont_2;
+
+L_Spants_Pay:
+ if (countitem(@spants_req$[0]) < @spants_req_amt[0] || countitem(@spants_req$[1]) < @spants_req_amt[1] || countitem(@spants_req$[2]) < @spants_req_amt[2])
+ goto L_Spants_No_Item;
+ getinventorylist;
+ if (inventorylist_count == 100) goto L_TooMany;
+ mes "Hetchel takes your items.";
+ delitem @spants_req$[0], @spants_req_amt[0];
+ delitem @spants_req$[1], @spants_req_amt[1];
+ delitem @spants_req$[2], @spants_req_amt[2];
+ getitem "SilkPants", 1;
+ set @spants_state, 9;
+ callsub S_Update_Spants;
+ next;
+ mes "[Hetchel the weaver]";
+ mes "";
+ mes "\"Here are your pants my dear.";
+ mes "Keep them safe I do not know if I will ever try this again.\"";
+ getexp @spants_reward, @spants_job_reward;
+ goto L_Close;
+
+L_Spants_Error:
+ mes "Something went wrong in the script, please inform a developer about that";
+ close;
+
L_main_menu:
mes "[Hetchel]";
mes "\"I have some silk sheets: double-elbow squares.\"";
menu
- "I'm not interested at the moment, maybe later; thanks anyway.", L_end,
+ "I'm not interested at the moment, maybe later; thanks anyway.", L_Close,
"Can I buy some?", L_Next;
// "Do you have a silk robe I could buy?", L_robe,
-// "Goodbye.", L_end;
+// "Goodbye.", L_Close;
L_Next:
mes "[Hetchel]";
+ mes "";
mes "\"Sure but you need to provide raw materials.";
mes "I'll need " + @SHEET_COCOONS_NR +" silk cocoons per sheet,";
mes "and also " + @SHEET_ZENY +" GP per sheet for my work.\"";
@@ -63,10 +307,11 @@ L_sheet_menu:
menu
"I have what you asked for.", L_Next1,
"Sorry I didn't pay attention enough, what do you need?", L_how_many_cocoons,
- "Oops! Sorry, I'll come back soon with them.", L_end;
+ "Oops! Sorry, I'll come back soon with them.", L_Close;
L_Next1:
mes "[Hetchel]";
+ mes "";
mes "\"How many would you like?\"";
input @SheetCount;
if (@SheetCount == 0)
@@ -82,24 +327,28 @@ L_Next1:
delitem "SilkCocoon", @SheetCount * @SHEET_COCOONS_NR;
getitem "SilkSheet", @SheetCount;
mes "[Hetchel]";
+ mes "";
mes "\"Thank you, I hope the sheets will fit your needs.";
mes "Please greet Lora for me when you see her.\"";
emotion EMOTE_HAPPY;
- goto L_end;
+ goto L_Close;
L_sheet_missing_cocoons:
mes "[Hetchel]";
+ mes "";
mes "\"I'm sorry, but I need " + @SheetCount * @SHEET_COCOONS_NR + ", not " + countitem("SilkCocoon") + ".\"";
- goto L_end;
+ goto L_Close;
L_sheet_missing_Zeny:
mes "[Hetchel]";
+ mes "";
mes "\"No, no no. The way this works is that you give me the GP first and I give you the sheets afterwards.";
mes "You're " + (@SheetCount * @SHEET_ZENY - Zeny) + " GP short, so come back when you can afford the sheets you asked for!\"";
- goto L_end;
+ goto L_Close;
L_how_many_cocoons:
mes "[Hetchel]";
+ mes "";
mes "\"I need an average of " + @SHEET_COCOONS_NR + " cocoons per sheet";
mes "and also " + @SHEET_ZENY + " GP per sheet for my work.\"";
next;
@@ -107,16 +356,17 @@ L_how_many_cocoons:
L_sheet_no_cocoon:
mes "[Hetchel]";
+ mes "";
mes "\"You don't have any cocoon? I'm sorry I can't do anything for you.\"";
menu
- "I'll seek for them.", L_end,
+ "I'll seek for them.", L_Close,
"Where can I get cocoons?", L_Next2;
L_Next2:
mes "[Hetchel]";
mes "\"Silk cocoons come from Silkworms. Silkworms live in the woodland area around Hurnscald.";
mes "Silkworms like especially woods and dark areas. You can go there by ferry.\"";
- goto L_end;
+ goto L_Close;
//L_robe:
// mes "[Hetchel]";
@@ -129,18 +379,67 @@ L_Next2:
L_zero_sheet:
mes "[Hetchel]";
+ mes "";
mes "\"It's the best way to get quickly served!\"";
- goto L_end;
+ goto L_Close;
L_TooMany:
mes "[Hetchel]";
+ mes "";
mes "\"Your bag hasn't room enough. Store some things and come back.\"";
- goto L_end;
+ goto L_Close;
-L_end:
+S_Update_Spants:
+ set QUEST_WG_state, (QUEST_WG_state & ~(NIBBLE_2_MASK) | (@spants_state << NIBBLE_2_SHIFT));
+ return;
+
+L_Close:
+ set QUEST_WG_state, (QUEST_WG_state & ~(NIBBLE_2_MASK) | (@spants_state << NIBBLE_2_SHIFT));
+ set @wg_state, 0;
+ set @spants_state, 0;
+ set @spants_minlvl, 0;
+ set @spants_reward, 0;
+ set @spants_job_reward, 0;
+ set @spants_wipe_thingy, "";
set @SHEET_COCOONS_NR, 0;
set @SHEET_ZENY, 0;
set @SheetCount, 0;
+ set @wg_state, 0;
close;
}
+068-2.gat,60,83,0|script|HetchelDebug|376,
+{
+set @wg_state, ((QUEST_WG_state & BYTE_0_MASK) >> BYTE_0_SHIFT);
+set @spants_state, ((QUEST_WG_state & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT);
+
+mes "Lora Tay Quest State: "+ @wg_state;
+mes "Silk Pants Quest State: "+ @spants_state;
+
+menu
+ "Set Lora Tay Quest State", L_Lora_Tay,
+ "Set Silk Pants Quest State", L_Spants,
+ "Close", L_Close;
+
+L_Lora_Tay:
+ mes "Set Lora Tay Visited State (0 - reset , 11 - enough for SilkPants Quest)";
+ input @wg_state;
+ goto L_Close;
+
+L_Spants:
+ mes "Set SilkPants Quest State (0 - reset)";
+ input @spants_state;
+ goto L_Close;
+
+L_Close:
+ set QUEST_WG_state, (QUEST_WG_state & ~(BYTE_0_MASK) | (@wg_state << BYTE_0_SHIFT));
+ set @wg_state, 0;
+ set QUEST_WG_state, (QUEST_WG_state & ~(NIBBLE_2_MASK) | (@spants_state << NIBBLE_2_SHIFT));
+ set @spants_state, 0;
+ close;
+
+OnInit:
+ if (!debug)
+ disablenpc "HetchelDebug";
+ end;
+}
diff --git a/world/map/npc/annuals/halloween/config.txt b/world/map/npc/annuals/halloween/config.txt
index 59839668..a3d5fd58 100644
--- a/world/map/npc/annuals/halloween/config.txt
+++ b/world/map/npc/annuals/halloween/config.txt
@@ -127,8 +127,6 @@ L_Main:
set $@halloween_memory_count, 8;
// Level to go trick-or-treating
set $@halloween_min_level, 10;
- // Age to go trick-or-treating
- set $@halloween_min_age, (7*86400);
// Number of trick and treats completed to get charm.
set $@halloween_charm_count, 10;
@@ -333,6 +331,12 @@ L_Main:
set $@n, 0;
+ // Age to go trick-or-treating (1 week before the start)
+ if ((gettime(6) >= $@halloween_start_month) || (gettime(6) <= $@halloween_end_month))
+ set $@halloween_min_age, ((gettime(5) + 7)*86400);
+ if (gettime(6) == $@halloween_reward_start_month)
+ set $@halloween_min_age, ((gettime(5) + 38)*86400);
+
if((gettime(6) == $@halloween_reward_start_month && gettime(5) >= $@halloween_reward_start_day
&& (gettime(5) <= $@halloween_reward_end_day && $@halloween_reward_start_month == $@halloween_end_month
|| !($@halloween_reward_start_month == $@halloween_end_month)))
diff --git a/world/map/npc/annuals/halloween/trick_or_treat.txt b/world/map/npc/annuals/halloween/trick_or_treat.txt
index 3407efd5..150b5939 100644
--- a/world/map/npc/annuals/halloween/trick_or_treat.txt
+++ b/world/map/npc/annuals/halloween/trick_or_treat.txt
@@ -100,11 +100,11 @@ L_Check_Inventory:
goto L_Tricking_Trick_or_Treat;
L_Check_Karma:
- // Please don't change this, you'll break stuff.
+ // NPC Cheater detection starts after max NPCs hit
if (rand($@halloween_num_npcs, 65535) <= @karma)
goto L_Cheater;
- // this is a cheap, limited form of ilog2
- if ((@karma >= 16) && !(rand( 4 - (@karma >= 64) + (@karma >= 256) + (@karma >= 1024) )))
+ // NPC Cheater detection engages at 48 Trick or Treats
+ if (@karma >= 48)
goto L_Cheater;
if (HALLOWEENTIME & $@halloween_got_big_reward)
goto L_Tricking_Trick_or_Treat;
@@ -161,8 +161,8 @@ L_Tricking_Reward:
next;
if (@karma >= 16)
set @scare_factor, rand(@scare_factor / 2, @scare_factor);
- if (@karma >= 256)
- goto L_Tricking_End;
+ if (@karma >= 24)
+ set @scare_factor, rand(@scare_factor / 3, @scare_factor);
if (@scare_factor < 1)
set @scare_factor, 1;
goto L_Tricking_Reward_Loop;
@@ -266,7 +266,12 @@ L_Return:
function|script|HalloweenTree|,
{
mes "[Confused Tree]";
- mes "\"I love halloween, wearing masks and going trick or treating is so much fun.\"";
+ if ((HALLOWEENTIME & 65535) > ($@halloween_num_npcs * 3))
+ mes "\"Whoa slow down greedy, leave some candy for the reset of us!\"";
+ if ((HALLOWEENTIME & 65535) > $@halloween_num_npcs)
+ mes "\"I see you have ben enjoying trick or treating, I hope you don't get a stomach ache.\"";
+ if ((HALLOWEENTIME & 65535) <= $@halloween_num_npcs)
+ mes "\"I love halloween, wearing masks and going trick or treating is so much fun.\"";
goto L_StartMenu;
L_StartMenu:
diff --git a/world/map/npc/functions/barber.txt b/world/map/npc/functions/barber.txt
index 0f9b4ffb..58fee175 100644
--- a/world/map/npc/functions/barber.txt
+++ b/world/map/npc/functions/barber.txt
@@ -19,9 +19,11 @@ L_Main:
set @color, getlook(LOOK_HAIR_COLOR);
set @style$, "Unknown";
set @color$, "Unknown";
- if (@style >= 0 && @style < 20)
- set @style$, @HairStyles$[@style];
- if (@color >= 0 && @color < 120)
+ if (@style >= 1 && @style <= 20)
+ set @style$, @HairStyles$[(@style - 1)];
+ if (Class > 1)
+ set @color, (@color - (15 * Class));
+ if (@color >= 0 && @color <= 15)
set @color$, @HairColors$[@color];
if (@color == 127)
set @color$, "Shocked White";
@@ -66,15 +68,15 @@ L_Style:
@HairStyles$[25], L_MenuItems;
L_MenuItems:
- if (@menu - 1 == @style)
+ if (@menu == @style)
goto L_SameStyle;
if(@menu == (getarraysize(@HairStyles$) - 1)) goto L_RandomStyle;
if(@menu == getarraysize(@HairStyles$)) goto L_Done;
- setlook LOOK_HAIR_STYLE, @menu - 1;
+ setlook LOOK_HAIR_STYLE, @menu;
goto L_Main;
L_RandomStyle:
- set @randomStyle, rand(0, (getarraysize(@HairStyles$) -4));
+ set @randomStyle, rand(1, (getarraysize(@HairStyles$) -4));
if(@randomStyle == @style) goto L_RandomStyle;
setlook LOOK_HAIR_STYLE, @randomStyle;
menu
@@ -87,7 +89,7 @@ L_SameStyle:
goto L_Main;
L_Color:
- if(@style == Class) goto L_SameColor; // first headstyle of any class is bald
+ if(@style == @BaldStyle) goto L_SameColor; // last headstyle of any class is bald
if(!@colorOpts) set @HairColors$[getarraysize(@HairColors$)], "Surprise me";
if(!@colorOpts) set @HairColors$[getarraysize(@HairColors$)], "Nah, I'm fine";
if(!@colorOpts) set @colorOpts, 1;
@@ -115,11 +117,11 @@ L_MenuItems1:
goto L_SameColor;
if(@menu == (getarraysize(@HairColors$) - 1)) goto L_RandomColor;
if(@menu == getarraysize(@HairColors$)) goto L_Done;
- setlook LOOK_HAIR_COLOR, ((@menu - 1) + (15 * Class));
+ setlook LOOK_HAIR_COLOR, ((@menu - 1) + (15 * (Class - 1)));
goto L_Main;
L_RandomColor:
- set @randomColor, rand((15 * Class), ((getarraysize(@HairColors$) -4) + (15 * Class)));
+ set @randomColor, rand((15 * (Class - 1)), ((getarraysize(@HairColors$) -4) + (15 * (Class - 1))));
if(@randomColor == @color) goto L_RandomColor;
setlook LOOK_HAIR_COLOR, @randomColor;
menu
diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt
index 0a0247b7..588c22d5 100644
--- a/world/map/npc/functions/clear_vars.txt
+++ b/world/map/npc/functions/clear_vars.txt
@@ -251,6 +251,10 @@ L_Fix_Skills:
if(getskilllv(SKILL_TRADE) > 0) setskill SKILL_TRADE, 0;
if(getskilllv(SKILL_PARTY) > 0) setskill SKILL_PARTY, 0;
if(getskilllv(SKILL_EMOTE) > 0) setskill SKILL_EMOTE, 0;
+ goto L_Barber_Janitor;
+
+L_Barber_Janitor:
+ callfunc "getHeadStyles"; // this converts class, color and hair
goto L_Return;
L_Return:
diff --git a/world/map/npc/functions/headstyles.txt b/world/map/npc/functions/headstyles.txt
index 989bef83..4648ede4 100644
--- a/world/map/npc/functions/headstyles.txt
+++ b/world/map/npc/functions/headstyles.txt
@@ -5,37 +5,42 @@ function|script|getHeadStyles|,
{
set @HairStyles$, 0;
set @HairColors$, 0;
- set @BaseClass, 0; // this is the default class
+ set @BaseClass, 1; // this is the default class
cleararray @HairStyles$, "", getarraysize(@HairStyles$);
cleararray @HairColors$, "", getarraysize(@HairColors$);
cleararray @ValidClasses, "", getarraysize(@ValidClasses);
- setarray @ValidClasses, 0; // add new classes here
+ setarray @ValidClasses, 1; // add new classes here
set @loop, 0;
goto L_LoopValid;
- L_LoopValid:
- if(@ValidClasses[@loop] == Class) goto L_ValidClass;
- set @loop, (@loop + 1);
- if(@loop >= getarraysize(@ValidClasses)) goto L_FixClass;
- goto L_LoopValid;
+L_Janitor:
+ set @BaldStyle, getarraysize(@HairStyles$); // we set it as a variable because we use it with the barber
+ if(getlook(LOOK_HAIR_STYLE) < 1) setlook LOOK_HAIR_STYLE, @BaldStyle; // the last head of any race has no hair/fins/whatever
+ return;
- L_FixClass:
- set Class, @BaseClass;
- goto L_ValidClass;
+L_LoopValid: // here we fix non-existant classes
+ if(@ValidClasses[@loop] == Class) goto L_ValidClass;
+ set @loop, (@loop + 1);
+ if(@loop >= getarraysize(@ValidClasses)) goto L_FixClass;
+ goto L_LoopValid;
+
+L_FixClass:
+ set Class, @BaseClass;
+ goto L_ValidClass;
- L_ValidClass:
- if(Class == 0)
- setarray @HairStyles$, // TALPONIAN (human)
- "Bald", "Flat ponytail", "Bowl cut", "Combed back", "Emo", "Mohawk",
- "Pompadour", "Center parting/Short and slick", "Long and slick",
- "Short and curly", "Pigtails", "Long and curly", "Parted",
- "Perky ponytail", "Wave", "Mane", "Bun", "Shoulder Length Flick",
- "Fizzy", "Long and Clipped";
- if(Class == 0)
- setarray @HairColors$, // TALPONIAN (human)
- "Brunette", "Green", "Dark red", "Light purple", "Gray", "Blonde",
- "Teal", "Light red", "Blue", "Dark purple", "Black", "Pink",
- "Brown";//, "(free slot)", "(free slot)";
- // adding a new species is as simple as adding another if(Class == X) and adding the class to @ValidClasses
- return;
+L_ValidClass:
+ if(Class == 1)
+ setarray @HairStyles$, // TALPONIAN (human)
+ "Flat ponytail", "Bowl cut", "Combed back", "Emo", "Mohawk",
+ "Pompadour", "Center parting/Short and slick", "Long and slick",
+ "Short and curly", "Pigtails", "Long and curly", "Parted",
+ "Perky ponytail", "Wave", "Mane", "Bun", "Shoulder Length Flick",
+ "Fizzy", "Long and Clipped", "Bald";
+ if(Class == 1)
+ setarray @HairColors$, // TALPONIAN (human)
+ "Brunette", "Green", "Dark red", "Light purple", "Gray", "Blonde",
+ "Teal", "Light red", "Blue", "Dark purple", "Black", "Pink",
+ "Brown";//, "(free slot)", "(free slot)";
+ // adding a new species is as simple as adding another if(Class == X) and adding the class to @ValidClasses
+ goto L_Janitor;
}
diff --git a/world/map/npc/items/mirror.txt b/world/map/npc/items/mirror.txt
index fc2ca69b..82aeb7a7 100644
--- a/world/map/npc/items/mirror.txt
+++ b/world/map/npc/items/mirror.txt
@@ -4,8 +4,8 @@ function|script|useMirror|,
goto L_Rand;
L_Rand:
- set @style, rand(0,(getarraysize(@HairStyles$) -2));
- set @color, rand((15 * Class),((getarraysize(@HairColors$) -2) + (15 * Class)));
+ set @style, rand(1,(getarraysize(@HairStyles$) -2));
+ set @color, rand((15 * (Class - 1)),((getarraysize(@HairColors$) -2) + (15 * (Class - 1))));
if((getlook(LOOK_HAIR_STYLE) == @style) || (getlook(LOOK_HAIR_COLOR) == @color))
goto L_Rand;
goto L_Proceed;