summaryrefslogtreecommitdiff
path: root/world/map/npc/042-1
diff options
context:
space:
mode:
Diffstat (limited to 'world/map/npc/042-1')
-rw-r--r--world/map/npc/042-1/hasan.txt31
-rw-r--r--world/map/npc/042-1/kaan.txt51
-rw-r--r--world/map/npc/042-1/liana.txt16
-rw-r--r--world/map/npc/042-1/tutorial.txt61
-rw-r--r--world/map/npc/042-1/valon.txt70
-rw-r--r--world/map/npc/042-1/zegas.txt31
6 files changed, 163 insertions, 97 deletions
diff --git a/world/map/npc/042-1/hasan.txt b/world/map/npc/042-1/hasan.txt
index 722c8f62..39e549cd 100644
--- a/world/map/npc/042-1/hasan.txt
+++ b/world/map/npc/042-1/hasan.txt
@@ -8,31 +8,41 @@
042-1.gat,104,49,0|script|Scared Man|160,
{
- if ((@hasan_complete) && ((@tutorial == 12) || (@tutorial == 14)))
+ setarray @npc_loc, 104, 49, 4;
+ callfunc "PCtoNPCRange";
+ if (@npc_check)
+ goto L_End;
+ if (@tutorial >= 13)
goto L_TutDone;
message strcharinfo(0), "He looks too afraid to say anything.";
- end;
+ goto L_End;
L_TutDone:
message strcharinfo(0), "Thanks. Kaan's been much nicer to me now";
+ goto L_End;
+
+L_End:
end;
}
042-1.gat,102,49,0|script|Hasan|189,2,2,
{
+ setarray @npc_loc, 102, 49, 4;
+ callfunc "PCtoNPCRange";
+ if (@npc_check)
+ goto L_Close;
goto L_Main;
L_Main:
callfunc "TutorialState";
if ((getcharid(3) == $@ScorpionFighter) || ($@ScorpionFighter && $@ScorpionFighter != getcharid(3)))
goto L_Afraid;
- if ((@hasan_complete) && ((@tutorial == 12) || (@tutorial == 14)))
+ if (@tutorial == 14)
goto L_TutDone;
- // implicitly, $@ScorpionFighter is nonzero
- if ((@hasan_complete) && (@tutorial == 13))
+ if (@tutorial == 13)
goto L_Thank;
- if (@tutorial == 12)
+ if (@tutorial == 12)
goto L_Trick;
- if ((@tutorial == 10) || (@tutorial == 11))
+ if ((@tutorial == 9) || (@tutorial == 10) || (@tutorial == 11))
goto L_FightAgain;
mes "You over hear some people nearby.";
@@ -58,7 +68,7 @@ L_Main:
next;
mes "Sounds like this person is in trouble.\"";
next;
- set @tutorial_tmp, 10;
+ set @tutorial_tmp, 9;
callfunc "SetTutorialMask";
mes "[Unfriendly Guy]";
mes "\"What are you looking at?\"";
@@ -93,7 +103,8 @@ L_Trick:
L_ScratchHead:
if ($@ScorpionFighter)
goto L_Wait;
- set TUTORIAL, TUTORIAL | $@HasanCompleteBit;
+ set @tutorial_tmp, 14;
+ callfunc "SetTutorialMask";
set $@ScorpionTimer, 0;
set $@ScorpionFighter, getcharid(3);
set $@ScorpDeath, PC_DIE_COUNTER;
@@ -157,7 +168,7 @@ L_Close:
close;
OnTouch:
- if ((@hasan_complete) && ((@tutorial == 12) || (@tutorial == 14)))
+ if (@tutorial >= 13)
end;
goto L_Main;
}
diff --git a/world/map/npc/042-1/kaan.txt b/world/map/npc/042-1/kaan.txt
index 0d71cee3..1444cd67 100644
--- a/world/map/npc/042-1/kaan.txt
+++ b/world/map/npc/042-1/kaan.txt
@@ -3,16 +3,22 @@
042-1.gat,109,87,0|script|Kaan|160,
{
+ setarray @npc_loc, 109, 87, 4;
+ callfunc "PCtoNPCRange";
+ if (@npc_check)
+ goto L_Close;
+
callfunc "TutorialState";
- if ((@hasan_complete) && (@tutorial == 13)) goto L_Hasan_Saved;
- if (@hasan_complete) goto L_TutDone;
+ if (!(@kaan_talked)) goto L_Tanisha;
+ if (@tutorial >= 13) goto L_TutDone;
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;
+ if (@tutorial == 11) goto L_TrickKnown;
+ if (@tutorial == 10) goto L_Trick;
+ if (@tutorial == 9) goto L_Hasan;
+ goto L_Out;
+L_Tanisha:
+ set STARTAREA, STARTAREA | $@SpokeToKaan;
mes "[Young Man]";
mes "\"You're the person Tanisha brought here, right?";
mes "My name is Kaan, I'm her brother.\"";
@@ -23,17 +29,12 @@
mes "[Kaan]";
mes "\"She hates maggots.\"";
next;
- mes "\"Maybe you should go and see her...she was really upset about what happened to you.\"";
- goto L_Close;
-
-L_Tanisha:
- mes "[Kaan]";
mes "\"Did you already talk to Tanisha?\"";
menu
- "Yes, I helped her with the maggots.",L_Tanisha3,
- "Yeah, and she's done with the maggots.",L_Tanisha3;
+ "Yes, I helped her with the maggots.",L_Tanisha1,
+ "Yeah, and she's done with the maggots.",L_Tanisha1;
-L_Tanisha3:
+L_Tanisha1:
mes "[Kaan]";
mes "\"Ah, that is good news.";
mes "You know, we have a lot of problems with bugs here.\"";
@@ -58,17 +59,7 @@ L_Next:
mes "\"Are you going to visit Tulimshar?";
mes "The bazaar there is a wondeful place! Traders, entertainers, adventurers - it's very exciting.\"";
next;
- mes "\"Ah, I forgot. Without some money the bazaar is less fun I suppose.";
- mes "Here, take this.\"";
- 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 @tutorial_tmp, 9;
- callfunc "SetTutorialMask";
- if (hasan)
- menu
- "A guy named Hasan is bullying someone.",L_Hasan,
- "Thanks for the advice.",L_Close;
goto L_Out;
L_Out:
@@ -92,7 +83,7 @@ L_Next1:
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 @tutorial_tmp, 11;
+ set @tutorial_tmp, 10;
callfunc "SetTutorialMask";
next;
goto L_Trick;
@@ -142,14 +133,6 @@ L_Plan:
"Yes please.",L_Explain,
"No, everything's alright.",L_Close;
-L_Hasan_Saved:
- mes "[Kaan]";
- mes "\"You did not to fight the scorpion.";
- mes "But maybe Hasan is more thankful now?\"";
- next;
- mes "\"Why don't you talk to him again and see what he says.\"";
- goto L_Close;
-
L_TutDone:
mes "[Kaan]";
mes "\"Hi there. I hope you enjoy your time in Tulimshar.";
diff --git a/world/map/npc/042-1/liana.txt b/world/map/npc/042-1/liana.txt
index 6eb9972b..f1e5a4f9 100644
--- a/world/map/npc/042-1/liana.txt
+++ b/world/map/npc/042-1/liana.txt
@@ -2,11 +2,23 @@
042-1.gat,82,96,0|script|Liana|205,
{
- set @npcname$, "Liana";
+ setarray @npc_loc, 82, 96, 4;
+ callfunc "PCtoNPCRange";
+ if (@npc_check)
+ goto L_End;
+ goto L_Talk;
- mes "[" + @npcname$ + "]";
+L_Talk:
+ mes "[Liana]";
mes "\"Tulimshar is a large city. I'm sure glad I live in the suburbs because I know where everything's at.\"";
next;
mes "\"I think Tanisha is in the building to the right. That girl is growing up fast.\"";
+ goto L_Close;
+
+L_End:
+ mes "You'll have to move closer";
+ goto L_Close;
+
+L_Close:
close;
}
diff --git a/world/map/npc/042-1/tutorial.txt b/world/map/npc/042-1/tutorial.txt
index 3129faaa..d51c30be 100644
--- a/world/map/npc/042-1/tutorial.txt
+++ b/world/map/npc/042-1/tutorial.txt
@@ -1,10 +1,67 @@
// This file is part of the Tutorial
// Author: Jenalya
-// if you enter the tutorial area, it is set to be already done
+// if you enter the tutorial area from outside, it is set to be already done
+-|script|#TutorialConfig|-1,
+{
+ end;
+OnInit:
+ set $@ScorpionFighter, 0;
+ set $@ScorpionTimer, 0;
+ set $@ScorpDeath, 0;
+ set $@SpokeToKaan, (1 << 31);
+ end;
+}
+function|script|TutorialState|,
+{
+ callfunc "ClearVariables";
+ set @tutorial, ((STARTAREA & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
+ set @kaan_talked, (STARTAREA & $@SpokeToKaan);
+ return;
+}
+function|script|SetTutorialMask|,
+{
+ set STARTAREA, (STARTAREA & ~(NIBBLE_0_MASK) | (@tutorial_tmp << NIBBLE_0_SHIFT));
+ set @tutorial_tmp, 0;
+ return;
+}
+042-2.gat,21,26,0|script|TutDebug|154,
+{
+ mes "[TutDebug]";
+ mes "Reset?";
+ menu
+ "Yes.",L_Reset,
+ "No.",L_End;
+
+L_Reset:
+ set TUT_var, 0;
+ set @tutorial_tmp, 0;
+ set STARTAREA, (STARTAREA & ~(NIBBLE_0_MASK) | (@tutorial_tmp << NIBBLE_0_SHIFT));
+ set STARTAREA, STARTAREA &~ $@SpokeToKaan;
+ mes "Reset!";
+ goto L_End;
+
+L_End:
+ end;
+
+OnInit:
+ if(!debug)
+ disablenpc "TutDebug";
+ end;
+}
042-1.gat,63,47,0|script|#tutorialoutside|45,0,0
{
- callfunc "TutorialCompleted";
+ callfunc "TutorialState";
+ if (@tutorial >= 8)
+ goto L_Warp;
+ goto L_ResetTutorial;
+
+L_ResetTutorial:
+ set @tutorial_tmp, 8;
+ callfunc "SetTutorialMask";
+ goto L_Warp;
+
+L_Warp:
warp "042-2.gat", 114, 92;
end;
}
diff --git a/world/map/npc/042-1/valon.txt b/world/map/npc/042-1/valon.txt
index a844f861..f4296af9 100644
--- a/world/map/npc/042-1/valon.txt
+++ b/world/map/npc/042-1/valon.txt
@@ -5,8 +5,6 @@
end;
OnInit:
- set $@ValonStartBit, (1 << 6);
- set $@ValonEndBit, (1 << 7);
setarray $@ValonMob, 1002,1050,1046,1003;
setarray $@ValonMobName$, "Maggots","House Maggots","Tame Scorpions","Scorpion";
setarray $@ValonMobCnt, 10,5,3,1;
@@ -14,32 +12,30 @@ OnInit:
}
function|script|ValonState|,
{
- set @valon_mob, ((TUTORIAL & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT);
- set @valon_count, ((TUTORIAL & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);
- set @valon_start, (TUTORIAL & $@ValonStartBit);
- set @valon_end, (TUTORIAL & $@ValonEndBit);
+ set @valon_state, ((STARTAREA & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT);
+ set @valon_mob, 0;
+ if (@valon_state >= 2)
+ set @valon_mob, (@valon_state - 2);
+ set @valon_count, ((STARTAREA & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT);
return;
}
-function|script|AddValonMobMask|,
+function|script|setValonMask|,
{
- set @valon_tmp, (@valon_mob + 1);
- if (@valon_tmp > 15)
- set @valon_tmp, 15;
- set TUTORIAL, (TUTORIAL & ~(NIBBLE_2_MASK) | (@valon_tmp << NIBBLE_2_SHIFT));
+ set STARTAREA, (STARTAREA & ~(NIBBLE_1_MASK) | (@valon_tmp << NIBBLE_1_SHIFT));
set @valon_tmp, 0;
return;
}
function|script|ResetValonCntMask|,
{
- set TUTORIAL, (TUTORIAL & ~(NIBBLE_3_MASK) | (0 << NIBBLE_3_SHIFT));
+ set STARTAREA, (STARTAREA & ~(NIBBLE_2_MASK) | (0 << NIBBLE_2_SHIFT));
return;
}
function|script|AddValonCntMask|,
{
set @valon_tmp, (@valon_count + 1);
- if (@valon_tmp > 15)
- set @valon_tmp, 15;
- set TUTORIAL, (TUTORIAL & ~(NIBBLE_3_MASK) | (@valon_tmp << NIBBLE_3_SHIFT));
+ if (@valon_tmp > $@ValonMobCnt[@valon_mob])
+ set @valon_tmp, $@ValonMobCnt[@valon_mob];
+ set STARTAREA, (STARTAREA & ~(NIBBLE_2_MASK) | (@valon_tmp << NIBBLE_2_SHIFT));
set @valon_tmp, 0;
callfunc "ValonProgress";
return;
@@ -47,7 +43,7 @@ function|script|AddValonCntMask|,
function|script|ValonProgress|,
{
callfunc "ValonState";
- if ((@valon_start) && (!(@valon_end)))
+ if ((@valon_state > 1) && (@valon_state < 6))
message strcharinfo(0), $@ValonMobName$[@valon_mob] + ": " + @valon_count + "/" + $@ValonMobCnt[@valon_mob];
return;
}
@@ -60,10 +56,8 @@ function|script|ValonProgress|,
"No.", L_End;
L_Reset:
- set TUTORIAL, (TUTORIAL & ~(NIBBLE_2_MASK) | (0 << NIBBLE_2_SHIFT));
- set TUTORIAL, (TUTORIAL & ~(NIBBLE_3_MASK) | (0 << NIBBLE_3_SHIFT));
- set TUTORIAL, TUTORIAL &~ $@ValonStartBit;
- set TUTORIAL, TUTORIAL &~ $@ValonEndBit;
+ set STARTAREA, (STARTAREA & ~(NIBBLE_1_MASK) | (0 << NIBBLE_1_SHIFT));
+ set STARTAREA, (STARTAREA & ~(NIBBLE_2_MASK) | (0 << NIBBLE_2_SHIFT));
mes "Reset!";
goto L_End;
@@ -77,14 +71,18 @@ OnInit:
}
042-1.gat,48,111,0|script|Valon|156,
{
+ setarray @npc_loc, 48, 111, 4;
+ callfunc "PCtoNPCRange";
+ if (@npc_check)
+ goto L_Close;
callfunc "ValonState";
- if (@valon_end)
+ if (@valon_state >= 6)
goto L_QuestComplete;
- if (!(@valon_start) && (@valon_count))
+ if (@valon_start == 1)
goto L_QuestAskAgain;
- if (((@valon_start) && (!(@valon_end))) && (@valon_count >= $@ValonMobCnt[@valon_mob]))
+ if (@valon_count >= $@ValonMobCnt[@valon_mob])
goto L_NextMob;
- if ((@valon_start) && (!(@valon_end)))
+ if ((@valon_state >= 2) && (@valon_state < 6))
goto L_QuestStarted;
goto L_QuestAsk;
@@ -93,7 +91,7 @@ L_QuestAskAgain:
mes "\"Hello, Adventurer! Have you come back to help?\"";
menu
"Yes. I will help with the desert beasts.", L_Accept,
- "Maybe some other time.", L_NoThanks;
+ "Maybe some other time.", L_Close;
L_QuestAsk:
mes "[Valon]";
@@ -109,17 +107,17 @@ L_QuestAsk:
mes "\"Maybe you would like help and earn your stripes?\"";
next;
mes "\"The Council of Wizard's does offer a reward for helping...\"";
+ set @valon_tmp, 1;
+ callfunc "setValonMask";
+ callfunc "ResetValonCntMask";
menu
"YES!!! let me at them!", L_Accept,
- "Maybe some other time.", L_NoThanks;
-
-L_NoThanks:
- callfunc "AddValonCntMask";
- goto L_Close;
+ "Maybe some other time.", L_Close;
L_Accept:
- callfunc "ResetValonCntMask";
- set TUTORIAL, TUTORIAL | $@ValonStartBit;
+ set @valon_tmp, 2;
+ callfunc "setValonMask";
+ callfunc "ValonState";
goto L_NewMob;
L_NextMob:
@@ -128,10 +126,11 @@ L_NextMob:
next;
mes "\"The Wizard's thank thee as well.\"";
set Zeny, Zeny + 25;
- next;
+ set @valon_tmp, (@valon_state + 1);
+ callfunc "setValonMask";
callfunc "ResetValonCntMask";
- callfunc "AddValonMobMask";
callfunc "ValonState";
+ next;
if (@valon_mob == getarraysize($@ValonMob))
goto L_QuestOver;
goto L_NewMob;
@@ -155,7 +154,8 @@ L_QuestOver:
mes "[Valon]";
mes "\"Thanks once again for helping with the monsters in the desert.\"";
getexp 50, 0;
- set TUTORIAL, TUTORIAL | $@ValonEndBit;
+ set @valon_tmp, (@valon_state + 1);
+ callfunc "setValonMask";
goto L_Close;
L_QuestComplete:
diff --git a/world/map/npc/042-1/zegas.txt b/world/map/npc/042-1/zegas.txt
index d3dc118c..36443a91 100644
--- a/world/map/npc/042-1/zegas.txt
+++ b/world/map/npc/042-1/zegas.txt
@@ -32,7 +32,8 @@ L_Meet:
mes "\"Wouldn't you know it, the bug bomb Eomie gave us is in one of the store room barrels.\"";
next;
mes "\"Can you search the barrels for the bug bomb and set it off when you find it?\"";
- set TUTORIAL, TUTORIAL | $@ZegasMetBit;
+ set @barrel_tmp, 1;
+ callfunc "SetBarrelMask";
menu
"Sure.",L_Start,
"Maybe some other time.",L_Close;
@@ -48,7 +49,8 @@ L_Find:
L_Start:
mes "[Zegas]";
- set TUTORIAL, TUTORIAL | $@BarrelStartBit;
+ set @barrel_tmp, 2;
+ callfunc "SetBarrelMask";
mes "\"Thanks, come back and see me once you found the bug bomb and set it off.\"";
goto L_Close;
@@ -60,11 +62,12 @@ L_Looking:
L_QuestEnd:
mes "[Zegas]";
mes "\"From the smell I can see you found the bug bomb!\"";
- getexp 50, 0;
- next;
mes "\"Thanks once again, I know it's not much but here is 50 GP for your troubles.\"";
+ getexp 50, 0;
set Zeny, (Zeny + 50);
- set TUTORIAL, TUTORIAL | $@BarrelEndBit;
+ set @barrel_tmp, 4;
+ callfunc "SetBarrelMask";
+ next;
goto L_Close;
L_Thanks:
@@ -84,15 +87,15 @@ L_Close:
"No.", L_End;
L_Reset:
- set TUTORIAL, TUTORIAL &~ $@BarrelStartBit;
- set TUTORIAL, TUTORIAL &~ $@BarrelEndBit;
- set TUTORIAL, TUTORIAL &~ (1 << 17);
- set TUTORIAL, TUTORIAL &~ (1 << 18);
- set TUTORIAL, TUTORIAL &~ (1 << 19);
- set TUTORIAL, TUTORIAL &~ (1 << 20);
- set TUTORIAL, TUTORIAL &~ (1 << 21);
- set TUTORIAL, TUTORIAL &~ (1 << 22);
- set TUTORIAL, TUTORIAL &~ (1 << 30);
+ set STARTAREA, (STARTAREA & ~(NIBBLE_4_MASK) | (0 << NIBBLE_4_SHIFT));
+ set STARTAREA, STARTAREA &~ (1 << 20);
+ set STARTAREA, STARTAREA &~ (1 << 21);
+ set STARTAREA, STARTAREA &~ (1 << 22);
+ set STARTAREA, STARTAREA &~ (1 << 23);
+ set STARTAREA, STARTAREA &~ (1 << 24);
+ set STARTAREA, STARTAREA &~ (1 << 25);
+ set STARTAREA, STARTAREA &~ (1 << 26);
+ set STARTAREA, STARTAREA &~ (1 << 27);
mes "Reset!";
goto L_End;