Skip to content

Commit

Permalink
replace commonVar in CAPS; update var in magic; remove useless functi…
Browse files Browse the repository at this point in the history
…on in clear_vars; update and fix some things about comments of last commit
  • Loading branch information
omattornot committed May 21, 2016
1 parent 83830cc commit 070f183
Show file tree
Hide file tree
Showing 43 changed files with 344 additions and 446 deletions.
14 changes: 7 additions & 7 deletions world/map/db/quest-log.txt
Expand Up @@ -28,10 +28,10 @@
20,QL_TERRANITE_ARMOR,QUEST_NorthTulimshar,6,4
// 21 => assassin quest
22,QL_CELESTIA,QUEST_Hurnscald,2,8
23,QL_Caretaker,QUEST_Graveyard_Caretaker,0,4
24,QL_Orum,OrumQuest,0,8
25,QL_Furquest,QUEST_WG_state,0,8
26,QL_Bandit,QUEST_Hurnscald,0,4
27,QL_Hinnak,QUEST_Hurnscald,1,4
28,QL_Demon_mask,QUEST_Hurnscald,2,4
29,QL_Inspector,QUEST_Hurnscald,3,4
23,QL_CARETAKER,QUEST_Graveyard_Caretaker,0,4
24,QL_ORUM,OrumQuest,0,8
25,QL_FURQUEST,QUEST_WG_state,0,8
26,QL_BANDIT,QUEST_Hurnscald,0,4
27,QL_HINNAK,QUEST_Hurnscald,1,4
28,QL_DEMON_MASK,QUEST_Hurnscald,2,4
29,QL_INSPECTOR,QUEST_Hurnscald,3,4
16 changes: 5 additions & 11 deletions world/map/npc/002-2/hetchel.txt
Expand Up @@ -7,8 +7,8 @@
// She could also sell, dyed sheets, Silk robes from Lora Tay.
// (6000 with cocoons, 40000 (?) with no cocoons).
//
// @wg_state: variable indicating winter gloves status.
// Lora Tay proposes silk Robe if (@wg_state>= 11).
// QL_FURQUEST: variable indicating winter gloves status.
// Lora Tay proposes silk Robe if (QL_FURQUEST>= 11).
// @SHEET_COCOONS_NR:* Number of cocoons required per sheet.
// Might ne calculated from @ROBE_COCOONS_NR/@ROBE_SHEETS_NR
// Actually: 150∕6 = 25
Expand All @@ -19,7 +19,6 @@

002-2,76,92,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;
Expand All @@ -31,7 +30,7 @@
set @spants_job_reward, 10000;
set @SheetCount, 0;

if (@wg_state < 11)
if (QL_FURQUEST < 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;
Expand Down Expand Up @@ -395,7 +394,6 @@ S_Update_Spants:

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;
Expand All @@ -404,18 +402,16 @@ L_Close:
set @SHEET_COCOONS_NR, 0;
set @SHEET_ZENY, 0;
set @SheetCount, 0;
set @wg_state, 0;
cleararray @items$, "", getarraysize(@items$);
cleararray @item_names$, "", getarraysize(@item_names$);
close;
}

002-2,73,95,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 "Lora Tay Quest State: "+ QL_FURQUEST;
mes "Silk Pants Quest State: "+ @spants_state;

menu
Expand All @@ -425,7 +421,7 @@ menu

L_Lora_Tay:
mes "Set Lora Tay Visited State (0 - reset , 11 - enough for SilkPants Quest)";
input @wg_state;
input QL_FURQUEST;
goto L_Close;

L_Spants:
Expand All @@ -434,8 +430,6 @@ L_Spants:
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;
Expand Down
9 changes: 4 additions & 5 deletions world/map/npc/002-2/troupe_leader.txt
Expand Up @@ -2,10 +2,9 @@

