summaryrefslogtreecommitdiff
path: root/world/map/npc
diff options
context:
space:
mode:
authorwushin <pasekei@gmail.com>2014-04-11 14:04:55 -0500
committerwushin <pasekei@gmail.com>2014-04-15 20:26:28 -0500
commit6e9543af67c5e027269bfc32e9c6f36111f3832a (patch)
treee18deac399a030b18b2e257060d8f435a13bd082 /world/map/npc
parent7632f53fd6f0c2accf45983d2885ef596d4bee7e (diff)
downloadserverdata-6e9543af67c5e027269bfc32e9c6f36111f3832a.tar.gz
serverdata-6e9543af67c5e027269bfc32e9c6f36111f3832a.tar.bz2
serverdata-6e9543af67c5e027269bfc32e9c6f36111f3832a.tar.xz
serverdata-6e9543af67c5e027269bfc32e9c6f36111f3832a.zip
Tutorial Edit
Switched to Bit mask Map Edits for the New Maps Less requirements to get out
Diffstat (limited to 'world/map/npc')
-rw-r--r--world/map/npc/022-1/tutorial.txt41
-rw-r--r--world/map/npc/041-1/tutorial.txt3
-rw-r--r--world/map/npc/042-1/hasan.txt174
-rw-r--r--world/map/npc/042-1/kaan.txt70
-rw-r--r--world/map/npc/042-1/valon.txt4
-rw-r--r--world/map/npc/042-2/sorfina.txt93
-rw-r--r--world/map/npc/042-2/tanisha.txt73
-rw-r--r--world/map/npc/functions/clear_vars.txt22
8 files changed, 269 insertions, 211 deletions
diff --git a/world/map/npc/022-1/tutorial.txt b/world/map/npc/022-1/tutorial.txt
index b8fcf2c6..93f1700a 100644
--- a/world/map/npc/022-1/tutorial.txt
+++ b/world/map/npc/022-1/tutorial.txt
@@ -1,20 +1,49 @@
// This file is part of the Tutorial
// Author: Jenalya
// if you enter the tutorial area from outside, it is set to be already done
+// Tutorial
+// Nibble 0
+// 1-4: Sorfina
-022-1.gat,19,37,0|script|#tutorial-outside1|45,0,2
+022-1.gat,46,82,0|script|#tutorial-outside1|45,2,1
{
callfunc "TutorialCompleted";
- warp "042-1.gat", 95, 69;
+ warp "042-1.gat", 115, 85;
end;
}
+-|script|#TutorialConfig|-1,
+{
+ end;
+
+OnInit:
+ set $@ScorpionFighter, 0;
+ set $@ScorpionTimer, 0;
+ set $@ScorpDeath, 0;
+ set $@SorfinaHasanBit, (1 << 4);
+ set $@TanishaHasanBit, (1 << 5);
+ end;
+}
+
+function|script|TutorialState|,
+{
+ callfunc "ClearVariables";
+ set @tutorial, ((TUTORIAL & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
+ set @sorfina_hasan, (TUTORIAL & $@SorfinaHasanBit);
+ set @tanisha_hasan, (TUTORIAL & $@TanishaHasanBit);
+ return;
+}
+
+function|script|SetTutorialMask|,
+{
+ set TUTORIAL, (TUTORIAL & ~(NIBBLE_0_MASK) | (@tutorial_tmp << NIBBLE_0_SHIFT));
+ set @tutorial_tmp, 0;
+ return;
+}
+
function|script|TutorialCompleted|,
{
- set hasan, 0;
- set kaan, 0;
- set sorfina, 0;
- set tanisha, 0;
set FLAGS, FLAGS | FLAG_TUTORIAL_DONE;
+ callfunc "ClearVariables";
return;
}
diff --git a/world/map/npc/041-1/tutorial.txt b/world/map/npc/041-1/tutorial.txt
index 98793d23..5c024e1f 100644
--- a/world/map/npc/041-1/tutorial.txt
+++ b/world/map/npc/041-1/tutorial.txt
@@ -5,6 +5,7 @@
041-1.gat,58,5,0|script|#tutorial-outside2|45,1,0
{
set FLAGS, FLAGS | FLAG_TUTORIAL_DONE;
- warp "042-1.gat", 44, 143;
+ callfunc "ClearVariables";
+ warp "042-1.gat", 44, 113;
end;
}
diff --git a/world/map/npc/042-1/hasan.txt b/world/map/npc/042-1/hasan.txt
index dc9ff3e4..25f7ff86 100644
--- a/world/map/npc/042-1/hasan.txt
+++ b/world/map/npc/042-1/hasan.txt
@@ -1,31 +1,28 @@
// This file is part of the Tutorial
// Authors: Jenalya, alastrim
-042-1.gat,90,61,0|script|Hasan|189,
+042-1.gat,116,84,0|script|Hasan|189,0,2,
{
- set @toll, 10000;
- set @x, getx();
- set @y, gety();
+ goto L_Main;
+L_Main:
if (FLAGS & FLAG_TUTORIAL_DONE)
goto L_Tut_Done;
- // Please consider rewriting this in terms of isin()
- // it's not that trivial to put this in a rectangle...
- if ( (@y < 58)&&(@x < 89) || (@x < 87) )
- goto L_Cliff_Up;
+
+ set @toll, 10000;
+ callfunc "TutorialState";
// implicitly, $@ScorpionFighter is nonzero
- if (getcharid(3) == $@ScorpionFighter)
- goto L_Fear;
- if (hasan == 4)
+ if (@tutorial == 13)
goto L_Thank;
- if (hasan == 3)
+ if ((getcharid(3) == $@ScorpionFighter) || ($@ScorpionFighter && $@ScorpionFighter != getcharid(3)))
+ goto L_Afraid;
+ if (@tutorial == 12)
goto L_Trick;
- if (hasan > 0)
+ if ((@tutorial == 10) || (@tutorial == 11))
goto L_Toll;
mes "[Unfriendly Guy]";
mes "\"Hey! You can't pass here.\"";
- next;
menu
"Why not?",L_Next,
"Who says that?",L_Next;
@@ -33,20 +30,25 @@
L_Next:
mes "[Unfriendly Guy]";
mes "\"I, Hasan the Mighty, have decided to put a toll on this path.\"";
+ set @tutorial_tmp, 10;
+ callfunc "SetTutorialMask";
next;
goto L_Toll;
L_Toll:
mes "[Hasan]";
mes "\"Give me " + @toll + "GP, and I may let you pass.\"";
- if (hasan == 0)
- set hasan, 1;
- next;
if (Zeny >= @toll)
- menu
- "Ok, here you go.",L_Pay,
- "What? I don't have that much money!",L_NoPay,
- "We'll see if you can stop me!",L_Fight;
+ goto L_HasToll;
+ goto L_NoToll;
+
+L_HasToll:
+ menu
+ "Ok, here you go.",L_Pay,
+ "What? I don't have that much money!",L_NoPay,
+ "We'll see if you can stop me!",L_Fight;
+
+L_NoToll:
menu
"What? I don't have that much money!",L_NoPay,
"We'll see if you can stop me!",L_Fight;
@@ -87,7 +89,6 @@ L_Cheat:
L_Trick:
mes "[Hasan]";
mes "\"Are you going to pay now? " + @toll + "GP, and I may let you pass.\"";
- next;
menu
"I don't have that much money!",L_NoPay,
"No. (Scratch your head.)",L_ScratchHead;
@@ -95,15 +96,12 @@ L_Trick:
L_ScratchHead:
if ($@ScorpionFighter)
goto L_Wait;
- mes "While you're scratching your head, you see Kaan coming nearer to the cliff above you.";
- // close2 blocks
- close2;
set $@ScorpionTimer, 0;
set $@ScorpionFighter, getcharid(3);
set $@ScorpDeath, PC_DIE_COUNTER;
- monster "042-1.gat",89,63,"Scorpion",1003,1, "Hasan::OnScorpionDeath";
- initnpctimer;
- end;
+ cmdothernpc "#ScorpionTrigger", "HasanSpawn";
+ mes "While you're scratching your head, you see Kaan approaching behind Hasan.";
+ close;
L_Thank:
mes "[Hasan]";
@@ -120,7 +118,6 @@ L_Thank:
callfunc "TutorialCompleted";
next;
mes "\"You want to go to the bazaar, right? Shall I tell you how to get there?\"";
- next;
menu
"Sure, thanks.",L_HasanThanks,
"I'll try to find the way myself.",L_Explore;
@@ -139,12 +136,6 @@ L_Explore:
mes "\"Alright. Take care!\"";
goto L_Close;
-L_Fear:
- mes "[Hasan]";
- mes "\"Sc-sc-sco-scorpion!\"";
- mes "He seems close to tears.";
- goto L_Close;
-
L_Tut_Done:
mes "[Hasan]";
if (BaseLevel >= 40)
@@ -153,44 +144,41 @@ L_Tut_Done:
mes "\"Bah, nothing interesting is happening here.\"";
goto L_Close;
-L_Cliff_Up:
- mes "You see a guy in shabby clothes when you look down the cliff.";
+L_Wait:
+ mes "There is a scorpion near Hasan already. I think Kaan is helping someone else... Maybe I should try the plan later.";
goto L_Close;
-L_SummonAgain:
- message strcharinfo(0), "Kaan is mad at you for your interference! He walks over to the edge of the cliff and throws a rock on top of your head, then lets another scorpion run just near Hasan!";
- percentheal -100, 0;
- message strcharinfo(0), "Kaan: \"Just go while he is distracted and no one is interfering!\"";
- monster "042-1.gat",89,63,"Scorpion",1003,1, "Hasan::OnScorpionDeath";
+L_Afraid:
+ message strcharinfo(0), "Hasan: \"" + strcharinfo(0) + "! Please help me!\"";
end;
-L_Clean:
- killmonster "042-1.gat", "Hasan::OnScorpionDeath";
- set $@ScorpionFighter, 0;
- set $@ScorpionTimer, 0;
- set $@ScorpDeath, 0;
- stopnpctimer;
- end;
+L_Close:
+ set @toll, 0;
+ close;
-L_TimeOut:
- message strcharinfo(0), "Hasan, with his eyes almost closed, trembling with fear, runs toward the scorpion and stabs it with all his strength! Seems like you took too long and the plan didn't work this time.";
- warp "042-1.gat", 91, 58;
- message strcharinfo(0), "Hasan: \"Hey you! I told you you cannot pass!\"";
- goto L_Clean;
+OnTouch:
+ if (FLAGS & FLAG_TUTORIAL_DONE)
+ goto L_Close;
+ goto L_Main;
+}
-L_MessageDeath:
- message strcharinfo(0), "Ouch... I should be more careful when fighting these monsters.";
- goto L_Clean;
+042-1.gat,0,0,0|script|#ScorpionTrigger|35,
+{
+ end;
-L_Wait:
- mes "There is a scorpion near Hasan already. I think Kaan is helping someone else... Maybe I should try the plan later.";
- goto L_Close;
+OnCommandHasanSpawn:
+ goto L_Summon;
-L_Close:
- set @toll, 0;
- set @x, 0;
- set @y, 0;
- close;
+L_Summon:
+ monster "042-1.gat",115,85,"Scorpion",1003,1, "#ScorpionTrigger::OnScorpionDeath";
+ initnpctimer;
+ end;
+
+L_SummonAgain:
+ message strcharinfo(0), "Kaan is mad at you for your interference! He walks over to the edge of the cliff and throws a rock on top of your head, then lets another scorpion run just near Hasan!";
+ percentheal -100, 0;
+ message strcharinfo(0), "Kaan: \"Just go while he is distracted and no one is interfering!\"";
+ goto L_Summon;
OnTimer5000:
if (attachrid($@ScorpionFighter) == 0)
@@ -206,50 +194,44 @@ OnTimer5000:
OnScorpionDeath:
if (getcharid(3) != $@ScorpionFighter)
goto L_SummonAgain;
- if (hasan != 3)
- end;
- set hasan, 4;
+ if (@tutorial != 12)
+ goto L_Clean;
+ set @tutorial_tmp, 13;
+ callfunc "SetTutorialMask";
message strcharinfo(0), "You saved Hasan.";
goto L_Clean;
-}
+L_TimeOut:
+ message strcharinfo(0), "Hasan, with his eyes almost closed, trembling with fear, runs toward the scorpion and stabs it with all his strength! Seems like you took too long and the plan didn't work this time.";
+ warp "042-1.gat", 114, 85;
+ message strcharinfo(0), "Hasan: \"Hey you! I told you you cannot pass!\"";
+ goto L_Clean;
-042-1.gat,90,62,0|script|#Toll|32767,2,2,
-{
- end;
+L_MessageDeath:
+ message strcharinfo(0), "Ouch... I should be more careful when fighting these monsters.";
+ goto L_Clean;
-OnTouch:
- // implicitly, $@ScorpionFighter is nonzero
- if ($@ScorpionFighter == getcharid(3))
- end;
- if ((FLAGS & FLAG_TUTORIAL_DONE) || (hasan == 4))
- end;
- warp "042-1.gat", 91, 58;
- message strcharinfo(0), "Hasan: \"Stop!\"";
+L_Clean:
+ killmonster "042-1.gat", "#ScorpionTrigger::OnScorpionDeath";
+ set $@ScorpionFighter, 0;
+ set $@ScorpionTimer, 0;
+ set $@ScorpDeath, 0;
+ stopnpctimer;
end;
-
}
-042-1.gat,96,69,0|script|#barrier|45,0,2
+042-1.gat,117,85,0|script|#warp|45,0,0,
{
- end;
-
-OnTouch:
if (FLAGS & FLAG_TUTORIAL_DONE)
goto L_Tut;
- warp "042-1.gat", 94, 69;
- // implicitly, $@ScorpionFighter is nonzero
- if ($@ScorpionFighter == getcharid(3))
- message strcharinfo(0), "Hasan: \"" + strcharinfo(0) + "! Please help me!\"";
- if ($@ScorpionFighter && $@ScorpionFighter != getcharid(3))
- // is this reachable?
- message strcharinfo(0), "Hasan: \"Hey! Stop right there!\"";
- if (hasan == 4)
- message strcharinfo(0), "Hasan: \"Please wait a moment!\"";
+ goto L_SendBack;
+
+L_SendBack:
+ message strcharinfo(0), "Hasan: I can do this all day.";
+ warp "042-1.gat", 114, 85;
end;
L_Tut:
- warp "022-1.gat", 23, 38;
+ warp "022-1.gat", 49, 82;
end;
-
}
diff --git a/world/map/npc/042-1/kaan.txt b/world/map/npc/042-1/kaan.txt
index a5f9f530..d2ba5877 100644
--- a/world/map/npc/042-1/kaan.txt
+++ b/world/map/npc/042-1/kaan.txt
@@ -1,15 +1,18 @@
// This file is part of the Tutorial
// Author: Jenalya
-042-1.gat,84,65,0|script|Kaan|160,
+042-1.gat,103,92,0|script|Kaan|160,
{
if (FLAGS & FLAG_TUTORIAL_DONE) goto L_Tut_Done;
- if (hasan == 4) goto L_Hasan_Saved;
+ callfunc "TutorialState";
+ if (@tutorial == 13) goto L_Hasan_Saved;
if ($@ScorpionFighter == getcharid(3)) goto L_Run;
- if (kaan == 4) goto L_Plan;
- if (kaan == 3) goto L_Trick;
- if (kaan == 2) goto L_Out;
- if (kaan == 1) goto L_Tanisha;
+ if (@tutorial == 12) goto L_Plan;
+ if ((@tutorial == 11) && ((@sorfina_hasan) || (@tanisha_hasan))) goto L_TrickKnown;
+ if (@tutorial == 11) goto L_Trick;
+ if (@tutorial == 10) goto L_Hasan;
+ if (@tutorial == 9) goto L_Out;
+ if (@tutorial == 8) goto L_Tanisha;
mes "[Young Man]";
mes "\"You're the person Tanisha brought here, right?";
@@ -22,22 +25,11 @@
mes "\"She hates maggots.\"";
next;
mes "\"Maybe you should go and see her...she was really upset about what happened to you.\"";
- set kaan, 1;
- if (tanisha >= 3)
- goto L_Tanisha2;
goto L_Close;
-L_Tanisha2:
- menu
- "I already did and helped her with the maggots.",L_Tanisha3,
- "I talked to her, and she's done with the maggots.",L_Tanisha3;
-
L_Tanisha:
mes "[Kaan]";
mes "\"Did you already talk to Tanisha?\"";
- if (tanisha < 3)
- goto L_Close;
- next;
menu
"Yes, I helped her with the maggots.",L_Tanisha3,
"Yeah, and she's done with the maggots.",L_Tanisha3;
@@ -54,7 +46,7 @@ L_Tanisha3:
mes "\"But I took care of that problem.\"";
mes "He looks very proud.";
next;
- mes "\"I built the fence down south of here to keep them out.\"";
+ mes "\"I've trapped or slain many scorpians south of here to keep them out of our fields.\"";
next;
menu
"Impressive! Just a bit... skewed.",L_Next,
@@ -62,7 +54,7 @@ L_Tanisha3:
L_Next:
mes "[Kaan]";
- mes "\"Well, it keeps the scorpions out. That's all that matters.\"";
+ mes "\"Well, I keep the scorpions out. That's all that matters.\"";
next;
mes "\"Are you going to visit Tulimshar?";
mes "The bazaar there is a wondeful place! Traders, entertainers, adventurers - it's very exciting.\"";
@@ -72,7 +64,8 @@ L_Next:
set Zeny, Zeny + 15;
next;
mes "\"And Ian the trainer is hanging around there often. You should talk to him, he's a smart guy.\"";
- set kaan, 2;
+ set @tutorial_tmp, 9;
+ callfunc "SetTutorialMask";
if (hasan)
menu
"A guy named Hasan won't let me enter Tulimshar.",L_Hasan,
@@ -82,16 +75,17 @@ L_Next:
L_Out:
mes "[Kaan]";
mes "\"Hello! How are you? Did you already visit Tulimshar?\"";
- next;
- if (hasan)
- menu
- "A guy named Hasan won't let me enter Tulimshar.",L_Hasan,
- "Not yet.",L_Close;
menu
"Not yet.",L_Close;
L_Hasan:
mes "[Kaan]";
+ mes "\"Hello! How are you? Did you already visit Tulimshar?\"";
+ menu
+ "A guy named Hasan won't let me enter Tulimshar.",L_Next1,
+ "Not yet.",L_Close;
+
+L_Next1:
mes "\"Hasan! That's crazy. He becomes more cheeky with every day.";
mes "I'd like to help you, but - I won't risk an open confrontation with him.\"";
next;
@@ -99,7 +93,8 @@ L_Hasan:
mes "He might listen to one of the adult men, but they're all off to work in Tulimshar during the day.\"";
next;
mes "\"We should think about some kind of trick. Ah, if only I knew his weak point.\"";
- set kaan, 3;
+ set @tutorial_tmp, 11;
+ callfunc "SetTutorialMask";
next;
goto L_Trick;
@@ -107,42 +102,43 @@ L_Trick:
mes "[Kaan]";
mes "\"Do you have any idea what Hasan's weakness could be?";
mes "I wonder if Sorfina or Tanisha know something about him that could help us.\"";
- if (hasan < 2)
- goto L_Close;
- next;
menu
- "He's afraid of scorpions.",L_Continue,
"No idea.",L_Close;
-L_Continue:
+L_TrickKnown:
+ mes "[Kaan]";
+ mes "\"Do you have any idea what Hasan's weakness could be?";
+ menu
+ "He's afraid of scorpions.",L_Next2,
+ "No idea.",L_Close;
+
+L_Next2:
mes "[Kaan]";
mes "\"Scorpions?! Right! How could I forget?";
mes "When he was a child, he nearly died because he fell into a scorpion nest.\"";
+ set @tutorial_tmp, 12;
+ callfunc "SetTutorialMask";
next;
goto L_Explain;
L_Explain:
mes "\"Ok, then here's the plan:";
- mes "I will catch one of the scorpions that's coming to the fence from the desert.\"";
+ mes "I will catch one of the scorpions behind the fences.\"";
next;
mes "\"You'll go to Hasan and give me a sign when you're ready.";
mes "Lets say the sign is that you're scratching your head.";
mes "I'll watch you from this point.\"";
next;
- mes "\"When you give me the sign, I'll throw the scorpion down on him.";
+ mes "\"When you give me the sign, I'll throw the scorpion on him.";
mes "While he's distracted with the scorpion, you can pass.\"";
next;
mes "\"How's that? We can start as soon as you're ready.\"";
- if (kaan == 3)
- set kaan, 4;
- set hasan, 3;
goto L_Close;
L_Plan:
mes "[Kaan]";
mes "\"I'm ready. Just give me the sign when you're down there.";
mes "Or do you want me to explain the plan again?\"";
- next;
menu
"Yes please.",L_Explain,
"No, everything's alright.",L_Close;
diff --git a/world/map/npc/042-1/valon.txt b/world/map/npc/042-1/valon.txt
index 63530aec..35636f94 100644
--- a/world/map/npc/042-1/valon.txt
+++ b/world/map/npc/042-1/valon.txt
@@ -1,7 +1,7 @@
// This file is part of the Tutorial
// Author: Jenalya
-042-1.gat,44,144,0|script|Valon|156,1,0
+042-1.gat,44,115,0|script|Valon|156,1,0
{
if (FLAGS & FLAG_TUTORIAL_DONE) goto L_Tut_Done;
@@ -27,7 +27,7 @@ L_Tut_Done:
OnTouch:
if (FLAGS & FLAG_TUTORIAL_DONE)
goto L_Tut;
- warp "042-1.gat", 44, 143;
+ warp "042-1.gat", 44, 110;
mes "[Valon]";
mes "\"The desert is merciless.";
mes "I can't let you leave like this.\"";
diff --git a/world/map/npc/042-2/sorfina.txt b/world/map/npc/042-2/sorfina.txt
index a7fd19ac..1fc9d2cf 100644
--- a/world/map/npc/042-2/sorfina.txt
+++ b/world/map/npc/042-2/sorfina.txt
@@ -3,11 +3,26 @@
042-2.gat,28,26,0|script|Sorfina|154,4,4
{
+ callfunc "TutorialState";
+
+ if ((Hp != MaxHp) && (@tutorial >= 4))
+ goto L_Heal;
+ goto L_Main;
+
+L_Heal:
+ mes "[Sorfina]";
+ mes "\"Hello Dear! You look tired, you should rest a moment.\"";
+ mes "You take a short nap and feel refreshed.";
+ heal MaxHp, 0;
+ goto L_Main;
+
+L_Main:
if (FLAGS & FLAG_TUTORIAL_DONE) goto L_Again;
- if (sorfina == 4) goto L_Heal;
- if (sorfina == 3) goto L_Clothes;
- if (sorfina == 2) goto L_Chest;
- if (sorfina == 1) goto L_Carpet;
+ if ((@tutorial == 11) && !(@sorfina_hasan)) goto L_Hasan;
+ if (@tutorial >= 4) goto L_Again;
+ if (@tutorial == 3) goto L_Clothes;
+ if (@tutorial == 2) goto L_Chest;
+ if (@tutorial == 1) goto L_Carpet;
callfunc "GameRules";
goto L_Start;
@@ -32,9 +47,8 @@ L_Start:
mes "Oh, and by the way my name is Sorfina.\"";
next;
mes "[Server]";
- mes "The explanations in this tutorial are based on the official client 0.5 series.";
+ mes "The explanations in this tutorial are based on the official client, Manaplus.";
mes "If you're using another client, settings and controls may be different.";
- next;
menu
"That would be great!",L_Tut,
"No, thanks. I already know how things are going.",L_SkipTut;
@@ -53,8 +67,8 @@ L_Carpet:
mes "[Sorfina]";
mes "\"Try to take a few steps and walk to that red carpet over there.";
mes "Just use the arrow keys or click on the place you want to go to.\"";
- if (!sorfina)
- set sorfina, 1;
+ set @tutorial_tmp, 1;
+ callfunc "SetTutorialMask";
goto L_Close;
L_Chest:
@@ -81,6 +95,11 @@ L_Clothes:
mes "[Sorfina]";
mes "\"That's much better, don't you think?\"";
next;
+ mes "\"Here take this.\"";
+ getitem "HitchhikersTowel", 1;
+ mes "\"Your HitchHikers Towel will return you to your last set soul menhir or here if not set.\"";
+ mes "\"It can't be used constantly as the magic needs time to power the jump.\"";
+ next;
mes "\"I think this will help you a bit. To get more information, press the button Setup and look at the controls on the Keyboard tab. You can also change them as you like.";
mes "Talk to me again if you want me to explain more things.\"";
next;
@@ -94,28 +113,13 @@ L_Clothes:
mes "\"And here is some money for you. At least you can buy yourself something to eat.";
mes "Good luck!\"";
set Zeny, Zeny + 30;
- set sorfina, 4;
+ set @tutorial_tmp, 4;
+ callfunc "SetTutorialMask";
goto L_Close;
-L_Heal:
- if (Hp == MaxHp)
- goto L_Again;
- mes "[Sorfina]";
- mes "\"Hello Dear! You look tired, you should rest a moment.\"";
- mes "You take a short nap and feel refreshed.";
- heal MaxHp, 0;
- next;
- goto L_Again;
-
L_Again:
mes "[Sorfina]";
mes "\"Make yourself at home! Do you have any questions?\"";
- next;
- if (hasan)
- menu
- "A guy named Hasan won't let me enter Tulimshar.",L_Hasan,
- "Yes, could you explain again about...",L_Explain,
- "No, thanks.",L_Close;
menu
"Yes, could you explain about...",L_Explain,
"No, thanks.",L_Close;
@@ -164,6 +168,9 @@ L_Items:
next;
mes "\"Miscellaneous items such as maggot slime, can be used in creating other items, or just to trade and sell.\"";
next;
+ mes "\"Your HitchHikers Towel will return you to your last set soul menhir or here if not set.\"";
+ mes "\"It can't be used constantly as the magic needs time to power the jump.\"";
+ next;
mes "\"Press F3 to open your inventory.";
mes "When placing your cursor over an item there, you can see a box with some information about that item.\"";
next;
@@ -198,6 +205,13 @@ L_Aidan:
L_Hasan:
mes "[Sorfina]";
+ mes "\"Make yourself at home! Do you have any questions?\"";
+ menu
+ "A guy named Hasan won't let me enter Tulimshar.",L_Next,
+ "Yes, could you explain again about...",L_Explain,
+ "No, thanks.",L_Close;
+
+L_Next:
mes "\"Ah, Hasan. He's causing trouble again?\"";
mes "She shakes her head.";
next;
@@ -218,14 +232,12 @@ L_Hasan:
next;
mes "\"However, the scorpions poison caused a bad fever and once Hasan had recovered from that, he was even more malicious than before.\"";
mes "She sighs.";
- if (hasan == 1)
- set hasan, 2;
+ set TUTORIAL, TUTORIAL | $@SorfinaHasanBit;
goto L_Close;
L_SkipTut:
mes "[Sorfina]";
mes "\"Really? You seem quite unexperienced. Listening to some advice won't hurt.\"";
- next;
menu
"Thinking about it twice... please tell me.",L_Tut,
"Yeah, but thanks for the offer. Bye.",L_Bye;
@@ -237,6 +249,7 @@ L_Bye:
getitem "Knife", 1;
getitem "SlingShot", 1;
getitem "SlingBullet", 100;
+ getitem "HitchhikersTowel", 1;
getitem "CottonShirt", 1;
getitem "RaggedShorts", 1;
set Zeny, Zeny + 50;
@@ -258,7 +271,8 @@ OnTouch:
end;
OnTouch:
- if (sorfina != 1)
+ callfunc "TutorialState";
+ if (@tutorial != 1)
end;
mes "[Sorfina]";
mes "\"Very good! I'm glad you're recovering.";
@@ -272,14 +286,16 @@ OnTouch:
mes "\"To interact with things in your environment or talk to NPCs you can either click on it or press N to focus and T to talk/activate.\"";
next;
mes "\"Now get the clothes out of the chest.\"";
- set sorfina, 2;
+ set @tutorial_tmp, 2;
+ callfunc "SetTutorialMask";
close;
}
-042-2.gat,27,23,0|script|Chest#sorfina|111,
+042-2.gat,27,23,0|script|Chest#tutorial|111,
{
- if (sorfina > 2) goto L_Empty;
- if (sorfina == 2) goto L_Shirt;
+ callfunc "TutorialState";
+ if (@tutorial > 2) goto L_Empty;
+ if (@tutorial == 2) goto L_Shirt;
mes "The chest is locked.";
close;
@@ -295,7 +311,8 @@ L_Shirt:
mes "\"You can open your inventory by pressing F3 or clicking on the 'Inventory' button in the bar at the upper right corner.\"";
next;
mes "\"After we finish talking, click on the clothes and press the equip button.\"";
- set sorfina, 3;
+ set @tutorial_tmp, 3;
+ callfunc "SetTutorialMask";
close;
L_Empty:
@@ -303,15 +320,15 @@ L_Empty:
close;
}
-042-2.gat,44,31,0|script|#DoorOut-sorfina|45,0,0
+042-2.gat,44,31,0|script|#DoorOut-@tutorial|45,0,0
{
end;
OnTouch:
- if ((sorfina < 4)
- && !(FLAGS & FLAG_TUTORIAL_DONE))
+ callfunc "TutorialState";
+ if ((@tutorial < 4) && !(FLAGS & FLAG_TUTORIAL_DONE))
goto L_Block;
- warp "042-1.gat", 63, 77;
+ warp "042-1.gat", 63, 49;
end;
L_Block:
diff --git a/world/map/npc/042-2/tanisha.txt b/world/map/npc/042-2/tanisha.txt
index 673ab696..482224f0 100644
--- a/world/map/npc/042-2/tanisha.txt
+++ b/world/map/npc/042-2/tanisha.txt
@@ -8,17 +8,19 @@
goto L_Fighting;
if (FLAGS & FLAG_TUTORIAL_DONE) goto L_Tut_Done;
- if (tanisha == 4) goto L_Again;
- if (tanisha == 3) goto L_Stats;
- if (tanisha == 2) goto L_Fail;
- if (tanisha == 1) goto L_Maggots;
+
+ callfunc "TutorialState";
+ if ((@tutorial == 11) && !(@tanisha_hasan)) goto L_Hasan;
+ if (@tutorial >= 8) goto L_Again;
+ if (@tutorial == 7) goto L_Stats;
+ if (@tutorial == 6) goto L_Fail;
+ if (@tutorial == 5) goto L_Maggots;
mes "[Tanisha]";
mes "\"Hey! You're up again!\"";
emotion EMOTE_HAPPY;
next;
mes "\"Are you feeling better?\"";
- next;
menu
"Yes, thank you.",L_Next,
"Yeah, but all my stuff is gone.",L_Next;
@@ -28,7 +30,8 @@ L_Next:
mes "\"I'm glad you're feeling better. It was really bad luck what happened to you.";
mes "Hey, I have an idea.\"";
next;
- set tanisha, 1;
+ set @tutorial_tmp, 5;
+ callfunc "SetTutorialMask";
goto L_Maggots;
L_Maggots:
@@ -38,12 +41,11 @@ L_Maggots:
next;
mes "\"If you kill them, I'll give you my knife.";
mes "What do you say?\"";
- next;
menu
- "Sure!",L_Continue,
+ "Sure!",L_Next1,
"That's your job.",L_Close;
-L_Continue:
+L_Next1:
mes "[Tanisha]";
mes "\"Wonderful!\"";
// since the check happens here, it is actually possible to have
@@ -51,9 +53,10 @@ L_Continue:
// but that's not a BIG problem
if (getareausers("042-2.gat", 30, 85, 36, 89) >= $@Maggot_MaxHunters)
goto L_Crowded;
- goto L_FightAgain;
+ next;
+ goto L_Fight_Again;
-L_FightAgain:
+L_Fight_Again:
mes "\"Ok, listen what to do.";
mes "Equip a weapon and kill the maggots.\"";
next;
@@ -66,9 +69,10 @@ L_FightAgain:
next;
mes "\"Sometimes dead monsters leave some useful things. You can pick them up by pressing Z or clicking on the items with your mouse.\"";
close2;
- // The getitem must be in the same place as set tanisha, 2;
- // since it was moved to after L_FightAgain, add it conditionally
- if (tanisha == 1)
+ // The getitem must be in the same place as set @tutorial, 2;
+ // since it was moved to after L_Fight_Again, add it conditionally
+ callfunc "TutorialState";
+ if (@tutorial == 5)
goto L_GetFightItems;
goto L_ContinueFight;
@@ -79,7 +83,8 @@ L_GetFightItems:
goto L_ContinueFight;
L_ContinueFight:
- set tanisha, 2;
+ set @tutorial_tmp, 6;
+ callfunc "SetTutorialMask";
set @Maggot_Kills, 0;
set @time, 0;
if (getareausers("042-2.gat", 30, 85, 36, 89) == 0)
@@ -124,7 +129,7 @@ L_StatsRe:
mes "[Tanisha]";
mes "\"But I doubt he'd do that without a service in return.\"";
- if (tanisha != 3)
+ if (@tutorial != 7)
goto L_Close;
goto L_Money;
@@ -141,19 +146,18 @@ L_Advice:
mes "\"When you go to Tulimshar, you should see Bernard. He can make a delicious soup!";
mes "Good luck!\"";
emotion EMOTE_HAPPY;
- if (tanisha == 3)
- set tanisha, 4;
+ if (@tutorial == 7)
+ goto L_SetTutorial;
+ goto L_Close;
+
+L_SetTutorial:
+ set @tutorial_tmp, 8;
+ callfunc "SetTutorialMask";
goto L_Close;
L_Again:
mes "[Tanisha]";
mes "\"Hi there! Is everything alright? Do you have questions?\"";
- next;
- if (hasan)
- menu
- "A guy named Hasan won't let me enter Tulimshar.",L_Hasan,
- "Yes, could you explain again about...",L_Explain,
- "No, thanks.",L_Close;
menu
"Yes, could you explain again about...",L_Explain,
"No, thanks.",L_Close;
@@ -192,13 +196,20 @@ L_Mob:
L_Hasan:
mes "[Tanisha]";
+ mes "\"Hi there! Is everything alright? Do you have questions?\"";
+ menu
+ "A guy named Hasan won't let me enter Tulimshar.",L_Next3,
+ "Yes, could you explain again about...",L_Explain,
+ "No, thanks.",L_Close;
+
+L_Next3:
+ mes "[Tanisha]";
mes "\"Bah, Hasan. He's a jerk. But he's very strong.\"";
next;
mes "\"The only thing he's afraid of are scorpions.";
mes "I'm not sure why, some bad experience when he was a child.";
mes "That was before I was born.\"";
- if (hasan == 1)
- set hasan, 2;
+ set TUTORIAL, TUTORIAL | $@TanishaHasanBit;
goto L_Close;
L_Tut_Done:
@@ -243,15 +254,14 @@ L_Fail:
mes "[Tanisha]";
mes "\"Oops, I'm sorry. It's just too funny.";
mes "Do you want to try it again?\"";
- next;
menu
- "Sure!", L_TryAgain,
+ "Sure!", L_Next2,
"No, I need a rest.", L_Close;
-L_TryAgain:
+L_Next2:
if (getareausers("042-2.gat", 30, 85, 36, 89) >= $@Maggot_MaxHunters)
goto L_Crowded;
- goto L_FightAgain;
+ goto L_Fight_Again;
L_Fighting:
message strcharinfo(0), "Tanisha: I believe in you!";
@@ -297,7 +307,8 @@ OnMaggotDeath:
goto L_Summon;
// else, complete
warp "042-2.gat", 36, 90;
- set tanisha, 3;
+ set @tutorial_tmp, 7;
+ callfunc "SetTutorialMask";
set @Maggot_Kills, 0;
set @time, 0;
if (getareausers("042-2.gat", 30, 85, 36, 89) == 0)
diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt
index ef4f217a..b83ea630 100644
--- a/world/map/npc/functions/clear_vars.txt
+++ b/world/map/npc/functions/clear_vars.txt
@@ -2,6 +2,28 @@
function|script|ClearVariables|,
{
+ // Tutorial
+ if (sorfina)
+ goto L_SetAllTut;
+ goto L_Easter;
+
+L_SetAllTut:
+ if (FLAGS & FLAG_TUTORIAL_DONE)
+ goto L_ResetAllTut;
+ set @tutorial_tmp, (sorfina + tanisha + hasan + kaan);
+ set TUTORIAL, (TUTORIAL & ~(NIBBLE_0_MASK) | (@tutorial_tmp << NIBBLE_0_SHIFT));
+ set @tutorial_tmp, 0;
+ goto L_ResetAllTut;
+
+L_ResetAllTut:
+ set sorfina, 0;
+ set tanisha, 0;
+ set hasan, 0;
+ set kaan, 0;
+ goto L_Easter;
+
+L_Easter:
+ // Easter
set EasterQuest, 0;
// Halloween 2006