002-2,81,21,0|script|Troupe Leader|165
{
set QL_Inspector, ((QUEST_Hurnscald & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);

if (QL_Inspector == 4) goto L_NohMask_Troupe;
if (QL_Inspector == 13) goto L_NohMask_Found;
if (QL_INSPECTOR == 4) goto L_NohMask_Troupe;
if (QL_INSPECTOR == 13) goto L_NohMask_Found;

mes "[Troupe Leader]";
mes "\"Hello. I'm the leader of a traveling theater troupe. We'll be staying here in Tulimshar for a while.\"";
Expand All @@ -21,7 +20,7 @@ L_NohMask_Troupe:
"Hmm...", L_Close;

L_NohMask_Idea:
set QL_Inspector, 5;
set QL_INSPECTOR, 5;
mes "[Troupe Leader]";
mes "\"Hm...I did see an old man hang out near the theater after our last show.\"";
goto L_Close;
Expand All @@ -38,7 +37,7 @@ L_NohMask_Found:
if (@inventorylist_count == 100) goto L_NohMask_TooMany;
mes "[1500 experience points]";
getexp 1500, 0;
set QL_Inspector, 14;
set QL_INSPECTOR, 14;
getitem "NohMask", 1;
next;
mes "[Troupe Leader]";
Expand Down
40 changes: 19 additions & 21 deletions world/map/npc/008-1/hinnak.txt
Expand Up @@ -7,23 +7,21 @@

008-1,101,30,0|script|Hinnak|142
{
set QL_Inspector, ((QUEST_Hurnscald & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);

if ((GM >= DBG_HINNAK || debug) && getequipid(equip_head) == 647)
goto L_DeveloperBoard;

if (QL_Inspector == 10) goto L_NohMask;
if (QL_INSPECTOR == 10) goto L_NohMask;
goto L_No_NohMask;

L_DeveloperBoard:
callfunc "HinnakDebug";
close;

L_No_NohMask:
set QL_Hinnak, ((QUEST_Hurnscald & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT);

if (QL_Hinnak == 1) goto L_Exchange;
if (QL_Hinnak == 2) goto L_ThanksAgain;
if (QL_HINNAK == 1) goto L_Exchange;
if (QL_HINNAK == 2) goto L_ThanksAgain;
if (getequipid(equip_head) == 751) goto L_Intro_Hat;

mes "[Farmer Hinnak]";
Expand Down Expand Up @@ -60,7 +58,7 @@ L_Help:
mes "[Farmer Hinnak]";
mes "\"Yes, you look quite fast. Maybe you can catch some of them. That will pay them a lesson.";
mes "Slay some of them and bring me 10 of their antennae.\"";
set QL_Hinnak, 1;
set QL_HINNAK, 1;
next;
menu
"Sure, I'm on my way", L_Close,
Expand Down Expand Up @@ -94,7 +92,7 @@ L_Exchange_Exchange:
goto L_Exchange_TooMany;
delitem "PinkAntenna", 10;
getitem "Scythe", 1;
set QL_Hinnak, 2;
set QL_HINNAK, 2;
mes "[Farmer Hinnak]";
mes "\"Thank you very much. I've got something for you. My old scythe. Maybe you can use it as a weapon. It is a bit cumbersome but its strikes are deadly.\"";
goto L_Close;
Expand Down Expand Up @@ -258,30 +256,30 @@ L_Close:

function|script|HinnakDebug
{
goto L_Menu;

L_Menu:
goto L_Debug;

L_Debug:
mes "The value of the quest variable QL_HINNAK is currently " + QL_HINNAK + ".";
mes "If state 0, quest don't start.";
mes "If state 1, quest started, you need 10 pink antenna.";
mes "if state 2, quest finished, you got the scythe.";
if (debug)
menu
"Show Quest State", L_ShowState,
"Set Quest State", L_SetState,
"Reset", L_Reset,
"Nothing, close.", L_Close;

L_ShowState:
mes "The value of the quest variable QL_Hinnak is currently " + QL_Hinnak + ".";
goto L_Menu;
close;

L_SetState:
mes "What state do you want?";
input @quest_state;
set QL_Hinnak, @quest_state;
mes "Set to " + QL_Hinnak;
goto L_Menu;
input QL_HINNAK;
mes "Set to " + QL_HINNAK;
goto L_Debug;

L_Reset:
set QL_Hinnak, 0;
set QL_HINNAK, 0;
mes "Reset!";
goto L_Menu;
goto L_Debug;

L_Close:
close;
Expand Down
9 changes: 4 additions & 5 deletions world/map/npc/009-1/jack.txt
Expand Up @@ -29,7 +29,6 @@
set @Q_Forestbow, ((QUEST_Forestbow_state & @Q_Forestbow_MASK) >> @Q_Forestbow_SHIFT);
set @Q_Woodenshield, ((QUEST_Forestbow_state & @Q_Woodenshield_MASK) >> @Q_Woodenshield_SHIFT);

set QL_Inspector, ((QUEST_Hurnscald & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);

if (@Q_Woodenshield >= 3) goto L_Shield_state_3;
if (@Q_Woodenshield == 2) goto L_Shield_state_2;
Expand All @@ -38,7 +37,7 @@

mes "[Jack Lumber]";
mes "\"Hello there! My name is Jack Lumber, the enemy of all trees. If you need some firewood, just let me know.\"";
if (QL_Inspector == 1)
if (QL_INSPECTOR == 1)
goto L_NohMask_Ask;
goto L_NotInspector;

Expand Down Expand Up @@ -117,7 +116,7 @@ L_Bow_state_2:
if (@Q_Forestbow > 3) goto L_Bow_state_4;

mes "\"Good luck hunting those tree monsters – you'll need it.\"";
if (QL_Inspector != 1)
if (QL_INSPECTOR != 1)
goto L_Close;
goto L_NohMask_Ask;

Expand Down Expand Up @@ -158,7 +157,7 @@ L_Shield_state_1:
mes "[Jack Lumber]";
mes "\"I have an idea. What would you say about a new shield?\"";
next;
if (QL_Inspector == 1)
if (QL_INSPECTOR == 1)
menu
"No thanks.", L_Close,
"Yes, please!", L_Yes,
Expand Down Expand Up @@ -234,7 +233,7 @@ L_Shield_state_3:
mes "[Jack Lumber]";
mes "\"I hope that my shield will serve you well!\"";
next;
if (QL_Inspector != 1)
if (QL_INSPECTOR != 1)
goto L_Made_Shield;
menu
"Me too.", L_Made_Shield,
Expand Down
3 changes: 1 addition & 2 deletions world/map/npc/009-1/milly.txt
Expand Up @@ -8,7 +8,6 @@

009-1,81,41,0|script|Milly|114
{
set QL_Inspector, ((QUEST_Hurnscald & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);

set @got_boneknife, ((QUEST_Forestbow_state & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT) >= 4;
set @got_setzer, ((QUEST_Forestbow_state & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT) >= 8;
Expand Down Expand Up @@ -359,7 +358,7 @@ L_Close:
close;

S_InspectorMaybe:
if (QL_Inspector != 1)
if (QL_INSPECTOR != 1)
goto L_Return;
menu
"Have you seen anything strange lately?", L_NohMask_Strange,
Expand Down
8 changes: 3 additions & 5 deletions world/map/npc/009-1/old_man.txt
Expand Up @@ -2,13 +2,12 @@

009-1,85,51,0|script|Old Man|159
{
set QL_Inspector, ((QUEST_Hurnscald & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);

mes "[Old Man]";
mes "\"Don't let those monsters get to you.\"";
next;
if (QL_Inspector == 1) goto L_Ask;
if (QL_Inspector == 6) goto L_Accuse;
if (QL_INSPECTOR == 1) goto L_Ask;
if (QL_INSPECTOR == 6) goto L_Accuse;
goto L_Close;

L_Ask:
Expand All @@ -30,8 +29,7 @@ L_Accuse:
L_Accuse_Respond:
mes "[Old Man]";
mes "\"Yes, I hung around the theater a lot. I was an actor when I was younger. But I wasn't there that night. Me and the wife were at home all night.\"";
set QL_Inspector, 7;
set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_3_MASK)) | (QL_Inspector << NIBBLE_3_SHIFT);
set QL_INSPECTOR, 7;
goto L_Close;

L_Close:
Expand Down
23 changes: 11 additions & 12 deletions world/map/npc/009-1/old_woman.txt
Expand Up @@ -2,31 +2,30 @@

009-1,29,43,0|script|Old Woman|154
{
set QL_Inspector, ((QUEST_Hurnscald & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);

if (BaseLevel < 40) goto L_Lower;

mes "[Old Woman]";
mes "\"Hello deary.\"";
if ((QL_Inspector >= 1 && QL_Inspector <= 7) || QL_Inspector == 9)
if ((QL_INSPECTOR >= 1 && QL_INSPECTOR <= 7) || QL_INSPECTOR == 9)
goto L_NohMask;
close;

L_Lower:
mes "[Old Woman]";
mes "\"Watch out for these flowers. They don't like to be messed with.\"";
if ((QL_Inspector >= 1 && QL_Inspector <= 7) || QL_Inspector == 9)
if ((QL_INSPECTOR >= 1 && QL_INSPECTOR <= 7) || QL_INSPECTOR == 9)
goto L_NohMask;
close;

L_NohMask:
next;
if (QL_Inspector == 7)
if (QL_INSPECTOR == 7)
goto L_NohMask_Alibi;
callfunc "ProcessEquip";
if (@torsoC == cDarkBlue && @legsC == cDarkBlue)
goto L_NohMask_Fake;
if (QL_Inspector >= 3 && QL_Inspector <= 6)
if (QL_INSPECTOR >= 3 && QL_INSPECTOR <= 6)
goto L_Close;
menu
"Have you seen anything strange lately?", L_NohMask_FirstAsk,
Expand All @@ -36,9 +35,9 @@ L_NohMask:
L_NohMask_FirstAsk:
mes "[Old Woman]";
mes "\"Yes, but I'm only talking to the inspector himself!\"";
if (QL_Inspector != 1)
if (QL_INSPECTOR != 1)
goto L_Close;
set QL_Inspector, 2;
set QL_INSPECTOR, 2;
goto L_Close;

L_NohMask_Alibi:
Expand All @@ -48,16 +47,16 @@ L_NohMask_Alibi:
L_Next:
mes "[Old Woman]";
mes "\"Yes, we were both at home all night.\"";
set QL_Inspector, 8;
set QL_INSPECTOR, 8;
goto L_Close;

L_NohMask_Fake:
if (QL_Inspector == 9) goto L_NohMask_Fake_Satchel;
if (QL_Inspector >= 3 && QL_Inspector <= 6) goto L_NohMask_Filler;
if (QL_INSPECTOR == 9) goto L_NohMask_Fake_Satchel;
if (QL_INSPECTOR >= 3 && QL_INSPECTOR <= 6) goto L_NohMask_Filler;

mes "[Old Woman]";
mes "\"I saw someone sneaking around town wearing a theater mask. It looked like one of the masks used by the troupe that was in town recently.\"";
set QL_Inspector, 3;
set QL_INSPECTOR, 3;
goto L_Close;

L_NohMask_Filler:
Expand All @@ -68,7 +67,7 @@ L_NohMask_Filler:
L_NohMask_Fake_Satchel:
mes "[Old Woman]";
mes "\"I've remembered something else. The night the troupe left, I saw someone with a theater mask take a large satchel out of town. He was heading north.\"";
set QL_Inspector, 10;
set QL_INSPECTOR, 10;
goto L_Close;

L_Close:
Expand Down
3 changes: 1 addition & 2 deletions world/map/npc/009-1/sabine.txt
Expand Up @@ -2,12 +2,11 @@

009-1,88,27,0|script|Sabine|106
{
set QL_Inspector, ((QUEST_Hurnscald & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);

mes "[Sabine]";
mes "\"Isn't this place pretty? I love hanging out here!\"";
next;
if (QL_Inspector != 1)
if (QL_INSPECTOR != 1)
goto L_Close;

menu
Expand Down

0 comments on commit 070f183

Please sign in to comment.